Skip to content

fix: publish only gems compiled with default options - #39

Merged
Thejus-Paul merged 2 commits into
mainfrom
fix/38-publish-default-builds-only
Oct 13, 2026
Merged

Thejus-Paul merged 2 commits into
mainfrom
fix/38-publish-default-builds-only

Conversation

@Thejus-Paul

Copy link
Copy Markdown
Member

Fixes #38.

On a self-hosted setup with publishing turned on, a machine that compiled a gem with its own build options, for example pg pointed at a specific PostgreSQL install, uploaded that build to the shared cache. Everyone else on the same platform then installed it as the standard copy of the gem, although it was compiled for one machine's setup and nothing told them so.

Gems compiled with build options are no longer uploaded, so the shared cache only holds builds made with default options.

A publisher with PREBAKE_PUSH_ENABLED=true uploaded every gem it
compiled, including gems built with options from
`bundle config build.<gem>`. Everyone else on the same platform then
received that build as the default build of the gem.

RubyGems records the build args of an installed gem, and
`spec.build_args` reads them back. A gem with recorded build args is no
longer pushed, which mirrors the consumer side: such a gem already
skips the cache and builds from source.

Bundler records no build args for git and path gems, so build options
on those gems still go unseen.
@Thejus-Paul Thejus-Paul self-assigned this Oct 13, 2026
@Thejus-Paul
Thejus-Paul marked this pull request as ready for review October 13, 2026 06:53
@Thejus-Paul
Thejus-Paul merged commit 6055b57 into main Oct 13, 2026
6 checks passed
@Thejus-Paul
Thejus-Paul deleted the fix/38-publish-default-builds-only branch October 13, 2026 06:53
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.

Shared cache serves gems compiled with another machine's build options

1 participant