Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always specify branch in git dependencies #552

Merged

Conversation

sunshowers
Copy link
Contributor

This is PR 1 of 3 to make sure that omicron doesn't get two separate
dependencies, one for progenitor with main and one for progenitor
without main.

We choose this strategy over not doing so to maintain uniformity in
cases where a non-default branch must be used.

@sunshowers sunshowers requested review from ahl and leftwo December 2, 2022 20:46
@sunshowers
Copy link
Contributor Author

There are no functional changes here so I'm just going to land this to unblock omicron.

@sunshowers sunshowers merged commit 861a09c into main Dec 2, 2022
@sunshowers sunshowers deleted the sunshowers/spr/always-specify-branch-in-git-dependencies branch December 2, 2022 21:22
@leftwo
Copy link
Contributor

leftwo commented Dec 2, 2022

The one tricky non obvious dependency here is being sure that both Omicron and Propolis can build with
new versions of Crucible. We sometimes change the API, and those changes have to all go together with each
other. The crucible crucible-client-types is the place where things typically break.

In this case, nothing has changed recently, so it should be fine. And usually when we are in these intermediate
states, everyone knows about it.

@sunshowers
Copy link
Contributor Author

@leftwo yeah! I did run into this in oxidecomputer/propolis#262.

sunshowers added a commit to oxidecomputer/propolis that referenced this pull request Dec 3, 2022
This is PR 2 of N to make sure that omicron doesn't get two separate
dependencies, one for progenitor with main and one for progenitor
without main.

For PR 1, see oxidecomputer/crucible#552.

Without this fix, omicron ends up with two separate versions of
crucible, which causes build failures in omicron.

The update caused some breakage from
oxidecomputer/crucible#516, which I've tried to
address (cc @leftwo to confirm that my changes look good).

Reviewers: gjcolombo

Reviewed By: gjcolombo

Pull Request: #262
sunshowers added a commit to oxidecomputer/omicron that referenced this pull request Dec 5, 2022
This is PR 3 of N in this series. For the earlier ones, see:

* oxidecomputer/crucible#552
* oxidecomputer/propolis#262

Currently, we specify the progenitor dependency as both:

```toml
progenitor-client = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
```

And

```toml
progenitor-client = { git = "https://github.com/oxidecomputer/progenitor" }
```

Cargo (due to rust-lang/cargo#7497) doesn't
dedup these dependencies even
though they resolve to the same branch and hash. This causes issues with
`cargo doc` colliding with itself, as it tries to document both:

```
Documenting progenitor-impl v0.2.1-dev (https://github.com/oxidecomputer/progenitor#4b5cef4b)
Documenting progenitor-impl v0.2.1-dev (https://github.com/oxidecomputer/progenitor?branch=main#4b5cef4b)
```

Fix this by always using the branch name. (We choose this option over
not specifying the branch so to maintain uniformity in cases where a
non-default branch must be used.)

This also requires a crucible update, since that didn't specify a branch
either. And the crucible update necessitates a propolis update to get
the versions aligned.

In the future it would be nice to have a lint which ensures that git
dependencies always have the branch name in them.
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