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

Fix Rust example on macOS #215

Merged
merged 7 commits into from
Apr 13, 2022
Merged

Fix Rust example on macOS #215

merged 7 commits into from
Apr 13, 2022

Conversation

YorikSar
Copy link
Member

@YorikSar YorikSar commented Apr 8, 2022

This PR addresses current problems with Rust example on macOS, mainly by changing clang parameters in CC toolchain:

  • add path to libiconv
  • switch from libstdc++ from GCC that isn't available on macOS to libc++ from clang

Fixes #187

It's added by nixpkgs automagically starting with commit:
NixOS/nixpkgs@77550df
(included in nixpkgs releases starting with 19.03)
libstdc++ isn't available on Darwin, so it's safe to assume that libc++
is used there. I didn't find a way to detect which one of them is
actually used in stdenv so far.
It seems to be required only by Rust right now, but it might be because
we don't really test CC toolchain (see #209). Add it
for all Darwin targets for now to fix Rust case.
Following #209, add
--incompatible_enable_cc_toolchain_resolution flag to build action in
Rust example so that changes to CC toolchain take effect.
)
IS_CLANG=(
$(
${cc}/bin/cc -v 2>&1 | grep -q clang && echo True || echo False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to the static check for clang we tried last week?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed it separately in #216 because it essentially changes API.

Copy link
Member

@aherrmann aherrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

@aherrmann aherrmann added the merge-queue merge on green CI label Apr 13, 2022
@mergify mergify bot merged commit f942fb8 into master Apr 13, 2022
@mergify mergify bot deleted the yuriy.taraday/macos-rust-example branch April 13, 2022 07:31
@mergify mergify bot removed the merge-queue merge on green CI label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rust example fails to compile on macOS because of libiconv
3 participants