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

nightly 1.78 build error on macOS for several crates #122641

Closed
jianshu93 opened this issue Mar 17, 2024 · 41 comments
Closed

nightly 1.78 build error on macOS for several crates #122641

jianshu93 opened this issue Mar 17, 2024 · 41 comments
Labels
C-bug Category: This is a bug. O-macos Operating system: macOS S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress.

Comments

@jianshu93
Copy link

Hello Rust team,

Just found that on MacOS Rust v1.78, I cannot compile the following several crates:

error: failed to run custom build command for serde v1.0.193

Caused by:
process didn't exit successfully: /Users/jianshuzhao/gsearch/target/release/build/serde-fe63f8db4ee3a099/build-script-build (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for libm v0.2.8

Caused by:
process didn't exit successfully: /Users/jianshuzhao/gsearch/target/release/build/libm-911e8c3b2680f4bb/build-script-build (signal: 9, SIGKILL: kill)
error: failed to run custom build command for crossbeam-utils v0.8.17

Caused by:
process didn't exit successfully: /Users/jianshuzhao/gsearch/target/release/build/crossbeam-utils-afd4c2f70c7f24f1/build-script-build (signal: 9, SIGKILL: kill)
error: failed to run custom build command for libc v0.2.151

Caused by:
process didn't exit successfully: /Users/jianshuzhao/gsearch/target/release/build/libc-ec74996261bf3a48/build-script-build (signal: 9, SIGKILL: kill)

Any idea why?

I have no problems with v1.77.

Thanks,

Jianshu

@jianshu93 jianshu93 added the C-bug Category: This is a bug. label Mar 17, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 17, 2024
@n8henrie
Copy link
Contributor

Same here aarch64-darwin, was surprised to see no other issues a few minutes ago so assumed user error.

@n8henrie
Copy link
Contributor

$ git rev-parse HEAD
ecdea9e9438cdb8cf707e7f60e066eda02344d05
$ rm -rf ./build
$ ./x.py clean
downloading https://static.rust-lang.org/dist/2024-02-04/rust-std-beta-aarch64-apple-darwin.tar.xz
####################################################################################################################################################################################################################################### 100.0%
downloading https://static.rust-lang.org/dist/2024-02-04/rustc-beta-aarch64-apple-darwin.tar.xz
####################################################################################################################################################################################################################################### 100.0%
downloading https://static.rust-lang.org/dist/2024-02-04/cargo-beta-aarch64-apple-darwin.tar.xz
####################################################################################################################################################################################################################################### 100.0%
extracting /Users/n8henrie/git/rust/build/cache/2024-02-04/rust-std-beta-aarch64-apple-darwin.tar.xz
extracting /Users/n8henrie/git/rust/build/cache/2024-02-04/rustc-beta-aarch64-apple-darwin.tar.xz
extracting /Users/n8henrie/git/rust/build/cache/2024-02-04/cargo-beta-aarch64-apple-darwin.tar.xz
Building bootstrap
   Compiling libc v0.2.151
   Compiling proc-macro2 v1.0.76
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling typenum v1.17.0
   Compiling version_check v0.9.4
   Compiling memchr v2.7.1
   Compiling serde v1.0.195
   Compiling cc v1.0.73
   Compiling crossbeam-utils v0.8.18
   Compiling generic-array v0.14.7
   Compiling rustix v0.38.28
error: failed to run custom build command for `generic-array v0.14.7`

Caused by:
  process didn't exit successfully: `/Users/n8henrie/git/rust/build/bootstrap/debug/build/generic-array-ab25fa20b775d3bc/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `proc-macro2 v1.0.76`

Caused by:
  process didn't exit successfully: `/Users/n8henrie/git/rust/build/bootstrap/debug/build/proc-macro2-0d1d0caff9b8427e/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `libc v0.2.151`

Caused by:
  process didn't exit successfully: `/Users/n8henrie/git/rust/build/bootstrap/debug/build/libc-06bd4863f1ba3265/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `serde v1.0.195`

Caused by:
  process didn't exit successfully: `/Users/n8henrie/git/rust/build/bootstrap/debug/build/serde-9d5af29e6bacc352/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `typenum v1.17.0`

