Skip to content

fix: install in place instead of accumulating versioned kegs#47

Merged
fabianburth merged 2 commits into
open-component-model:mainfrom
fabianburth:fix/canonical-ocm-formula
Jun 10, 2026
Merged

fix: install in place instead of accumulating versioned kegs#47
fabianburth merged 2 commits into
open-component-model:mainfrom
fabianburth:fix/canonical-ocm-formula

Conversation

@fabianburth

@fabianburth fabianburth commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

brew install of this tap currently installs each release as a side-by-side keg instead of upgrading in place, so users pile up ocm@0.18.0, ocm@0.40.0, …, ocm@0.43.0 over time.

Two issues, two commits:

  • Formula/ocm.rb was stale at v0.18.0. The release pipeline only ever updated the versioned ocm@<version>.rb files. Bump it to v0.43.0 to match the latest release.
  • Aliases/ocm shadowed Formula/ocm.rb and pointed at the latest versioned formula. Brew aliases take precedence over same-named formula files, so brew install …/ocm resolved to ocm@0.43.0 (a versioned formula). Homebrew treats versioned formulas as separate packages, hence the pile-up. Remove the alias so the canonical Formula/ocm.rb is what resolves.

The companion change in open-component-model/ocm updates the release pipeline to keep Formula/ocm.rb in sync going forward and stop creating the alias: open-component-model/ocm#1997

Migration

Existing users on the alias path stay on ocm@0.43.0 because brew sees that formula still exists in the tap and there's no ocm keg to upgrade. One-time migration:

brew uninstall ocm@0.43.0
brew install open-component-model/tap/ocm

WE NEED TO FLAG THIS IN THE RELEASE NOTES AND ON THE WEBSITE!
Also, this is a pre-requisite for the updated release flow to work. So it needs to be merged before the next ocm release.

Test plan

  • Locally tapped this branch via symlink. brew info …/ocm resolves to canonical name: "ocm", aliases: [], stable 0.43.0.
  • brew info …/ocm@0.43.0 still resolves to the versioned formula (opt-in pin still works).
  • Reviewer sanity-checks the diff.

The unversioned formula was stuck at v0.18.0 because the release pipeline
only ever updated the versioned ocm@<version>.rb files. Sync it to the
current release so brew install of the canonical name resolves to a
non-stale formula.

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
The alias pointed at a versioned formula (ocm@0.43.0.rb), so brew install
resolved the canonical name to a versioned formula. Versioned formulas are
treated as separate packages by Homebrew and install side-by-side instead
of upgrading in place, which caused users to accumulate a new keg per
release.

With the alias gone, brew install resolves to Formula/ocm.rb (the
canonical, unversioned formula), and brew upgrade replaces it in place.

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
fabianburth added a commit to open-component-model/open-component-model that referenced this pull request Jun 10, 2026
## Summary

Add a callout to the legacy install docs explaining the one-time
migration step for users who installed the OCM CLI via Homebrew before
the tap was fixed.

