Skip to content

Setting strip = true in Cargo.toml makes build scripts fail in release mode on MacOS #110536

Closed
@fschutt

Description

@fschutt
git clone https://github.com/fschutt/azul --depth=1 --branch macbug
cd azul/azul-dll
cargo build --release

fails with:

$ cargo clean && cargo build --release
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.36
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.92
   Compiling libc v0.2.119
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling serde_derive v1.0.140
   Compiling serde v1.0.140
   Compiling bitflags v1.3.2
   Compiling crossbeam-utils v0.8.7
   Compiling adler v1.0.2
error: failed to run custom build command for `syn v1.0.92`

Caused by:
  process didn't exit successfully: `/Users/fs/Development/azul/target/release/build/syn-2cd6b288f9ab7997/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...

but when running it with cargo build, it works:

   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.36
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.92
   Compiling libc v0.2.119
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling serde_derive v1.0.140
   Compiling serde v1.0.140
   Compiling bitflags v1.3.2

[...]

    Finished dev [optimized + debuginfo] target(s) in 54.78s

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (c609da59d 2023-04-18)
binary: rustc
commit-hash: c609da59d9fc05b1c7dc879d79700ccd8140b5fc
commit-date: 2023-04-18
host: aarch64-apple-darwin
release: 1.71.0-nightly
LLVM version: 16.0.2

There was a time when cargo build --release worked, since I have old release builds of libazul.dylib from 22/08/22 (last August). It seems that upgrading my Mac has broken it (potentially an XCode upgrade). Currently I am on macOS 13.3.1 (22E261), I remember that it worked on Monterey (release date 24/10/22). It is very likely that it doesn't have anything to do with Rust / cargo itself, but it is weird that build scripts work in debug mode, but not in release mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-macosOperating system: macOSP-mediumMedium priorityregression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions