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

Use crates.io over git for dependencies #950

Closed
djacu opened this issue Dec 18, 2024 · 1 comment
Closed

Use crates.io over git for dependencies #950

djacu opened this issue Dec 18, 2024 · 1 comment

Comments

@djacu
Copy link

djacu commented Dec 18, 2024

Problem

The presence of git dependencies can be problematic for build systems like Nix. progenitor as a git dependencies and progenitor-client as a registry causes the build to fail because it tries to vendor progenitor-client from two places: from crates.io as a direct dependency, and from GitHub as a transitive dependency of progenitor.

I would like to add oxide-rs to nixpkgs. Currently, I have a draft PR in using my fork and some modifications to make packaging possible and so @sarcasticadmin and I can test the CLI application. NixOS/nixpkgs#366077

Solution

  • Use the registry for dependencies when possible. It is most important when a diamond dependency can be created as in the case of progenitor.
  • Use the patch mechanism of cargo to change the source of dependencies during development. As is currently being done here:
    #[patch."https://github.com/oxidecomputer/progenitor"]
    .

Other

A secondary ask but not currently critical to resolving this issue. Please consider publishing oxnet and thouart to crates.io. It would make packaging the software in nixpkgs easier as we would not have to vendor the lock file.

djacu added a commit to djacu/oxide.rs that referenced this issue Dec 18, 2024
The presence of git dependencies can be problematic for build systems
like Nix. `progenitor` as a git dependencies and `progenitor-client` as
a registry causes the build to fail because it tries to vendor
`progenitor-client` from two places: from crates.io as a direct
dependency, and from GitHub as a transitive dependency of `progenitor`.

This commit changes the Cargo.toml and lock file to pull `progenitor`
from the registry instead of GitHub.

Fixes oxidecomputer#950
@djacu djacu closed this as completed Dec 19, 2024
@sarcasticadmin
Copy link

sarcasticadmin commented Dec 19, 2024

Thanks @ahl for the changes in #952

For releases after 0.9.0+20241204.0.0 we should be able to package oxide.rs in nixpkgs without having to do any extra patching.

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 a pull request may close this issue.

2 participants