Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ build:linux --host_per_file_copt=external/.*@-w

# Configure our Windows MSVC and ClangCL setup.
common:windows-msvc --enable_runfiles
build:windows-msvc --platforms=//ci:windows_msvc
build:windows-msvc --cxxopt=/std:c++17 --host_cxxopt=/std:c++17
build:windows-msvc --copt=/WX
build:windows-msvc --per_file_copt=external/.*@/w
build:windows-msvc --host_per_file_copt=external/.*@/w

build:windows-clangcl --config=windows-msvc
build:windows-clangcl --platforms=//ci:windows_clangcl
build:windows-clangcl --compiler=clang-cl
build:windows-clangcl --copt=-Wno-microsoft-cast
build:windows-clangcl --extra_execution_platforms=//:x64_windows-clang-cl
build:windows-clangcl --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl

# Configure our macOS Xcode setup.
build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
Expand Down Expand Up @@ -120,3 +120,15 @@ build:remote-arm --platforms=//ci:rbe-arm
build:remote-arm --remote_cache=grpcs://us-central1-remotebuildexecution.googleapis.com
build:remote-arm --remote_executor=grpcs://us-central1-remotebuildexecution.googleapis.com
build:remote-arm --remote_instance_name=projects/google.com:absl-177019/instances/gloop-ci-central

build:remote-windows --config=remote-base
build:remote-windows --extra_execution_platforms=//ci:rbe-windows
build:remote-windows --host_platform=//ci:rbe-windows
build:remote-windows --platforms=//ci:rbe-windows
build:remote-windows --remote_cache=grpcs://us-east1-remotebuildexecution.googleapis.com
build:remote-windows --remote_executor=grpcs://us-east1-remotebuildexecution.googleapis.com
build:remote-windows --remote_instance_name=projects/google.com:absl-177019/instances/absl-ci-east
# cc_test puts Windows .pdb files in the pdb_file output group rather than
# runfiles, so run symbolize_test locally with symbolize_test.pdb downloaded.
build:remote-windows --remote_download_regex=.*symbolize_test\.pdb$
build:remote-windows --strategy_regexp=Testing.*symbolize_test=local
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
- name: GCC/libstdc++ (floor)
toolchain: gcc
remote_config: remote-floor
container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:5a5d17e588e14d5f0d993ea828b7ba844c72b02980bcf731ccf5a4cddf8db599
container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:9027d0b4cae51d764cebafecbf9e390a14f97cf977ca24d02cc533998614acd2
stds: '["c++17"]'
# linux_arm_clang-latest_libcxx_bazel.cfg (c++17 and c++20 only)
- name: ARM64 Clang/libc++
Expand All @@ -95,13 +95,13 @@
toolchain: clang-arm
remote_config: remote-arm
stds: '["c++17", "c++20"]'
uses: ./.github/workflows/bazel.yml

Check warning on line 98 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

secrets-inherit

ci.yml:98: secrets unconditionally inherited by called workflow: this reusable workflow
secrets: inherit
with:
os: ${{ matrix.config.os || 'ubuntu-24.04' }}
toolchain: ${{ matrix.config.toolchain }}
remote_config: ${{ matrix.config.remote_config || 'remote' }}
container_image: ${{ matrix.config.container_image || 'gcr.io/google.com/absl-177019/oss-linux-toolchain-latest@sha256:5a19067585ce5e5ee45640fd0287f05038d6b3f9574d6a5cdf08241e022d0f4a' }}
container_image: ${{ matrix.config.container_image || 'gcr.io/google.com/absl-177019/oss-linux-toolchain-latest@sha256:81009eeb5523ae59cfbea8dc0847d41572ed100f79e3c976c64378a0c30d353c' }}
alternate_options: ${{ matrix.config.alternate_options || false }}
stds: ${{ matrix.config.stds || '["c++17", "c++20", "c++23"]' }}
compilation_modes: ${{ matrix.config.compilation_modes || '["opt", "fastbuild"]' }}
Expand All @@ -115,17 +115,17 @@
# linux_gcc-latest_libstdcxx_cxx17_cmake.cfg
- name: Linux GCC/libstdc++
os: ubuntu-24.04
container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6
container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58
# linux_gcc_alpine_cmake.cfg
- name: Alpine Linux GCC (musl)
os: ubuntu-24.04
container_image: gcr.io/google.com/absl-177019/alpine@sha256:ae26b80601cebb14595056a94e070f0f865d24baaf3ce19bcd52f53be9f99c80
container_image: gcr.io/google.com/absl-177019/alpine@sha256:52945833fc7b7b93f73ec865eb82390aa46d4e3acd1af87d253cd4a05f95d241
build_types: '["Debug"]'
link_modes: '["static"]'
# cmake-install.cfg
- name: Linux Install
os: ubuntu-24.04
container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6
container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58
build_types: '["Release"]'
link_modes: '["static", "shared"]'
install_test: true
Expand All @@ -139,7 +139,7 @@
os: windows-2022
build_types: '["Debug"]'
link_modes: '["static", "shared"]'
uses: ./.github/workflows/cmake.yml

