forked from bazel-contrib/toolchains_llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Symlink '/usr/bin/ld' to llvm toolchain directory on Mac (bazel-contr…
…ib#105) * Symlink '/usr/bin/ld' to llvm toolchain directory on Mac Mac systems still use the local `ld` executable since `lld.ld` is still experimental. Some applications, e.g. rustc when compiling rust, expect to find `ld` within the same directory as the compiler and so when compiling rust we run into an issue where the linker is not found. The first immediate solution is to use the rust rule's `extra_rustc_flags` to specify the linker explicitly (via `-Clinker=/usr/bin/ld`. This works for some crates but fails for crates using a build script, since the extra flags are not propagated to rustc invocations within the exec configuration. Another solution attempt was to link `ld` into the toolchain configuration repository instead of directly in the llvm repository, such that `ld` becomes a sibling file to `cc_wrapper.sh`. Unfortunately rustc was still unable to find the linker with this configuration. The final fully working solution is to link `ld` into the bin folder of the llvm repository. This should be fine as LLVM's own linker exists under `ld.lld` and symlinking the local linker will not clobber any files. * tests: add a `rules_rust` test I picked `git2-rs` since it links against a C library and has tests but isn't _massive_. There are a couple of hacks/patches here to workaround some bugs in `rules_rust`'s `crate-universe` but on the whole it's not too messy. * Add --incompatible_no_rule_outputs_param=false to run_external_tests.sh The rules_rust repository is incompatible with this flag enabled. Have disabled it for now. * Add --incompatible_no_rule_outputs_param=false to run_tests.sh Flag already added to 'run_external_tests.sh' but also needed here. * Move 'git2-rs-cargo-toml.patch' to 'tests/rust' * tests: move some shared test args for bazel into `bazel.sh` Note that this also drops the check for `$TEST_MIGRATION` in run_external_tests.sh; we don't run that script in migration.yml * tests: add a note about using `git2-rs` instead of the `@rules_rust` tests Co-authored-by: Rahul Butani <[email protected]>
- Loading branch information
Showing
7 changed files
with
136 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/Cargo.toml b/Cargo.toml | ||
index 5837a47..d6ba77f 100644 | ||
--- a/Cargo.toml | ||
+++ b/Cargo.toml | ||
@@ -60,10 +60,3 @@ unstable = [] | ||
vendored-libgit2 = ["libgit2-sys/vendored"] | ||
vendored-openssl = ["openssl-sys/vendored", "libgit2-sys/vendored-openssl"] | ||
zlib-ng-compat = ["libgit2-sys/zlib-ng-compat"] | ||
-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-probe] | ||
-version = "0.1" | ||
-optional = true | ||
- | ||
-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-sys] | ||
-version = "0.9.0" | ||
-optional = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters