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

Serde fails to build with debug = false profile inside workspace crate #2718

Open
solarretrace opened this issue Mar 23, 2024 · 0 comments
Open

Comments

@solarretrace
Copy link

solarretrace commented Mar 23, 2024

One of my older crates started to fail to compile when updating serde.

MacOS version 11.7.10
rustc 1.77.0 (aedd173a2 2024-03-17)

cargo build --release
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.1.0
   Compiling serde v1.0.197
error: failed to run custom build command for `proc-macro2 v1.0.79`

Caused by:
  process didn't exit successfully: `/test-rs/target/release/build/proc-macro2-4f7bdfadadf2577d/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `serde v1.0.197`

Caused by:
  process didn't exit successfully: `/test-rs/target/release/build/serde-dae687d13072669a/build-script-build` (signal: 9, SIGKILL: kill)

This only recreates when I build with debug = false in the build profile (--release mode,) AND if I'm building serde for a package within a workspace.

[workspace.dependencies]
serde = { version = "1.0", features = ["derive", "rc"] }

I occasionally get the following error instead, though I don't yet know what exactly causes the different error message. It seems to have something to do with setting debug = true in the release profile and debug = false in the dev profile.

 cargo check
    Checking serde v1.0.197
error: dlopen(/test-rs/target/debug/deps/libserde_derive-2d618114b1598331.dylib, 5): REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 1 which is not a writable segment (__TEXT) in /test-rs/target/debug/deps/libserde_derive-2d618114b1598331.dylib
   --> /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.197/src/lib.rs:325:1
    |
325 | extern crate serde_derive;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile `serde` (lib) due to 1 previous error

Workaround right now is to use debug = true always (though I'd rather have it off if I'm not using it.)

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

No branches or pull requests

1 participant