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

Remove darwinFlags in rust module #1356

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions examples/rust-wasm-cross/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,4 @@
] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
frameworks.Security
]);

# macOS workaround:
# The linker on macOS doesn't like the frameworks option when compiling to wasm32.
# See https://github.com/rust-lang/rust/issues/122333
env.RUSTFLAGS = lib.mkIf pkgs.stdenv.isDarwin (lib.mkForce "");
}
6 changes: 0 additions & 6 deletions examples/rust/.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ set -ex
cargo --version
rustc --version

if [[ "$(uname)" == "Darwin" ]]; then
echo "$RUSTFLAGS" | grep -- "-L framework=$DEVENV_PROFILE/Library/Frameworks"
echo "$RUSTDOCFLAGS" | grep -- "-L framework=$DEVENV_PROFILE/Library/Frameworks"
echo "$CFLAGS" | grep -- "-iframework $DEVENV_PROFILE/Library/Frameworks"
fi

[[ "$CARGO_INSTALL_ROOT" == "$DEVENV_STATE/cargo-install" ]]
echo "$PATH" | grep -- "$CARGO_INSTALL_ROOT/bin"

Expand Down
5 changes: 2 additions & 3 deletions src/modules/languages/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ in

env =
let
darwinFlags = lib.optionalString pkgs.stdenv.isDarwin "-L framework=${config.devenv.profile}/Library/Frameworks";
moldFlags = lib.optionalString cfg.mold.enable "-C link-arg=-fuse-ld=mold";
in
{
Expand All @@ -137,8 +136,8 @@ in
if cfg.toolchain ? rust-src
then "${cfg.toolchain.rust-src}/lib/rustlib/src/rust/library"
else pkgs.rustPlatform.rustLibSrc;
RUSTFLAGS = "${darwinFlags} ${moldFlags} ${cfg.rustflags}";
RUSTDOCFLAGS = "${darwinFlags} ${moldFlags}";
RUSTFLAGS = "${moldFlags} ${cfg.rustflags}";
RUSTDOCFLAGS = "${moldFlags}";
CFLAGS = lib.optionalString pkgs.stdenv.isDarwin "-iframework ${config.devenv.profile}/Library/Frameworks";
};

Expand Down
Loading