Skip to content

error: could not compile jiff (lib) #140657

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

Closed
jeremiah opened this issue May 5, 2025 · 9 comments
Closed

error: could not compile jiff (lib) #140657

jeremiah opened this issue May 5, 2025 · 9 comments
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues.

Comments

@jeremiah
Copy link

jeremiah commented May 5, 2025

I tried this code:

cargo install --locked --bin jj jj-cli

I expected to see a successful build of the above packages, e.g. jj and jj-cli

Instead, this happened: error: could not compile jiff (lib)

Caused by:
  process didn't exit successfully: `/home/jeremiah/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin/rustc --crate-name jiff --edition=2021 /home/jeremiah/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jiff-0.2.12/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=239 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="perf-inline"' --cfg 'feature="std"' --cfg 'feature="tz-fat"' --cfg 'feature="tz-system"' --cfg 'feature="tzdb-bundle-platform"' --cfg 'feature="tzdb-concatenated"' --cfg 'feature="tzdb-zoneinfo"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "default", "js", "logging", "perf-inline", "serde", "static", "static-tz", "std", "tz-fat", "tz-system", "tzdb-bundle-always", "tzdb-bundle-platform", "tzdb-concatenated", "tzdb-zoneinfo"))' -C metadata=4b8dd46ad729801c -C extra-filename=-519bdfa79342a211 --out-dir /tmp/cargo-installCZy1HM/release/deps -C strip=debuginfo -L dependency=/tmp/cargo-installCZy1HM/release/deps --cap-lints allow` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `jj-cli v0.28.2`, intermediate artifacts can be found at `/tmp/cargo-installCZy1HM`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Meta

rustc --version --verbose:

rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: aarch64-unknown-linux-gnu
release: 1.86.0
LLVM version: 19.1.7
Backtrace

Not available

@jeremiah jeremiah added the C-bug Category: This is a bug. label May 5, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 5, 2025
@jieyouxu jieyouxu added the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label May 5, 2025
@jieyouxu
Copy link
Member

jieyouxu commented May 5, 2025

Can't repro this 🤔

   Compiling jj-lib v0.28.2
    Finished `release` profile [optimized] target(s) in 1m 16s
  Installing /home/gh-jieyouxu/.cargo/bin/jj
   Installed package `jj-cli v0.28.2` (executable `jj`)

Does it still SIGILL SIGKILL if you try again?

@jeremiah
Copy link
Author

jeremiah commented May 5, 2025

Thanks @jieyouxu

Unfortunately an attempted rebuild fails;

   Compiling jj-lib v0.28.2
   Compiling sapling-streampager v0.11.0
error: could not compile `jj-lib` (lib)

Caused by:
  process didn't exit successfully: `/home/jeremiah/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin/rustc --crate-name jj_lib --edition=2021 /home/jeremiah/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jj-lib-0.28.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=239 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no '--warn=clippy::useless_conversion' '--warn=clippy::unused_trait_names' '--warn=clippy::uninlined_format_args' '--warn=clippy::semicolon_if_nothing_returned' '--warn=clippy::needless_for_each' '--warn=clippy::implicit_clone' '--warn=clippy::flat_map_option' '--warn=clippy::explicit_iter_loop' --cfg 'feature="git"' --cfg 'feature="git2"' --cfg 'feature="watchman"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "git", "git2", "gix-max-performance", "testing", "vendored-openssl", "watchman"))' -C metadata=140acf1fd217f915 -C extra-filename=-4d2f3568e1075331 --out-dir /tmp/cargo-installjBc6M7/release/deps -C strip=debuginfo -L dependency=/tmp/cargo-installjBc6M7/release/deps --extern async_trait=/tmp/cargo-installjBc6M7/release/deps/libasync_trait-2fe35f2710c07755.so --extern blake2=/tmp/cargo-installjBc6M7/release/deps/libblake2-9da976ba949b4ea2.rmeta --extern bstr=/tmp/cargo-installjBc6M7/release/deps/libbstr-ff747ed570d76215.rmeta --extern chrono=/tmp/cargo-installjBc6M7/release/deps/libchrono-75b3b37340704fa3.rmeta --extern clru=/tmp/cargo-installjBc6M7/release/deps/libclru-2669540f515843fa.rmeta --extern digest=/tmp/cargo-installjBc6M7/release/deps/libdigest-d8d612eaa1e91c75.rmeta --extern dunce=/tmp/cargo-installjBc6M7/release/deps/libdunce-e65b6836ddc0205e.rmeta --extern either=/tmp/cargo-installjBc6M7/release/deps/libeither-f932d5548bfb1d0c.rmeta --extern futures=/tmp/cargo-installjBc6M7/release/deps/libfutures-0ba0147ca8e74151.rmeta --extern git2=/tmp/cargo-installjBc6M7/release/deps/libgit2-a11ff16b937cd858.rmeta --extern gix=/tmp/cargo-installjBc6M7/release/deps/libgix-4a68e3f6aec3c6b1.rmeta --extern glob=/tmp/cargo-installjBc6M7/release/deps/libglob-2b1d85fe4adcf40e.rmeta --extern hashbrown=/tmp/cargo-installjBc6M7/release/deps/libhashbrown-b1298dd328f70128.rmeta --extern hex=/tmp/cargo-installjBc6M7/release/deps/libhex-c7f7f9a70888a26f.rmeta --extern ignore=/tmp/cargo-installjBc6M7/release/deps/libignore-99e229e68d090fe9.rmeta --extern indexmap=/tmp/cargo-installjBc6M7/release/deps/libindexmap-239d1407c4c92e03.rmeta --extern interim=/tmp/cargo-installjBc6M7/release/deps/libinterim-304802dc1f5b431d.rmeta --extern itertools=/tmp/cargo-installjBc6M7/release/deps/libitertools-06702afd0ae6aca5.rmeta --extern jj_lib_proc_macros=/tmp/cargo-installjBc6M7/release/deps/libjj_lib_proc_macros-0a10ba6d78e0aa92.so --extern maplit=/tmp/cargo-installjBc6M7/release/deps/libmaplit-b63695938c4befb8.rmeta --extern once_cell=/tmp/cargo-installjBc6M7/release/deps/libonce_cell-21d61199f505386a.rmeta --extern pest=/tmp/cargo-installjBc6M7/release/deps/libpest-1687998965d6df8a.rmeta --extern pest_derive=/tmp/cargo-installjBc6M7/release/deps/libpest_derive-5d1d3ba75d4e69e7.so --extern pollster=/tmp/cargo-installjBc6M7/release/deps/libpollster-fd2fcc9f8ff521a2.rmeta --extern prost=/tmp/cargo-installjBc6M7/release/deps/libprost-09c4b07c12fddf5c.rmeta --extern rand=/tmp/cargo-installjBc6M7/release/deps/librand-d99b0c3a51e9e500.rmeta --extern rand_chacha=/tmp/cargo-installjBc6M7/release/deps/librand_chacha-60f59ca1508a25af.rmeta --extern rayon=/tmp/cargo-installjBc6M7/release/deps/librayon-2ec0987fc59a2fd2.rmeta --extern ref_cast=/tmp/cargo-installjBc6M7/release/deps/libref_cast-d4d152dc4efb6c5d.rmeta --extern regex=/tmp/cargo-installjBc6M7/release/deps/libregex-9f262de3962dbfbd.rmeta --extern rustix=/tmp/cargo-installjBc6M7/release/deps/librustix-376f18901cc3362b.rmeta --extern same_file=/tmp/cargo-installjBc6M7/release/deps/libsame_file-b583d43bb79b3a3f.rmeta --extern serde=/tmp/cargo-installjBc6M7/release/deps/libserde-320a096150c066a2.rmeta --extern serde_json=/tmp/cargo-installjBc6M7/release/deps/libserde_json-8899c31d0f764a48.rmeta --extern smallvec=/tmp/cargo-installjBc6M7/release/deps/libsmallvec-a9c8ee79b380a82c.rmeta --extern strsim=/tmp/cargo-installjBc6M7/release/deps/libstrsim-a59cd0451abc3c76.rmeta --extern tempfile=/tmp/cargo-installjBc6M7/release/deps/libtempfile-2ee92cc1924b59e3.rmeta --extern thiserror=/tmp/cargo-installjBc6M7/release/deps/libthiserror-103d408ad76f5da6.rmeta --extern tokio=/tmp/cargo-installjBc6M7/release/deps/libtokio-a79ad520f9837cc3.rmeta --extern toml_edit=/tmp/cargo-installjBc6M7/release/deps/libtoml_edit-4cfff87c956100fa.rmeta --extern tracing=/tmp/cargo-installjBc6M7/release/deps/libtracing-82ea08899fa003df.rmeta --extern watchman_client=/tmp/cargo-installjBc6M7/release/deps/libwatchman_client-fd121d0cc972e831.rmeta --cap-lints allow -L native=/tmp/cargo-installjBc6M7/release/build/libgit2-sys-9a0d2b2b271064e6/out/build -L native=/tmp/cargo-installjBc6M7/release/build/libssh2-sys-449a22898bb564b4/out/build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `jj-cli v0.28.2`, intermediate artifacts can be found at `/tmp/cargo-installjBc6M7`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@saethlin