Check warning on line 142 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

secrets-inherit

ci.yml:142: secrets unconditionally inherited by called workflow: this reusable workflow
secrets: inherit
with:
os: ${{ matrix.config.os }}
Expand Down Expand Up @@ -167,12 +167,12 @@
toolchain: windows-clangcl
stds: '["c++17"]'
compilation_modes: '["fastbuild"]'
uses: ./.github/workflows/bazel.yml

Check warning on line 170 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

secrets-inherit

ci.yml:170: secrets unconditionally inherited by called workflow: this reusable workflow
secrets: inherit
with:
os: windows-2022
toolchain: ${{ matrix.config.toolchain }}
remote_config: remote-cache
remote_config: remote-windows
alternate_options: ${{ matrix.config.alternate_options || false }}
stds: ${{ matrix.config.stds || '["c++17", "c++20"]' }}
compilation_modes: ${{ matrix.config.compilation_modes || '["dbg", "opt"]' }}
Expand All @@ -188,7 +188,7 @@
# macos_xcode_alternate_options_bazel.cfg
- name: Xcode Alternate Options
alternate_options: true
uses: ./.github/workflows/bazel.yml

Check warning on line 191 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

secrets-inherit

ci.yml:191: secrets unconditionally inherited by called workflow: this reusable workflow
secrets: inherit
with:
os: macos-latest
Expand Down
32 changes: 26 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,27 @@
CFLAGS: ${{ !inputs.install_test && startsWith(inputs.os, 'ubuntu') && '-Werror' || '' }}
CXX: ${{ startsWith(inputs.os, 'ubuntu') && 'g++' || '' }}
CXXFLAGS: ${{ !inputs.install_test && (startsWith(inputs.os, 'ubuntu') && '-Werror' || startsWith(inputs.os, 'windows') && '-WX') || '' }}
CMAKE_BUILD_PARALLEL_LEVEL: 16
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache
CMAKE_BUILD_PARALLEL_LEVEL: ${{ startsWith(inputs.os, 'ubuntu') && 50 || 16 }}
CMAKE_C_COMPILER_LAUNCHER: ${{ startsWith(inputs.os, 'ubuntu') && 'rewrapper' || 'sccache' }}
CMAKE_CXX_COMPILER_LAUNCHER: ${{ startsWith(inputs.os, 'ubuntu') && 'rewrapper' || 'sccache' }}
CMAKE_TEST_LAUNCHER: ${{ startsWith(inputs.os, 'ubuntu') && 'rbe_test_launcher' || '' }}
CMAKE_GENERATOR: Ninja
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_PARALLEL_LEVEL: 16
CTEST_PARALLEL_LEVEL: ${{ startsWith(inputs.os, 'ubuntu') && 50 || 16 }}
TZDIR: ${{ github.workspace }}/absl/time/internal/cctz/testdata/zoneinfo
RBE_service: us-east1-remotebuildexecution.googleapis.com:443
RBE_instance: projects/google.com:absl-177019/instances/absl-ci-east
RBE_use_application_default_credentials: true
RBE_exec_strategy: remote
RBE_exec_root: ${{ github.workspace }}
RBE_platform: OSArch=amd64,cache-silo-key=n2-highcpu-2-2026-10-14,container-image=docker://${{ inputs.container_image }},dockerRunAsRoot=true
SCCACHE_GCS_BUCKET: absl-cmake-sccache
SCCACHE_GCS_RW_MODE: READ_WRITE
SCCACHE_IDLE_TIMEOUT: 0
SCCACHE_IGNORE_SERVER_IO_ERROR: 1
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0

