Skip to content

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

Closed

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.

Activity

  1. fschutt commented on Apr 19, 2023

    @fschutt
    ContributorAuthor

    I "solved" this by changing strip = false in the [profile.release] section. Seems to be that some symbols are being stripped prematurely!

  2. changed the title [-]cargo build --release fails to run build scripts on M1 Macs, but cargo build (debug) works[/-] [+]Setting strip = true in Cargo.toml makes build scripts fail in release mode on MacOS[/+] on Apr 19, 2023
  3. added
    O-macosOperating system: macOS
    I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
    regression-untriagedUntriaged performance or correctness regression.
    on Apr 20, 2023
  4. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Apr 20, 2023
  5. added
    A-linkageArea: linking into static, shared libraries and binaries
    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
    on Apr 20, 2023
  6. apiraino commented on Apr 20, 2023

    @apiraino
    Contributor

    @fschutt can you report if this happens also on the stable or a beta rustc channel? Can you also report when it did stop working for you? Ideally we'd want to bisect this to the Rust release where it actually stopped working. Thanks!

  7. apiraino commented on Apr 20, 2023

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion). Also needs to be bisected

    @rustbot label -I-prioritize +P-high +E-needs-bisect

  8. added
    P-highHigh priority
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    on Apr 20, 2023
  9. added and removed
    P-highHigh priority
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on May 17, 2023
  10. n8henrie commented on Mar 27, 2024

    @n8henrie
    Contributor

    Are you perhaps running into #122902 (comment) ?

  11. added a commit that references this issue on Sep 25, 2024
  12. added a commit that references this issue on Sep 25, 2024
  13. madsmtm commented on Oct 10, 2024

    @madsmtm
    Member

    Fixed by #130781.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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