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

toolchains/cc: Fix process getting killed on aarch64-darwin during li… #479

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

avdv
Copy link
Member

@avdv avdv commented Feb 2, 2024

…nking

On aarch64 Darwin, when using a nixpkgs provided cc toolchain, we have seen the linking step to fail as the process got killed:

bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_haskell/haskell/ghc_wrapper: line 80: 90734 Killed: 9
               "${compile_flags[@]}" "${extra_args[@]}" 2>&1
     90736 Done                    | drop_loaded_and_warning 1>&2

More specifically this happened when trying to add an rpath to a dylib calling the install_name_tool, but running the same command manually succeeded.

This seems to be caused by mixing different tools from stdenv.cc and darwin.cctools, especially the fact that the tools from the latter overwrote tools from the former.

Only add missing tools not provided by the current cc toolchain from the darwin.cctools package instead.

…nking

On aarch64 Darwin, when using a nixpkgs provided cc toolchain, we have [seen][1]
the linking step to fail as the process got killed:

```
bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_haskell/haskell/ghc_wrapper: line 80: 90734 Killed: 9
               "${compile_flags[@]}" "${extra_args[@]}" 2>&1
     90736 Done                    | drop_loaded_and_warning 1>&2
```

More specifically this happened when trying to add an rpath to a dylib calling the `install_name_tool`, but
running the same command manually succeeded.

This seems to be caused by mixing different tools from stdenv.cc and darwin.cctools, especially the fact that
the tools from the latter overwrote tools from the former.

Only add missing tools not provided by the current cc toolchain from the darwin.cctools package instead.

[1]: tweag/rules_haskell#2101
@avdv avdv force-pushed the cb/fix-cc-toolchain-darwin-arm64 branch from 5d4ee94 to dba298e Compare February 2, 2024 08:47
@benradf benradf added the merge-queue merge on green CI label Feb 2, 2024
@mergify mergify bot merged commit 9b13ed0 into master Feb 2, 2024
15 checks passed
@mergify mergify bot deleted the cb/fix-cc-toolchain-darwin-arm64 branch February 2, 2024 11:41
@mergify mergify bot removed the merge-queue merge on green CI label Feb 2, 2024
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.

None yet

2 participants