Skip to content

Build a platform gem with gem build --platform for the local platform - #9873

Open
hsbt wants to merge 1 commit into
masterfrom
claude/reverent-darwin-2e9b0c
Open

hsbt wants to merge 1 commit into
masterfrom
claude/reverent-darwin-2e9b0c

Conversation

@hsbt

@hsbt hsbt commented Sep 15, 2026

Copy link
Copy Markdown
Member

Running gem build --platform aarch64-linux on aarch64 Linux builds foo-1.0.gem instead of foo-1.0-aarch64-linux.gem. Passing any other platform works. Gem::Specification#initialize never infers the local platform from Gem.platforms, so the option has no effect when it names the local platform.

With this change gem build applies the local platform when --platform names it and the gemspec leaves the platform unset. A platform set in the gemspec still wins, so s.platform = "java" builds a java gem whatever --platform says. Behavior for non-local platforms is unchanged.

Fixes #9344

Generated with Claude Code

Gem::Specification#initialize skips the local platform when it takes the
platform from Gem.platforms, so the option produced a ruby platform gem.
A platform set in the gemspec still wins.

#9344

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hsbt
hsbt force-pushed the claude/reverent-darwin-2e9b0c branch from 46a0022 to 4467791 Compare September 15, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running gem build --platform aarch64-linux on aarch64 Linux creates a non platform-specific gem

1 participant