Copy link
Member

saethlin commented May 5, 2025

This is a SIGKILL which often but but always indicates OOM.

@jeremiah
Copy link
Author

jeremiah commented May 5, 2025

This is a SIGKILL which often but but always indicates OOM.

I'm in a container so I will see if I can add memory.

@saethlin
Copy link
Member

saethlin commented May 5, 2025

You could also try building with -j1 which will be slower but may lower peak memory.

@jeremiah
Copy link
Author

jeremiah commented May 5, 2025

This time I ran out of memory on /tmp;

error: failed to build archive at `/tmp/cargo-installiKHZo5/release/deps/libicu_locid_transform-f0e553e83f1a6431.rlib`: No space left on device (os error 28)

error: could not compile `icu_locid_transform` (lib) due to 1 previous error
error: failed to compile `jj-cli v0.28.2`, intermediate artifacts can be found at `/tmp/cargo-installiKHZo5`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
$ df -h 
Filesystem                 Size  Used Avail Use% Mounted on
default/containers/Trixie   47G   11G   36G  24% /
none                       492K  4.0K  488K   1% /dev
devtmpfs                   959M     0  959M   0% /dev/zfs
efivarfs                   256K   17K  240K   7% /sys/firmware/efi/efivars
tmpfs                      100K     0  100K   0% /dev/incus
tmpfs                      100K     0  100K   0% /dev/.incus-mounts
tmpfs                      980M  1.1M  979M   1% /dev/shm
tmpfs                      392M  168K  392M   1% /run
tmpfs                      980M  979M  1.3M 100% /tmp
tmpfs                      5.0M     0  5.0M   0% /run/lock
tmpfs                      196M   16K  196M   1% /run/user/1000

