-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
rustPlatform.fetchCargoVendor: allow duplicated dependencies #387337
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
base: staging
Are you sure you want to change the base?
Conversation
f7be6ba
to
27dd560
Compare
Should target staging considering the amount of rebuilds |
Yes I'll point it there soon, but I still have a few TODOs. |
7a1c9bb
to
b0e4125
Compare
b0e4125
to
1cf6ec4
Compare
1cf6ec4
to
242f358
Compare
242f358
to
6899498
Compare
Unfortunately, this does not fix the sui problem. I debugged it by adding "set -x" on the cargo-vendor-dir command:
The problem is triggered by 2 versions of the tokio-macros used by sui |
You are using In this PR I only modified I was able to build sui with this: {
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
zstd,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "sui";
version = "1.43.1";
src = fetchFromGitHub {
owner = "MystenLabs";
repo = "sui";
tag = "mainnet-v${finalAttrs.version}";
hash = "sha256-mNljh3HupusGmfT3pXtjqUp7OZHhyWd6jNiFiKlSYpk=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-ckotvpQw3WfvJ2YXR/XKT7LamGj7kLtGwMR/qrXpmYc=";
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = [
zstd
];
env = {
# if this is not set the build will try to invoke git to get the rev
GIT_REVISION = "nixpkgs@${finalAttrs.version}";
ZSTD_SYS_USE_PKG_CONFIG = true;
};
# the build takes up more than 60G of space even without the checks
# my system ran out of space (150G) when having tests enabled
doCheck = false;
}) |
Ahh, I see. I used |
6899498
to
bb8c648
Compare
209af14
to
76ef3a6
Compare
a9451c9
to
d5bf49d
Compare
d5bf49d
to
27a4b31
Compare
27a4b31
to
cce9f4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this patch today on a project where it was running into the failed to create symbolic link
error and it fixed it successfully.
EDIT: Though I'm now running into an error like this:
error: failed to select a version for the requirement `cfg-if = "^1.0"` (locked to 1.0.0)
Not sure if this is related to the fetching or not
EDIT: forget about it. This seems to be an unrelated issue
If this is a public project, please share a link to it. |
@TomaSajt My issue seems to be unrelated. Please don't feel blocked by it |
cce9f4e
to
7c0a412
Compare
Packaging Kiesel seems to be blocked on this. Kiesel uses an in-tree Rust crate for some FFI, which depends partly on crates.io versions, partly on git versions to get the latest fixes. A lot of transitive deps are duplicated in turn, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple enough impl, impact is bearable.
next_registry_ind = 1 | ||
next_git_ind = 0 | ||
|
||
source_config = {} | ||
|
||
source_config["_vendored-source-registry-0"] = {} | ||
source_config["_vendored-source-registry-0"]["directory"] = "@vendor@/source-registry-0" | ||
source_config["crates-io"] = {} | ||
source_config["crates-io"]["replace-with"] = "_vendored-source-registry-0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Could maybe refactor this to instead store lists of registry
and git
sources, then constructing the source_config
afterwards. This would avoid bugs due to missing to increment the indices. Works fine as-is though.
7c0a412
to
e4d6c16
Compare
This is achieved by having subdirs in the vendor dir
This is needed because the previous commit moved crates one layer deeper in the vendor directory of rust packages when using fetchCargoVendor
e4d6c16
to
4094669
Compare
Pushed a change factoring out some stuff to slightly de-clutter the |
Since this is a breaking change (even if mostly internal), let's not merge before we decide on a final design.
Reviews are welcome.
Fixes #359340
Fixes #30742
Related:
This PR contains the simpler but arguably more important part of #282798.
The other PR tries to migrate both
importCargoLock
andfetchCargoVendor
, but this one only does thefetchCargoVendor
change.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.