Check warning on line 93 in .github/workflows/cmake.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

ref-version-mismatch

cmake.yml:93: action's hash pin has mismatched or missing version comment: points to unknown ref

- name: Set up MSVC
if: ${{ runner.os == 'Windows' }}
Expand All @@ -98,13 +106,23 @@
credentials_json: ${{ secrets.GAR_SERVICE_ACCOUNT }}

- name: Set up sccache
if: ${{ runner.os != 'Linux' }}
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10

- name: Start sccache
if: ${{ runner.os != 'Linux' }}
env:
SCCACHE_GCS_KEY_PATH: ${{ steps.auth.outputs.credentials_file_path }}
run: sccache --start-server

- name: Start reclient (RBE)
if: ${{ runner.os == 'Linux' }}
run: |
# CMake passes absolute source/include paths (${GITHUB_WORKSPACE}/...) to
# the compiler, so mount the remote input root at that same container path.
echo "RBE_platform=${RBE_platform},InputRootAbsolutePath=${GITHUB_WORKSPACE}" >> "$GITHUB_ENV"
bootstrap

- name: Run installation test
if: ${{ inputs.install_test }}
env:
Expand All @@ -121,7 +139,7 @@
cmake -B build
-DABSL_BUILD_TESTING=ON
-DABSL_GOOGLETEST_DOWNLOAD_URL=${ABSL_GOOGLETEST_DOWNLOAD_URL}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

Check failure on line 142 in .github/workflows/cmake.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/template-injection

code injection via template expansion: may expand into attacker-controllable code

Check failure on line 142 in .github/workflows/cmake.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

template-injection

cmake.yml:142: code injection via template expansion: may expand into attacker-controllable code
-DCMAKE_C_FLAGS_DEBUG="${{ runner.os == 'Windows' && '-O1 -Ob1 -Zc:inline' || '-Og' }}"
-DCMAKE_CXX_FLAGS_DEBUG="${{ runner.os == 'Windows' && '-O1 -Ob1 -Zc:inline' || '-Og' }}"
-DCMAKE_EXE_LINKER_FLAGS_DEBUG=""
Expand All @@ -140,9 +158,11 @@

- name: Run tests
if: ${{ !inputs.install_test }}
env:
TZDIR: ${{ github.workspace }}/absl/time/internal/cctz/testdata/zoneinfo
run: >
ctest --test-dir build
--repeat until-pass:3
${{ runner.os == 'Windows' && '-E "absl_lifetime_test|absl_symbolize_test"' || '' }}

- name: Stop reclient (RBE)
if: ${{ always() && runner.os == 'Linux' }}
run: bootstrap --shutdown
21 changes: 13 additions & 8 deletions CMake/install_test_project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,26 @@
# Fail on any error. Treat unset variables an error. Print commands as executed.
set -euox pipefail

# TODO(b/573304451): Remove once Kokoro is turned down (set in cmake.yml).
export CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL:-$(nproc)}"
export CTEST_PARALLEL_LEVEL="${CTEST_PARALLEL_LEVEL:-$(nproc)}"

absl_dir="${PWD}"
absl_build_dir=/buildfs
absl_build_dir="${absl_dir}/buildfs/absl-build"
mkdir -p "${absl_build_dir}"
googletest_builddir=/googletest_builddir
googletest_builddir="${absl_dir}/buildfs/googletest"
googletest_install_dir="${absl_build_dir}/googletest-install"
googletest_archive="googletest-${ABSL_GOOGLETEST_VERSION}.tar.gz"
project_dir="${absl_dir}/CMake/install_test_project"
project_build_dir=/buildfs/project-build
project_build_dir="${absl_dir}/buildfs/project-build"

build_shared_libs="OFF"
if [ "${LINK_TYPE:-}" = "DYNAMIC" ]; then
build_shared_libs="ON"
fi