Caused by:
  process didn't exit successfully: `/Users/n8henrie/git/rust/build/bootstrap/debug/build/typenum-c6d5f315ae5f7f82/build-script-main` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `crossbeam-utils v0.8.18`

Caused by:
  process didn't exit successfully: `/Users/n8henrie/git/rust/build/bootstrap/debug/build/crossbeam-utils-5b726589c5220b36/build-script-build` (signal: 9, SIGKILL: kill)
failed to run: /Users/n8henrie/git/rust/build/aarch64-apple-darwin/stage0/bin/cargo build --manifest-path /Users/n8henrie/git/rust/src/bootstrap/Cargo.toml
Build completed unsuccessfully in 0:00:15

@jieyouxu jieyouxu added the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label Mar 17, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Mar 17, 2024

@jianshu93 please post your rustc version rustc -vV you tried to compile serde with. I cannot repro the failure locally with

rustc 1.78.0-nightly (766bdce74 2024-03-16)
binary: rustc
commit-hash: 766bdce744d531267d53ba2a3f9ffcda69fb9b17
commit-date: 2024-03-16
host: x86_64-apple-darwin
release: 1.78.0-nightly
LLVM version: 18.1.2
  • Are you also on aarch64-apple-darwin?
  • Are these build script errors from a clean build?
  • Can you still reproduce the SIGKILLs with cargo -j1 --release?

@jianshu93
Copy link
Author

yes I am aarch64 macos.

I will soon add other in formation.

Jianshu

@jianshu93
Copy link
Author

jianshu93 commented Mar 17, 2024

I build clean crate and have the same error and my rust version is:

rustc 1.78.0-nightly (766bdce74 2024-03-16)
binary: rustc
commit-hash: 766bdce744d531267d53ba2a3f9ffcda69fb9b17
commit-date: 2024-03-16
host: aarch64-apple-darwin
release: 1.78.0-nightly
LLVM version: 18.1.2

Apparently it 1.78 has not been tested on aarch64 macOS platforms?

Thanks,

Jianshu

@n8henrie
Copy link
Contributor

For me seems to bisect somewhere between:

bad d0873c7
good: a4fbd01

but bisect having some issues because x.py disappears at some point.

@n8henrie
Copy link
Contributor

Bisect points me to 9784a14

@lqd
Copy link
Member

lqd commented Mar 17, 2024

https://github.com/rust-lang/cargo-bisect-rustc should be helpful to find when things stopped working (without using x.py)

@jianshu93
Copy link
Author

Just so surprised that nightly version did not go through platform tests, this never happened before.

@n8henrie
Copy link
Contributor

In my case, I'm still suspicious that it could be something local to my system.

My rust toolchain is running via nix and I just switched to nixpkgs-unstable last week.

$ rustc -vV
rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: aarch64-apple-darwin
release: 1.76.0
LLVM version: 17.0.6

@saethlin
Copy link
Member

saethlin commented Mar 17, 2024

Just so surprised that nightly version did not go through platform tests, this never happened before.

Every commit that lands is automatically tested, including on aarch64-apple-darwin.

Our CI is automated with GitHub actions, you can even click through the UI to find the automated tests for aarch64-apple-darwin.

@jianshu93
Copy link
Author

Ok that's really strange. I can confirm that with MacOS sonama 14.4, many packages cannot be compiled for nightly 1.78 (see above info), everything is ok with 1.77. The error is just get killed, nothing else. Can somebody use real machine to confirm my situation.

Thanks,
Jianshu

@saethlin
Copy link
Member

I cloned https://github.com/jianshu93/gsearch and on commit dbaf7443dfe183e5b0e02e41725fc4a8ba13b897 with cargo +nightly build and cargo +nightly build --release on my M1, I see a successful build without any crashes.

Is there a different build command I need to use? Or is that the wrong project/commit?

@n8henrie
Copy link
Contributor

n8henrie commented Mar 18, 2024

For me nightly fails with that repo. Interesting.

$ pwd
/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/tmp.9rUGsVs9xI/gsearch
$ git rev-parse HEAD
dbaf7443dfe183e5b0e02e41725fc4a8ba13b897
$ cargo build --release
... succeeds ...
$ cargo +nightly build --release
   Compiling libc v0.2.153
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling libm v0.2.8
   Compiling serde v1.0.197
   Compiling memchr v2.7.1
   Compiling crossbeam-utils v0.8.19
   Compiling version_check v0.9.4
