You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue Description cargo vendor downloads all dependencies including for Windows. For example, our vendor directory includes winapi crate and libraries required by ansi_term:
$ du -hs vendor/winapi*
7.6M vendor/winapi
52M vendor/winapi-i686-pc-windows-gnu
54M vendor/winapi-x86_64-pc-windows-gnu
SLAPD_HEADER_DIR=/home/vashirov/src/ds/rpmbuild/BUILD/389-ds-base-2.3.0.202210051402gitcf4c82c21/ \
cargo rustc --locked --offline --manifest-path=./src/librnsslapd/Cargo.toml \
--release --verbose -- -C debuginfo=2
Blocking waiting for file lock on package cache
error: the lock file /home/vashirov/src/ds/rpmbuild/BUILD/389-ds-base-2.3.0.202210051402gitcf4c82c21/src/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
make[1]: *** [Makefile:12983: /home/vashirov/src/ds/rpmbuild/BUILD/389-ds-base-2.3.0.202210051402gitcf4c82c21/rs/rnsslapd/release/librnsslapd.a] Error 101
make[1]: *** Waiting for unfinished jobs....
error: the lock file /home/vashirov/src/ds/rpmbuild/BUILD/389-ds-base-2.3.0.202210051402gitcf4c82c21/src/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
make[1]: *** [Makefile:12972: /home/vashirov/src/ds/rpmbuild/BUILD/389-ds-base-2.3.0.202210051402gitcf4c82c21/rs/rslapd/release/librslapd.a] Error 101
make[1]: Leaving directory '/home/vashirov/src/ds/rpmbuild/BUILD/389-ds-base-2.3.0.202210051402gitcf4c82c21'
error: Bad exit status from /var/tmp/rpm-tmp.MYjwuT (%build)
If I remove --locked from the build options, it builds fine. Or I can modify the Cargo.lock file to remove the dependencies that were filtered out. But next time someone runs cargo update or cargo vendor without cargo vendor-filterer, it will overwrite Cargo.lock file to again include those dependencies.
Another issue is missing support for --manifest-path: coreos/cargo-vendor-filterer#31
It's not critical and can be worked around.
So until cargo vendor supports filtering natively, we might run into issues like these.
Here's the diff if someone wants to play with this:
Issue Description
cargo vendor
downloads all dependencies including for Windows. For example, ourvendor
directory includeswinapi
crate and libraries required by ansi_term:cargo vendor
doesn't currently support filtering out platform-specific dependencies: rust-lang/cargo#7058But there is a
cargo-vendor-filterer
project:rust-lang/cargo#7058 (comment)
https://github.com/coreos/cargo-vendor-filterer
It should shave about 5MB from the size of the compressed released tarball:
vs.
The text was updated successfully, but these errors were encountered: