diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java index 081f7de0e28eec..589ac39781ac83 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java @@ -852,7 +852,7 @@ public CppLinkAction build() throws EvalException, InterruptedException { output.getExecPathString(), SolibSymlinkAction.getDynamicLibrarySoname( output.getRootRelativePath(), - /* preserveName= */ false, + /* preserveName= */ linkType != LinkTargetType.NODEPS_DYNAMIC_LIBRARY, linkActionConstruction.getContext().getConfiguration().getMnemonic()), thinltoParamFile != null ? thinltoParamFile.getExecPathString() : null, toolchain, diff --git a/src/test/shell/bazel/BUILD b/src/test/shell/bazel/BUILD index fa60df0dd53ebf..b68a25a7caa3d7 100644 --- a/src/test/shell/bazel/BUILD +++ b/src/test/shell/bazel/BUILD @@ -128,6 +128,7 @@ sh_test( ], tags = [ "no_windows", # darwin-specific test + "requires-network", # For Bzlmod ], ) diff --git a/src/test/shell/bazel/cpp_darwin_integration_test.sh b/src/test/shell/bazel/cpp_darwin_integration_test.sh index b1155e3778e1e3..9f648b24039ab6 100755 --- a/src/test/shell/bazel/cpp_darwin_integration_test.sh +++ b/src/test/shell/bazel/cpp_darwin_integration_test.sh @@ -139,6 +139,8 @@ EOF return 0 } +# TODO: This test passes vacuously as the default Unix toolchain doesn't use +# the set_install_name feature yet. function test_cc_test_with_explicit_install_name() { mkdir -p cpp cat > cpp/BUILD < cpp/foo.h < cpp/foo.cc < cpp/test.cc < MODULE.bazel < cpp/BUILD < cpp/foo.h <