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

Error with cargo zigbuild #1360

Open
phoepsilonix opened this issue Jan 11, 2025 · 0 comments
Open

Error with cargo zigbuild #1360

phoepsilonix opened this issue Jan 11, 2025 · 0 comments
Labels

Comments

@phoepsilonix
Copy link
Contributor

phoepsilonix commented Jan 11, 2025

Error with cargo zigbuild(cc-rs 1.2.8)

Example

  • Add mimalloc-rust to Hello World to satisfy the dependency with cc-rs.
  • Add the --target option to cargo zigbuild and compile.
RUSTFLAGS="" cargo zigbuild -r --message-format=json-render-diagnostics --target aarch64-unknown-linux-gnu
RUSTFLAGS="" cargo zigbuild -r --message-format=json-render-diagnostics --target x86_64-unknown-linux-gnu

The following error occurs.

  cargo:warning=error: Unknown Clang option: '--'

  --- stderr


  error occurred in cc-rs: Command LC_ALL="C" "/home/phoepsilonix/.cache/cargo-zigbuild/0.19.7/zigcc-x86_64-unknown-linux-gnu-7d27.sh" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "--target=x86_64-unknown-linux-gnu" "-I" "./mimalloc/include" "-I" "./mimalloc/src" "-DMI_BUILD_SHARED=0" "-DMI_DEBUG_FUL=0" "-DMI_DEBUG=0" "-o" "/home/phoepsilonix/work/myrust/target/x86_64-unknown-linux-gnu/release/build/mimalloc-rust-sys-752dde8e6a6b38c9/out/96c74dbd1b51cfc5-static.o" "-c" "--" "./mimalloc/src/static.c" with args zigcc-x86_64-unknown-linux-gnu-7d27.sh did not execute successfully (status code exit status: 1).

I tried to fix this by adjusting the zig_cc rule. #1361

phoepsilonix added a commit to phoepsilonix/cc-rs that referenced this issue Jan 11, 2025
Adjusted is_zig_cc judgment and adjusted how supports_path_delimiter is handled.
phoepsilonix added a commit to phoepsilonix/cc-rs that referenced this issue Jan 11, 2025
Adjusted is_zig_cc judgment and adjusted how supports_path_delimiter is handled.
phoepsilonix added a commit to phoepsilonix/cc-rs that referenced this issue Jan 11, 2025
adjusted how supports_path_delimiter is handled.
@madsmtm madsmtm added the bug label Jan 12, 2025
NobodyXu added a commit that referenced this issue Jan 12, 2025
* Adjusted zig cc judgment and avoided zigbuild errors(#1360)

Adjusted is_zig_cc judgment and adjusted how supports_path_delimiter is handled.

* Update src/lib.rs

Co-authored-by: Jiahao XU <[email protected]>

* typo fix and format check

cargo fmt --check

* Revert "Update src/lib.rs"

This reverts commit a69d8bb.

---------

Co-authored-by: Jiahao XU <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants