From 42221207608190af2e062d425df708570fa89247 Mon Sep 17 00:00:00 2001 From: Son Luong Ngoc Date: Thu, 11 Jan 2024 17:38:36 +0100 Subject: [PATCH] Revert "macos: rollback linkopt flag (#5684)" This reverts commit 8bfb1c6d6f31f8013a5cefed9ec51bfacc584544. --- .bazelrc | 8 +++++ ...ld-mac-intel-github-release-artifacts.yaml | 35 +++---------------- platform_mapping | 4 +++ 3 files changed, 17 insertions(+), 30 deletions(-) create mode 100644 platform_mapping diff --git a/.bazelrc b/.bazelrc index 59ae0d014c7c..f5a0d7e5134f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -199,6 +199,14 @@ common:macos --cxxopt=-std=c++17 common:windows --host_cxxopt=/std:c++17 common:windows --cxxopt=/std:c++17 +# Starting from Xcode 15, the linker will warn about duplicate flags. +# This is currently not avoidable with the current way the local cc toolchain is configured +# as well as how linkopts are propagated through the dependency graph between libraries. +# This flag is a workaround to silence the linker warnings. +# common:macos --linkopt="-Wl,-no_warn_duplicate_libraries" +# common:macos --host_linkopt="-Wl,-no_warn_duplicate_libraries" +common:macos --platform_mappings=platform_mapping + # Ensure that we don't use the apple_support cc_toolchain common:macos --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 diff --git a/.github/workflows/build-mac-intel-github-release-artifacts.yaml b/.github/workflows/build-mac-intel-github-release-artifacts.yaml index 235289818357..632cbce06ee7 100644 --- a/.github/workflows/build-mac-intel-github-release-artifacts.yaml +++ b/.github/workflows/build-mac-intel-github-release-artifacts.yaml @@ -1,27 +1,9 @@ name: "Build Mac-Intel Github Release Artifacts" on: - workflow_dispatch: - inputs: - release_branch: - description: "Git branch to checkout." - required: true - default: "master" - type: string - version_tag: - description: "Version to tag release artifacts." - required: true - type: string - workflow_call: - inputs: - release_branch: - description: "Git branch to checkout." - required: true - type: string - version_tag: - description: "Version to tag release artifacts." - required: true - type: string + pull_request: + branches: + - master jobs: build: @@ -31,9 +13,6 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.release_branch }} - # We need to fetch git tags to obtain the latest version tag to report - # the version of the running binary. - fetch-depth: 0 - name: Install bazelisk run: | @@ -45,10 +24,6 @@ jobs: - name: Build and Upload Artifacts env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEVELOPER_DIR: "/Library/Developer/CommandLineTools" run: | - export DEVELOPER_DIR=/Library/Developer/CommandLineTools - "${GITHUB_WORKSPACE}/bin/bazel" build --config=release-mac --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} //server/cmd/buildbuddy:buildbuddy //enterprise/server/cmd/server:buildbuddy //enterprise/server/cmd/executor:executor - cp bazel-bin/server/cmd/**/**/buildbuddy buildbuddy-darwin-amd64 - cp bazel-bin/enterprise/server/cmd/**/**/buildbuddy buildbuddy-enterprise-darwin-amd64 - cp bazel-bin/enterprise/server/cmd/**/**/executor executor-enterprise-darwin-amd64 - gh release upload ${{ inputs.version_tag }} buildbuddy-darwin-amd64 buildbuddy-enterprise-darwin-amd64 executor-enterprise-darwin-amd64 --clobber + "${GITHUB_WORKSPACE}/bin/bazel" build --toolchain_resolution_debug='@bazel_tools//tools/cpp:toolchain_type' --config=release-mac --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} //server/cmd/buildbuddy:buildbuddy //enterprise/server/cmd/server:buildbuddy //enterprise/server/cmd/executor:executor diff --git a/platform_mapping b/platform_mapping new file mode 100644 index 000000000000..4c86ae9aa23e --- /dev/null +++ b/platform_mapping @@ -0,0 +1,4 @@ +platforms: + @local_config_platform//:host + --linkopt="-Wl,-v" + --host_linkopt="-Wl,-v"