# Build and install GoogleTest
mkdir "${googletest_builddir}"
mkdir -p "${googletest_builddir}"
pushd "${googletest_builddir}"
curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${googletest_archive}"
tar -xz -f "${googletest_archive}"
Expand All @@ -42,8 +47,7 @@ mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="${build_shared_libs}" ..
cmake --build .
cmake --install .
ldconfig
cmake --install . --prefix "${googletest_install_dir}"
popd
popd
popd
Expand All @@ -56,6 +60,7 @@ pushd "${absl_build_dir}"
cmake "${absl_dir}" \
-DABSL_USE_EXTERNAL_GOOGLETEST=ON \
-DABSL_FIND_GOOGLETEST=ON \
-DCMAKE_PREFIX_PATH="${googletest_install_dir}" \
-DCMAKE_BUILD_TYPE=Release \
-DABSL_BUILD_TESTING=ON \
-DBUILD_SHARED_LIBS="${build_shared_libs}" \
Expand All @@ -70,8 +75,8 @@ popd
# Test the project against the installed Abseil
mkdir -p "${project_build_dir}"
pushd "${project_build_dir}"
cmake "${project_dir}"
cmake --build . --target simple
env -u CMAKE_C_COMPILER_LAUNCHER -u CMAKE_CXX_COMPILER_LAUNCHER cmake "${project_dir}"
env -u CMAKE_C_COMPILER_LAUNCHER -u CMAKE_CXX_COMPILER_LAUNCHER cmake --build . --target simple

output="$(${project_build_dir}/simple "printme" 2>&1)"
if [[ "${output}" != *"Arg 1: printme"* ]]; then
Expand Down
37 changes: 34 additions & 3 deletions ci/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platform(
exec_properties = {
"OSArch": "amd64",
"cache-silo-key": "n2-highcpu-2-2026-10-14",
"container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6",
"container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58",
"dockerRunAsRoot": "true",
},
)
Expand All @@ -37,7 +37,7 @@ platform(
exec_properties = {
"OSArch": "amd64",
"cache-silo-key": "n2-highcpu-2-2026-10-14",
"container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-floor@sha256:60898eb3b0dbcf85cd60e346f103fbf3169d966d391dcb2362b243d528b1183b",
"container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-floor@sha256:a25e596d10b907c8896768196a6e5c8007bac93abb1677ed1fcc186d28afc032",
"dockerRunAsRoot": "true",
},
)
Expand All @@ -51,11 +51,24 @@ platform(
exec_properties = {
"OSArch": "arm64",
"cache-silo-key": "t2a-standard-4-2026-10-14",
"container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6",
"container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58",
"dockerRunAsRoot": "true",
},
)

platform(
name = "rbe-windows",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
exec_properties = {
"OSFamily": "Windows",
"cache-silo-key": "e2-highmem-2-2026-10-21",
"container-image": "docker://gcr.io/google.com/absl-177019/oss-windows-latest@sha256:e0b1a8289f04ee358226ee64879be1721a209baf825e16b2393a54dbc6183fa4",
},
)

platform(
name = "linux_gcc",
constraint_values = [
Expand All @@ -82,3 +95,21 @@ platform(
"@bazel_tools//tools/cpp:clang",
],
)

platform(
name = "windows_msvc",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
"@bazel_tools//tools/cpp:msvc",
],
)

platform(
name = "windows_clangcl",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
"@bazel_tools//tools/cpp:clang-cl",
],
)
11 changes: 8 additions & 3 deletions ci/docker_toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Standalone fallback toolchain module when building outside the Docker container.
# Inside the container, this module is overridden via /etc/bazel.bazelrc to point to an actual
# toolchain.
# Standalone toolchain module when building outside the Linux Docker container.
# Inside the Linux container, this module is overridden via /etc/bazel.bazelrc
# to point to /opt/docker_toolchain. On Windows RBE, this module provides the
# toolchains targeting the oss-windows-latest container.

load(":windows_toolchain.bzl", "setup_windows_toolchains")

package(default_visibility = ["//visibility:public"])

filegroup(name = "empty")

setup_windows_toolchains()
3 changes: 3 additions & 0 deletions ci/docker_toolchain/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ module(
name = "docker_toolchain",
version = "0.1",
)

bazel_dep(name = "rules_cc", version = "0.2.22")
bazel_dep(name = "platforms", version = "1.1.0")
Loading
Loading