Background: earlier tap releases installed the CLI as a version-pinned
formula (e.g. \`ocm@0.43.0\`), so brew treated each release as a
separate package and accumulated side-by-side kegs instead of upgrading
in place. The tap is now fixed to use the canonical \`Formula/ocm.rb\`
(open-component-model/homebrew-tap#47, with the
release pipeline change in
open-component-model/ocm#1997), but existing
users stay stuck on their pinned version until they manually uninstall
it and reinstall the canonical formula.

## Test plan

- [x] Render the legacy install docs and verify the callout displays
correctly.
- [x] Reviewer sanity-checks the wording.

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
@fabianburth fabianburth merged commit a7ab56b into open-component-model:main Jun 10, 2026
2 checks passed
@fabianburth fabianburth deleted the fix/canonical-ocm-formula branch June 10, 2026 09:09
fabianburth added a commit to open-component-model/ocm that referenced this pull request Jun 10, 2026
…1997)

## Summary

Users who install via `brew install open-component-model/tap/ocm`
accumulate a new keg per release (`ocm@0.40.0`, `ocm@0.41.0`, …) instead
of upgrading in place. Root cause is in this repo's release pipeline.

The publish workflow only ever generated `Formula/ocm@<version>.rb` and
pointed `Aliases/ocm` at the latest one. Brew aliases shadow same-named
formula files and resolve to the target, so `brew install …/ocm`
installed a versioned formula. Homebrew treats versioned formulas as
separate packages and installs them side-by-side, hence the pile-up.

Generate **both** files on every release:

- `Formula/ocm.rb` (class `Ocm`) — canonical, overwritten each release;
`brew install ocm` upgrades in place.
- `Formula/ocm@<version>.rb` (class `OcmAT<digits>`) — opt-in pin; users
who want a specific version run `brew install ocm@X.Y.Z`.

Drop the `Aliases/ocm` symlink creation in the workflow and remove any
stale symlink left over from earlier runs.

Companion cleanup in the tap (bumps `Formula/ocm.rb` to v0.43.0 manually
so users aren't stuck on v0.18.0 until the next release, and removes the
existing `Aliases/ocm`):
open-component-model/homebrew-tap#47

## Test plan

- [x] `go test ./...` in `hack/brew` passes
- [x] Generator output for v0.43.0 byte-identical to the existing tap
files (both `Formula/ocm.rb` and `Formula/ocm@0.43.0.rb`)
- [x] Locally tapped a synthetic tap with both generated files: `brew
info …/ocm` resolves to canonical formula 0.43.0; `brew info
…/ocm@0.43.0` still resolves to the versioned formula
- [x] Reviewer sanity-checks the workflow diff

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
ocmbot Bot pushed a commit to open-component-model/open-component-model that referenced this pull request Jun 10, 2026
## Summary

Add a callout to the legacy install docs explaining the one-time
migration step for users who installed the OCM CLI via Homebrew before
the tap was fixed.

Background: earlier tap releases installed the CLI as a version-pinned
formula (e.g. \`ocm@0.43.0\`), so brew treated each release as a
separate package and accumulated side-by-side kegs instead of upgrading
in place. The tap is now fixed to use the canonical \`Formula/ocm.rb\`
(open-component-model/homebrew-tap#47, with the
release pipeline change in
open-component-model/ocm#1997), but existing
users stay stuck on their pinned version until they manually uninstall
it and reinstall the canonical formula.

## Test plan

- [x] Render the legacy install docs and verify the callout displays
correctly.
- [x] Reviewer sanity-checks the wording.

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com> 18bfd88
matthiasbruns pushed a commit to knp-sap/ocm that referenced this pull request Jun 15, 2026
…pen-component-model#1997)

## Summary

Users who install via `brew install open-component-model/tap/ocm`
accumulate a new keg per release (`ocm@0.40.0`, `ocm@0.41.0`, …) instead
of upgrading in place. Root cause is in this repo's release pipeline.

The publish workflow only ever generated `Formula/ocm@<version>.rb` and
pointed `Aliases/ocm` at the latest one. Brew aliases shadow same-named
formula files and resolve to the target, so `brew install …/ocm`
installed a versioned formula. Homebrew treats versioned formulas as
separate packages and installs them side-by-side, hence the pile-up.

Generate **both** files on every release:

- `Formula/ocm.rb` (class `Ocm`) — canonical, overwritten each release;
`brew install ocm` upgrades in place.
- `Formula/ocm@<version>.rb` (class `OcmAT<digits>`) — opt-in pin; users
who want a specific version run `brew install ocm@X.Y.Z`.

Drop the `Aliases/ocm` symlink creation in the workflow and remove any
stale symlink left over from earlier runs.

Companion cleanup in the tap (bumps `Formula/ocm.rb` to v0.43.0 manually
so users aren't stuck on v0.18.0 until the next release, and removes the
existing `Aliases/ocm`):
open-component-model/homebrew-tap#47

## Test plan

- [x] `go test ./...` in `hack/brew` passes
- [x] Generator output for v0.43.0 byte-identical to the existing tap
files (both `Formula/ocm.rb` and `Formula/ocm@0.43.0.rb`)
- [x] Locally tapped a synthetic tap with both generated files: `brew
info …/ocm` resolves to canonical formula 0.43.0; `brew info
…/ocm@0.43.0` still resolves to the versioned formula
- [x] Reviewer sanity-checks the workflow diff

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
sk31337 pushed a commit to sk31337/open-component-model that referenced this pull request Jun 19, 2026
…n-component-model#2802)

## Summary

Add a callout to the legacy install docs explaining the one-time
migration step for users who installed the OCM CLI via Homebrew before
the tap was fixed.

Background: earlier tap releases installed the CLI as a version-pinned
formula (e.g. \`ocm@0.43.0\`), so brew treated each release as a
separate package and accumulated side-by-side kegs instead of upgrading
in place. The tap is now fixed to use the canonical \`Formula/ocm.rb\`
(open-component-model/homebrew-tap#47, with the
release pipeline change in
open-component-model/ocm#1997), but existing
users stay stuck on their pinned version until they manually uninstall
it and reinstall the canonical formula.

## Test plan

- [x] Render the legacy install docs and verify the callout displays
correctly.
- [x] Reviewer sanity-checks the wording.

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: sk31337 <sk31337@users.noreply.github.com>
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.

2 participants