error: failed to run custom build command for `proc-macro2 v1.0.79`

Caused by:
  process didn't exit successfully: `/private/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/tmp.9rUGsVs9xI/gsearch/target/release/build/proc-macro2-f0456103fa86b569/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `crossbeam-utils v0.8.19`

Caused by:
  process didn't exit successfully: `/private/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/tmp.9rUGsVs9xI/gsearch/target/release/build/crossbeam-utils-88214525c82bd36b/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `serde v1.0.197`

Caused by:
  process didn't exit successfully: `/private/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/tmp.9rUGsVs9xI/gsearch/target/release/build/serde-4dae43f57b350d13/build-script-build` (signal: 9, SIGKILL: kill)

@n8henrie
Copy link
Contributor

It reminds me a lot of this issue which was related to my linker, but I've tried removing my ~/.cargo/config.toml, cargo clean, and the issue is identical.

@jianshu93
Copy link
Author

jianshu93 commented Mar 18, 2024

Thank for testing my repo gsearch. We rely heavily on crossbeams and rayon. @saethlin, yes I use the same one as you did. Yes I have the issue as @n8henrie did. I just did a new git clone and have the same error:

error: failed to run custom build command for proc-macro2 v1.0.79

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/gsearch/target/release/build/proc-macro2-a08fba1383bb57dd/build-script-build (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for libm v0.2.8

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/gsearch/target/release/build/libm-911e8c3b2680f4bb/build-script-build (signal: 9, SIGKILL: kill)
error: failed to run custom build command for crossbeam-utils v0.8.19

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/gsearch/target/release/build/crossbeam-utils-938b692cdc38e667/build-script-build (signal: 9, SIGKILL: kill)
error: failed to run custom build command for getrandom v0.1.16

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/gsearch/target/release/build/getrandom-be28b1127aa51272/build-script-build (signal: 9, SIGKILL: kill)
error: failed to run custom build command for num-traits v0.2.18

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/gsearch/target/release/build/num-traits-cbfc4a23c45f8bf0/build-script-build (signal: 9, SIGKILL: kill)
error: failed to run custom build command for libc v0.2.153

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/gsearch/target/release/build/libc-5f39d237986bd8db/build-script-build (signal: 9, SIGKILL: kill)
error: failed to run custom build command for serde v1.0.197

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/gsearch/target/release/build/serde-d3c4021249314971/build-script-build (signal: 9, SIGKILL: kill)

By the way there are no problems with v1.77.

Can anybody also test this repo of mine: https://github.com/jianshu93/kmerHLL

I have the following error: error: failed to run custom build command for getrandom v0.1.16

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/kmerHLL/target/release/build/getrandom-be28b1127aa51272/build-script-build (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for libm v0.2.8

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/kmerHLL/target/release/build/libm-911e8c3b2680f4bb/build-script-build (signal: 9, SIGKILL: kill).

Again no problems on linux. Just macOS Sonoma 14.4. An operation system issue?

Thanks,

Jianshu

@jianshu93
Copy link
Author

jianshu93 commented Mar 18, 2024

By the way, I use LLVM clang in my system, that is all my clang are actually the LLVM clang installed via hombrew, not the default clang from the operation system. But CC is still the system default. Just curious why it works for 1.77 but not for 1.78, I see that there are many major updates in 1.78, including remove the stdsimd feature et.al.

Jianshus-MBP-2:$ CC --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@saethlin
Copy link
Member

Can you build with cargo +nightly build --release -j1? It will be slow, but does it crash?

@saethlin saethlin added the O-macos Operating system: macOS label Mar 18, 2024
@jianshu93
Copy link
Author

I just updated to 1.79. but still:

Updating crates.io index
Compiling libc v0.2.153
error: failed to run custom build command for libc v0.2.153

Caused by:
process didn't exit successfully: /Users/jianshuzhao/Downloads/kmerHLL/target/release/build/libc-e8ed923c97fa488d/build-script-build (signal: 9, SIGKILL: kill)

Jianshu

@saethlin
Copy link
Member

This previous issue looks relevant: rust-lang/cargo#8913

Is your rustup/cargo/rustc x86_64?
Is your shell x86_64?
Are you using an x86_64 terminal emulator?

@jianshu93
Copy link
Author

jianshu93 commented Mar 18, 2024 via email

@n8henrie
Copy link
Contributor

n8henrie commented Mar 18, 2024

@saethlin -- with `-j1 (same repo, same commit)

$ cargo +nightly clean
     Removed 11 files, 973.8KiB total
$ cargo +nightly build --release -j1
   Compiling libc v0.2.153
error: failed to run custom build command for `libc v0.2.153`

Caused by:
  process didn't exit successfully: `/private/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/tmp.9rUGsVs9xI/gsearch/target/release/build/libc-16f682f2333933b5/build-script-build` (signal: 9, SIGKILL: kill)

@jianshu93
Copy link
Author

Hello All,

Anybody else in addition to @n8henrie can reproduce this error? Just so curious why it happens only in my case. Does it has something to do with some specific crate that is not compatible with 1.78?

Thanks,
Jianshu

@lqd
Copy link
Member

lqd commented Mar 19, 2024

Running https://github.com/rust-lang/cargo-bisect-rustc to locate the nightly and PR, between 1.77.0 and now, that changed behavior on your local machine would be interesting information to help understand the issue.

@n8henrie
Copy link
Contributor

@lqd I wish I could, I can't even get it installed.

Tried reinstalling my rust toolchain through homebrew to see if it was a nix issue, but I get the same error either way:

$ ~/.cargo/bin/cargo --version
cargo 1.76.0 (c84b36747 2024-01-18)
$ ~/.cargo/bin/cargo install cargo-bisect-rustc
    Updating crates.io index
  Installing cargo-bisect-rustc v0.6.8
    Updating crates.io index
   Compiling libc v0.2.153
   Compiling pkg-config v0.3.30
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.1.0
   Compiling rustix v0.38.31
   Compiling bitflags v2.5.0
   Compiling core-foundation-sys v0.8.6
   Compiling vcpkg v0.2.15
   Compiling memchr v2.7.1
   Compiling cfg-if v1.0.0
   Compiling pin-project-lite v0.2.13
   Compiling bytes v1.5.0
   Compiling itoa v1.0.10
   Compiling slab v0.4.9
error: failed to run custom build command for `proc-macro2 v1.0.79`

Caused by:
  process didn't exit successfully: `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installXAdDcI/release/build/proc-macro2-0b733c8a10f7d0e2/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `libc v0.2.153`

Caused by:
  process didn't exit successfully: `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installXAdDcI/release/build/libc-7d3c3772beff9ff0/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `libc v0.2.153`

Caused by:
  process didn't exit successfully: `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installXAdDcI/release/build/libc-42bd635428380c8e/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `rustix v0.38.31`

Caused by:
  process didn't exit successfully: `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installXAdDcI/release/build/rustix-3d5e68f8f5cda606/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to compile `cargo-bisect-rustc v0.6.8`, intermediate artifacts can be found at `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installXAdDcI`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@jianshu93
Copy link
Author

Hello @n8henrie,I believe it is the 1.78 release problem. I use simdeez to make use of SIMD features, I saw a lot of update in 1.78 in terms of SIMD features.

@lqd
Copy link
Member

lqd commented Mar 19, 2024

@n8henrie if this is indeed a regression, meaning that it used to work: you could maybe set your default rustup toolchain to an older version that worked e.g. 1.77.0, to allow for building the tool. Avoiding nix and homebrew if possible, just to rule them out. Same for @jianshu93.

It seems that we unfortunately can't easily reproduce the issue yet, so we'd need help from the both of you to make some progress here.

@n8henrie
Copy link
Contributor

n8henrie commented Mar 20, 2024

Tried a reboot, behavior persists.

(EDIT: Also tried reinstalling rust toolchain with the official curl | bash rustup as well as homebrew, both reproduce the same error.)

1.75 also not working, so this seems more likely than every to be a "me" issue -- but I'd sure appreciate any suggestions on where to look.

$ cargo +1.75 install cargo-bisect-rustc
    Updating crates.io index
  Installing cargo-bisect-rustc v0.6.8
    Updating crates.io index
   Compiling libc v0.2.153
   Compiling pkg-config v0.3.30
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling rustix v0.38.32
   Compiling autocfg v1.1.0
   Compiling bitflags v2.5.0
   Compiling core-foundation-sys v0.8.6
   Compiling vcpkg v0.2.15
   Compiling pin-project-lite v0.2.13
   Compiling memchr v2.7.1
error: failed to run custom build command for `proc-macro2 v1.0.79`

Caused by:
  process didn't exit successfully: `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installGkndeJ/release/build/proc-macro2-fad574d1dcdec54b/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `rustix v0.38.32`

Caused by:
  process didn't exit successfully: `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installGkndeJ/release/build/rustix-5abd496fe7012d7e/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to compile `cargo-bisect-rustc v0.6.8`, intermediate artifacts can be found at `/var/folders/kb/tw_lp_xd2_bbv0hqk4m0bvt80000gn/T/cargo-installGkndeJ`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Was able to build cargo-bisect-rustc with nix, not really sure what to do with it.

I discovered this issue when trying to work on my first PR to rust which was previously building fine -- occurred during ./x.py test tests/debuginfo.

Not having much luck with cargo-bisect-rust:

$ ./result/bin/cargo-bisect-rustc --start 2024-01-01 
checking the start range to find a passing nightly
installing nightly-2024-01-01
rust-std-nightly-aarch64-apple-darwin: 24.34 MB / 24.34 MB [=============================================================================================================================================================] 100.00 % 6.08 MB/s testing...
RESULT: nightly-2024-01-01, ===> Yes
uninstalling nightly-2024-01-01

ERROR: the start of the range (nightly-2024-01-01) must not reproduce the regression
$
$ ./result/bin/cargo-bisect-rustc --start 2024-01-01 --script './x.py test tests/debuginfo'
checking the start range to find a passing nightly
installing nightly-2024-01-01
rust-std-nightly-aarch64-apple-darwin: 24.34 MB / 24.34 MB [=============================================================================================================================================================] 100.00 % 1.95 MB/s testing...
thread 'main' panicked at src/toolchains.rs:311:17:
thiserror::Errored to run cd "." && CARGO_BUILD_TARGET="aarch64-apple-darwin" CARGO_TARGET_DIR="target-bisector-nightly-2024-01-01-aarch64-apple-darwin" RUSTUP_TOOLCHAIN="bisector-nightly-2024-01-01-aarch64-apple-darwin" "./x.py test tests/debuginfo": Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
n8henrie@NatePro:~/git/rust(master)$ ./result/bin/cargo-bisect-rustc --start 2024-01-01 --script ./x.py test tests/debuginfo
error: Found argument 'test' which wasn't expected, or isn't valid in this context

Usage: cargo bisect-rustc [OPTIONS] [-- <COMMAND_ARGS>...]

For more information try '--help'

Sorry, not trying to be dense here.

I wonder if this is a quirky MacOS issue similar to the 14.4 java issues that have been reported (I haven't yet updated):

$ sw_vers 
ProductName:		macOS
ProductVersion:		14.3.1
BuildVersion:		23D60

@n8henrie
Copy link
Contributor

Yes, in my case I think it is just MacOS wonkiness.

I rebooted a few more times with no additional changes to my configuration or setup (was actually making changes to my Asahi NixOS setup which I dual boot). After the most recent boot into MacOS I was greeted with multiple permissions dialogs about bash and Terminal.app and subsequently cargo seems to be working again. No idea why this didn't happen with previous reboots (which I did intentionally, considering this a possibility).

Sorry for the wild goose chase. I hope @jianshu93 finds a solution as well.

@jianshu93
Copy link
Author

Hello all, It turns out to be a system problem, I have no problem with 1.78 on my M2 MacBook Air. But only M1 Pro MacBook Pro. No idea why, I have exact the same setups. I will close this issue for now. I am going to reinstall my system to see what happens. Reopen if necessary.

@devjgm
Copy link

devjgm commented Mar 22, 2024

I see this issue too. It may be related to a bug I just filed with a minimal repro case: #122902

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 24, 2024
@lqd
Copy link
Member

lqd commented Mar 26, 2024

@jianshu93 @n8henrie it seems very likely to me that you’re both encountering an issue with homebrew’s strip, see #122902 (comment) and the following discussion there.

@n8henrie
Copy link
Contributor

n8henrie commented Mar 26, 2024

EDIT: Updated below

@lqd

it seems very likely to me that you’re both encountering an issue with homebrew’s strip

I remembered that issue, I don't think it was the cause in my case.

  • I have homebrew installed but am actively transitioning to nix instead
    • I don't have homebrew's strip anywhere on my path
    • /usr/bin/strip precedes nix's strip:
$ type -a strip
strip is /usr/bin/strip
strip is /etc/profiles/per-user/n8henrie/bin/strip
strip is /run/current-system/sw/bin/strip

Further, the issue seems to have resolved itself (without any changes to my PATH).

@jianshu93
Copy link
Author

Hello all, Thank you. I think it is the problem in my case. And it was solved. Why not hard coded strip for macos system so that no matter we install homebrew strip or not, it always works.

Thanks,
Jianshu

@n8henrie
Copy link
Contributor

@lqd

I stand corrected -- I think my issue was the strip issue as well, likely coming up because of:

I don't have homebrew strip, but I suspect it's the same issue with GNU strip from nixpkgs.

I found that the issue returned this afternoon in a new shell; for whatever reason, my PATH was reordered in this shell, with nix strip now ordered before the MacOS strip:

$ type -a strip
strip is /etc/profiles/per-user/n8henrie/bin/strip
strip is /run/current-system/sw/bin/strip
strip is /usr/bin/strip

Compiling like this succeeds:

$ PATH=$(getconf PATH):~/.cargo/bin cargo install cargo-espflash

I really wish there was a way to specify the full path to the strip binary to use, as I strongly prefer having GNU tools (grep, find, sed, etc.) before the MacOS tools on my PATH.

@canselcik
Copy link

EDIT: Updated below

@lqd

it seems very likely to me that you’re both encountering an issue with homebrew’s strip

I remembered that issue, I don't think it was the cause in my case.

  • I have homebrew installed but am actively transitioning to nix instead

    • I don't have homebrew's strip anywhere on my path
    • /usr/bin/strip precedes nix's strip:
$ type -a strip
strip is /usr/bin/strip
strip is /etc/profiles/per-user/n8henrie/bin/strip
strip is /run/current-system/sw/bin/strip

Further, the issue seems to have resolved itself (without any changes to my PATH).

Wow, this was the issue for me as well.

@kevin-valerio
Copy link

kevin-valerio commented Apr 10, 2024

EDIT: Updated below
@lqd

it seems very likely to me that you’re both encountering an issue with homebrew’s strip

I remembered that issue, I don't think it was the cause in my case.

  • I have homebrew installed but am actively transitioning to nix instead

    • I don't have homebrew's strip anywhere on my path
    • /usr/bin/strip precedes nix's strip:
$ type -a strip
strip is /usr/bin/strip
strip is /etc/profiles/per-user/n8henrie/bin/strip
strip is /run/current-system/sw/bin/strip

Further, the issue seems to have resolved itself (without any changes to my PATH).

Wow, this was the issue for me as well.

Same here. Very useful, thank you so much guys. For other folks coming in that issue for the future, here's the TLDR; I wished I would have found before:

You're using strip from /opt/homebrew/opt/binutils/bin/strip probably, and not from /usr/bin/strip. Simply modify your $PATH and cargo clean

set -gx PATH /usr/bin $PATH for fish users :)

@kivikakk
Copy link

kivikakk commented Apr 18, 2024

In my case, it wasn't homebrew's strip, but Nix's (i.e. as in the /etc/profiles/per-user/… seen above) — same issue, anyways. To get a single binary I wanted installed without falling afoul of this, this was sufficient (on Fish; add $s before the expansions for Bash/etc.):

PATH=(getconf PATH):(dirname (readlink -f (which cargo))) cargo install xyzzy

@liushooter
Copy link

rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: x86_64-apple-darwin
release: 1.78.0
LLVM version: 18.1.2

i have the same issue

@adamhott
Copy link

adamhott commented Jul 28, 2024

rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: aarch64-apple-darwin
release: 1.78.0
LLVM version: 18.1.2

I also have the same issue.

I downgraded to 1.75 and rebooted and it solved the isssue.

@shrirambalaji
Copy link

+1 on the issue with the conflicting strip command. turns out it was due to having a binutils installed using home-brew.

removing it fixed it for me.

brew uninstall binutils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-macos Operating system: macOS S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress.
Projects
None yet
Development

No branches or pull requests