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
When working with a project with workspaces, and I compile it in release mode (cargo build --release), it will recompile all the crates when I install a binary (cargo install --root ... --path ...)
I would expect that the libraries already compiled in release mode, are not recompiled when installing.
This is happening in nightly but also in stable 1.39.
Steps
> cargo --version
cargo 1.41.0-nightly (626f0f40e 2019-12-03)
> rustc --version
rustc 1.41.0-nightly (59947fcae 2019-12-08)
> cat Cargo.toml
[workspace]
members = [
"kanidm_proto",
"kanidmd",
"kanidm_client",
"kanidm_tools",
]
> cargo build --workspace --release
Compiling libc v0.2.65
...
Compiling kanidm_client v0.1.0 (...kanidm/kanidm_client)
Compiling kanidm v0.1.0 (...kanidm/kanidmd)
Compiling kanidm_tools v0.1.0 (...kanidm/kanidm_tools)
Finished release [optimized] target(s) in 3m 40s
ls -la target/release/
total 61632
drwxr-xr-x 7 xx xx 4096 Dec 9 15:51 .
drwxr-xr-x 3 xx xx 4096 Dec 9 15:51 ..
drwxr-xr-x 94 xx xx 4096 Dec 9 15:47 build
-rw-r--r-- 1 xx xx 0 Dec 9 15:47 .cargo-lock
drwxr-xr-x 2 xx xx 57344 Dec 9 15:51 deps
drwxr-xr-x 2 xx xx 4096 Dec 9 15:47 examples
drwxr-xr-x 326 xx xx 20480 Dec 9 15:47 .fingerprint
drwxr-xr-x 2 xx xx 4096 Dec 9 15:47 incremental
-rwxr-xr-x 2 xx xx 9563608 Dec 9 15:50 kanidm
-rw-r--r-- 1 xx xx 270 Dec 9 15:51 kanidm.d
-rwxr-xr-x 2 xx xx 14258824 Dec 9 15:51 kanidmd
-rw-r--r-- 1 xx xx 3026 Dec 9 15:51 kanidmd.d
...
> ls -ld target/release/build/libc*
drwxr-xr-x 3 xx xx 4096 Dec 9 15:47 target/release/build/libc-4f0e06f887637e12
drwxr-xr-x 2 xx xx 4096 Dec 9 15:47 target/release/build/libc-a0bc39419ec38101
> cargo install --root tmp --path kanidmd
Installing kanidm v0.1.0 (...kanidm/kanidmd)
Updating crates.io index
Compiling libc v0.2.66
...
Compiling kanidm v0.1.0 (...kanidm/kanidmd)
Finished release [optimized] target(s) in 2m 23s
Installing tmp/bin/kanidmd
Installed package `kanidm v0.1.0 (...kanidm/kanidmd)` (executable `kanidmd`)
> ls -ld target/release/build/libc*
drwxr-xr-x 3 xx xx 4096 Dec 9 15:53 target/release/build/libc-09252e2d78456def
drwxr-xr-x 3 xx xx 4096 Dec 9 15:47 target/release/build/libc-4f0e06f887637e12
drwxr-xr-x 2 xx xx 4096 Dec 9 15:47 target/release/build/libc-a0bc39419ec38101
drwxr-xr-x 2 xx xx 4096 Dec 9 15:53 target/release/build/libc-b5a8abe7c40a1557
The text was updated successfully, but these errors were encountered:
I suspect this is because Cargo is choosing different features for dependencies. When built in the root of a virtual workspace, the features will get unified across the workspace. But when you build (or install) a member in isolation, it only uses the features needed by that member. Can you verify that it is choosing different features?
If that's the case, you can make sure each member declares the same features (even for transitive dependencies). In rustc, we use an empty crate to ensure everything uses the same feature set.
(There are a variety of open issues on this topic, such as #5210 and #4463.)
Problem
When working with a project with workspaces, and I compile it in release mode (
cargo build --release
), it will recompile all the crates when I install a binary (cargo install --root ... --path ...
)I would expect that the libraries already compiled in release mode, are not recompiled when installing.
This is happening in nightly but also in stable 1.39.
Steps
The text was updated successfully, but these errors were encountered: