From db43d5dbb643343cf8b42709f5e0a34b89ebcdc2 Mon Sep 17 00:00:00 2001 From: Chris Clearwater Date: Thu, 14 Apr 2022 21:22:45 +0000 Subject: [PATCH 1/2] Revert "Fixes incorrect install names on darwin platforms" This reverts commit b06f49507e02384cb4ff1ff862da2a673e9a081f. --- .../lib/rules/cpp/CppLinkActionBuilder.java | 3 +- .../bazel/cpp_darwin_integration_test.sh | 50 ++++++------------- 2 files changed, 18 insertions(+), 35 deletions(-) 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 f4c391fde97a2f..7711774eb00a2d 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 @@ -820,7 +820,8 @@ public CppLinkAction build() throws InterruptedException, RuleErrorException { getLinkType().linkerOrArchiver().equals(LinkerOrArchiver.LINKER), configuration.getBinDirectory(repositoryName).getExecPath(), output.getExecPathString(), - output.getRootRelativePath().getBaseName(), + SolibSymlinkAction.getDynamicLibrarySoname( + output.getRootRelativePath(), /* preserveName= */ false), linkType.equals(LinkTargetType.DYNAMIC_LIBRARY), paramFile != null ? paramFile.getExecPathString() : null, thinltoParamFile != null ? thinltoParamFile.getExecPathString() : null, diff --git a/src/test/shell/bazel/cpp_darwin_integration_test.sh b/src/test/shell/bazel/cpp_darwin_integration_test.sh index 4676e6c8f38c2a..e26d2a902e93fd 100755 --- a/src/test/shell/bazel/cpp_darwin_integration_test.sh +++ b/src/test/shell/bazel/cpp_darwin_integration_test.sh @@ -124,59 +124,41 @@ EOF } function test_cc_test_with_explicit_install_name() { - mkdir -p cpp/install_name - cat > cpp/install_name/BUILD < cpp/BUILD < cpp/install_name/foo.cc < cpp/foo.h < cpp/install_name/bar.cc < cpp/foo.cc < cpp/install_name/baz.cc < cpp/install_name/test.cc < cpp/test.cc < Date: Thu, 14 Apr 2022 21:24:37 +0000 Subject: [PATCH 2/2] Add missing mnemonic parameter after revert --- .../devtools/build/lib/rules/cpp/CppLinkActionBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 7711774eb00a2d..e37feb6871f59a 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 @@ -821,7 +821,9 @@ public CppLinkAction build() throws InterruptedException, RuleErrorException { configuration.getBinDirectory(repositoryName).getExecPath(), output.getExecPathString(), SolibSymlinkAction.getDynamicLibrarySoname( - output.getRootRelativePath(), /* preserveName= */ false), + output.getRootRelativePath(), + /* preserveName= */ false, + actionConstructionContext.getConfiguration().getMnemonic()), linkType.equals(LinkTargetType.DYNAMIC_LIBRARY), paramFile != null ? paramFile.getExecPathString() : null, thinltoParamFile != null ? thinltoParamFile.getExecPathString() : null,