I've cleaned out /tmp a fair amount, but if that fails, should I build it somewhere else on disk with a command line flag?

@jeremiah
Copy link
Author

jeremiah commented May 5, 2025

This time I didn't run out of disk and free -h says 1.1G of available memory.

   Compiling jj-lib v0.28.2
error: could not compile `jj-lib` (lib)

Caused by:
  process didn't exit successfully: `/home/jeremiah/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin/rustc --crate-name jj_lib --edition=2021 /home/jeremiah/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jj-lib-0.28.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=239 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no '--warn=clippy::useless_conversion' '--warn=clippy::unused_trait_names' '--warn=clippy::uninlined_format_args' '--warn=clippy::semicolon_if_nothing_returned' '--warn=clippy::needless_for_each' '--warn=clippy::implicit_clone' '--warn=clippy::flat_map_option' '--warn=clippy::explicit_iter_loop' --cfg 'feature="git"' --cfg 'feature="git2"' --cfg 'feature="watchman"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "git", "git2", "gix-max-performance", "testing", "vendored-openssl", "watchman"))' -C metadata=140acf1fd217f915 -C extra-filename=-4d2f3568e1075331 --out-dir /tmp/cargo-installlwd1fM/release/deps -C strip=debuginfo -L dependency=/tmp/cargo-installlwd1fM/release/deps --extern async_trait=/tmp/cargo-installlwd1fM/release/deps/libasync_trait-2fe35f2710c07755.so --extern blake2=/tmp/cargo-installlwd1fM/release/deps/libblake2-9da976ba949b4ea2.rmeta --extern bstr=/tmp/cargo-installlwd1fM/release/deps/libbstr-ff747ed570d76215.rmeta --extern chrono=/tmp/cargo-installlwd1fM/release/deps/libchrono-75b3b37340704fa3.rmeta --extern clru=/tmp/cargo-installlwd1fM/release/deps/libclru-2669540f515843fa.rmeta --extern digest=/tmp/cargo-installlwd1fM/release/deps/libdigest-d8d612eaa1e91c75.rmeta --extern dunce=/tmp/cargo-installlwd1fM/release/deps/libdunce-e65b6836ddc0205e.rmeta --extern either=/tmp/cargo-installlwd1fM/release/deps/libeither-f932d5548bfb1d0c.rmeta --extern futures=/tmp/cargo-installlwd1fM/release/deps/libfutures-0ba0147ca8e74151.rmeta --extern git2=/tmp/cargo-installlwd1fM/release/deps/libgit2-a11ff16b937cd858.rmeta --extern gix=/tmp/cargo-installlwd1fM/release/deps/libgix-4a68e3f6aec3c6b1.rmeta --extern glob=/tmp/cargo-installlwd1fM/release/deps/libglob-2b1d85fe4adcf40e.rmeta --extern hashbrown=/tmp/cargo-installlwd1fM/release/deps/libhashbrown-b1298dd328f70128.rmeta --extern hex=/tmp/cargo-installlwd1fM/release/deps/libhex-c7f7f9a70888a26f.rmeta --extern ignore=/tmp/cargo-installlwd1fM/release/deps/libignore-99e229e68d090fe9.rmeta --extern indexmap=/tmp/cargo-installlwd1fM/release/deps/libindexmap-239d1407c4c92e03.rmeta --extern interim=/tmp/cargo-installlwd1fM/release/deps/libinterim-304802dc1f5b431d.rmeta --extern itertools=/tmp/cargo-installlwd1fM/release/deps/libitertools-06702afd0ae6aca5.rmeta --extern jj_lib_proc_macros=/tmp/cargo-installlwd1fM/release/deps/libjj_lib_proc_macros-0a10ba6d78e0aa92.so --extern maplit=/tmp/cargo-installlwd1fM/release/deps/libmaplit-b63695938c4befb8.rmeta --extern once_cell=/tmp/cargo-installlwd1fM/release/deps/libonce_cell-21d61199f505386a.rmeta --extern pest=/tmp/cargo-installlwd1fM/release/deps/libpest-1687998965d6df8a.rmeta --extern pest_derive=/tmp/cargo-installlwd1fM/release/deps/libpest_derive-5d1d3ba75d4e69e7.so --extern pollster=/tmp/cargo-installlwd1fM/release/deps/libpollster-fd2fcc9f8ff521a2.rmeta --extern prost=/tmp/cargo-installlwd1fM/release/deps/libprost-09c4b07c12fddf5c.rmeta --extern rand=/tmp/cargo-installlwd1fM/release/deps/librand-d99b0c3a51e9e500.rmeta --extern rand_chacha=/tmp/cargo-installlwd1fM/release/deps/librand_chacha-60f59ca1508a25af.rmeta --extern rayon=/tmp/cargo-installlwd1fM/release/deps/librayon-2ec0987fc59a2fd2.rmeta --extern ref_cast=/tmp/cargo-installlwd1fM/release/deps/libref_cast-d4d152dc4efb6c5d.rmeta --extern regex=/tmp/cargo-installlwd1fM/release/deps/libregex-9f262de3962dbfbd.rmeta --extern rustix=/tmp/cargo-installlwd1fM/release/deps/librustix-376f18901cc3362b.rmeta --extern same_file=/tmp/cargo-installlwd1fM/release/deps/libsame_file-b583d43bb79b3a3f.rmeta --extern serde=/tmp/cargo-installlwd1fM/release/deps/libserde-320a096150c066a2.rmeta --extern serde_json=/tmp/cargo-installlwd1fM/release/deps/libserde_json-8899c31d0f764a48.rmeta --extern smallvec=/tmp/cargo-installlwd1fM/release/deps/libsmallvec-a9c8ee79b380a82c.rmeta --extern strsim=/tmp/cargo-installlwd1fM/release/deps/libstrsim-a59cd0451abc3c76.rmeta --extern tempfile=/tmp/cargo-installlwd1fM/release/deps/libtempfile-2ee92cc1924b59e3.rmeta --extern thiserror=/tmp/cargo-installlwd1fM/release/deps/libthiserror-103d408ad76f5da6.rmeta --extern tokio=/tmp/cargo-installlwd1fM/release/deps/libtokio-a79ad520f9837cc3.rmeta --extern toml_edit=/tmp/cargo-installlwd1fM/release/deps/libtoml_edit-4cfff87c956100fa.rmeta --extern tracing=/tmp/cargo-installlwd1fM/release/deps/libtracing-82ea08899fa003df.rmeta --extern watchman_client=/tmp/cargo-installlwd1fM/release/deps/libwatchman_client-fd121d0cc972e831.rmeta --cap-lints allow -L native=/tmp/cargo-installlwd1fM/release/build/libgit2-sys-9a0d2b2b271064e6/out/build -L native=/tmp/cargo-installlwd1fM/release/build/libssh2-sys-449a22898bb564b4/out/build` (signal: 9, SIGKILL: kill)
error: failed to compile `jj-cli v0.28.2`, intermediate artifacts can be found at `/tmp/cargo-installlwd1fM`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@saethlin saethlin added C-discussion Category: Discussion or questions that doesn't represent real issues. and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. labels May 5, 2025
@saethlin
Copy link
Member

saethlin commented May 5, 2025

It's quite possible you need more than 1.1 GB of memory to do a release build of jj-lib. Trying to run cargo install in a resource-constrained environment is just not going to go well. That's one of the reasons Jujutsu suggests you download a pre-built binary.

You can keep commenting here; but I don't see any reason that you'll get answers other than "give the compiler more resources".

@saethlin saethlin closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2025
@jeremiah
Copy link
Author

jeremiah commented May 6, 2025

Okay, that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues.
Projects
None yet
Development

No branches or pull requests

4 participants