Skip to content

Commit

Permalink
update to use ubuntu focal & jammy LTS releases
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbreen committed Sep 16, 2023
1 parent da7bd5e commit 1e37052
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 64 deletions.
36 changes: 18 additions & 18 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ platforms(
"//platforms:fedora/38",
"//platforms:rockylinux/8",
"//platforms:rockylinux/9",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
target_platforms = [
"//platforms:centos/6",
Expand All @@ -58,8 +58,8 @@ platforms(
"//platforms:fedora/38",
"//platforms:rockylinux/8",
"//platforms:rockylinux/9",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
)

Expand Down Expand Up @@ -94,8 +94,8 @@ platforms_test(
"//platforms:fedora/38",
"//platforms:rockylinux/8",
"//platforms:rockylinux/9",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
test = ":platform-hello-test",
)
Expand Down Expand Up @@ -131,8 +131,8 @@ platforms(
"//platforms:fedora/38",
"//platforms:rockylinux/8",
"//platforms:rockylinux/9",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
target_platforms = [
"//platforms:centos/6",
Expand All @@ -143,8 +143,8 @@ platforms(
"//platforms:fedora/38",
"//platforms:rockylinux/8",
"//platforms:rockylinux/9",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
)

Expand Down Expand Up @@ -178,8 +178,8 @@ platforms_test(
"//platforms:fedora/38",
"//platforms:rockylinux/8",
"//platforms:rockylinux/9",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
test = ":platform-tar-test",
)
Expand Down Expand Up @@ -279,14 +279,14 @@ platforms(
exec_platforms = [
"//platforms:debian/11",
"//platforms:debian/12",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
target_platforms = [
"//platforms:debian/11",
"//platforms:debian/12",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
)

Expand Down Expand Up @@ -316,8 +316,8 @@ platforms_test(
platforms = [
"//platforms:debian/11",
"//platforms:debian/12",
"//platforms:ubuntu/kinetic",
"//platforms:ubuntu/lunar",
"//platforms:ubuntu/focal",
"//platforms:ubuntu/jammy",
],
test = ":platform-deb-test",
)
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ register_toolchains(
"//toolchains/cc:fedora/38",
"//toolchains/cc:rockylinux/8",
"//toolchains/cc:rockylinux/9",
"//toolchains/cc:ubuntu/kinetic",
"//toolchains/cc:ubuntu/lunar",
"//toolchains/cc:ubuntu/focal",
"//toolchains/cc:ubuntu/jammy",
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ We want to target platforms with varied GLIBC versions.
fedora:38 redhat RPM 2.37 glibc-2.37-4.fc38.x86_64
rockylinux:8 redhat RPM 2.28 glibc-2.28-211.el8.x86_64
rockylinux:9 redhat RPM 2.34 glibc-2.34-60.el9.x86_64
ubuntu:kinetic debian DEB 2.36 libc6=2.36-0ubuntu4
ubuntu:lunar debian DEB 2.37 libc6=2.37-0ubuntu2
ubuntu:focal debian DEB 2.36 libc6=2.36-0ubuntu4
ubuntu:jammy debian DEB 2.37 libc6=2.37-0ubuntu2

We could use https://github.com/wheybags/glibc_version_header
to link to lowest-common denominator GLIBC symbols. But, glibc 2.34 has a
Expand Down
12 changes: 6 additions & 6 deletions executors/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ services:
build:
context: rockylinux/9
dockerfile: Containerfile
ubuntu-kinetic:
ubuntu-focal:
command: ["sh", "-c", "ld --version; gcc --version; python3 --version"]
image: ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:kinetic
image: ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:focal
build:
context: ubuntu/kinetic
context: ubuntu/focal
dockerfile: Containerfile
ubuntu-lunar:
ubuntu-jammy:
command: ["sh", "-c", "ld --version; gcc --version; python3 --version"]
image: ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:lunar
image: ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:jammy
build:
context: ubuntu/lunar
context: ubuntu/jammy
dockerfile: Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:lunar
FROM ubuntu:focal

RUN --mount=type=cache,sharing=private,target=/var/cache/apt \
export DEBIAN_FRONTEND=noninteractive && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:kinetic
FROM ubuntu:jammy

RUN --mount=type=cache,sharing=private,target=/var/cache/apt \
export DEBIAN_FRONTEND=noninteractive && \
Expand Down
10 changes: 5 additions & 5 deletions platforms/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,27 @@ platform(
)

platform(
name = "ubuntu/kinetic",
name = "ubuntu/focal",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"//platforms/family:debian",
"//platforms/glibc:2.36",
"//platforms/glibc:2.34",
],
exec_properties = {
"container-image": "docker://ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:kinetic",
"container-image": "docker://ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:focal",
},
)

platform(
name = "ubuntu/lunar",
name = "ubuntu/jammy",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"//platforms/family:debian",
"//platforms/glibc:2.37",
],
exec_properties = {
"container-image": "docker://ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:lunar",
"container-image": "docker://ghcr.io/nickbreen/bz-platforms2/executors/ubuntu:jammy",
},
)
5 changes: 5 additions & 0 deletions platforms/glibc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ constraint_value(
name = "2.37",
constraint_setting = ":glibc",
)

constraint_value(
name = "2.38",
constraint_setting = ":glibc",
)
58 changes: 29 additions & 29 deletions toolchains/cc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load("@bazel_tools//tools/cpp:unix_cc_toolchain_config.bzl", "cc_toolchain_confi
# apparently mandatory yet ignored (e.g. host_system_name).

# All of the following common chunks have been yoinked from @local_config_cc
# on Ubuntu/lunar except where commented.
# on Ubuntu/jammy except where commented.
tool_paths = {
"ar": "/usr/bin/ar",
"ld": "/usr/bin/ld",
Expand Down Expand Up @@ -503,15 +503,15 @@ toolchain(
)

cc_toolchain_config(
name = "config/ubuntu/kenetic",
abi_libc_version = "glibc-2.36",
abi_version = "gcc-12.2.0",
name = "config/ubuntu/focal",
abi_libc_version = "glibc-2.34",
abi_version = "gcc-9.4.0",
compile_flags = compile_flags,
compiler = "gcc-12.2.0",
compiler = "gcc-9.4.0",
cpu = "k8",
cxx_builtin_include_directories = [
"/usr/include",
"/usr/lib/gcc/x86_64-linux-gnu/12/include",
"/usr/lib/gcc/x86_64-linux-gnu/9/include",
],
cxx_flags = cxx_flags,
dbg_compile_flags = dbg_compile_flags,
Expand All @@ -520,52 +520,52 @@ cc_toolchain_config(
link_libs = link_libs,
opt_compile_flags = opt_compile_flags,
opt_link_flags = opt_link_flags,
target_libc = "glibc-2.36",
target_libc = "glibc-2.34",
target_system_name = "linux-gnu",
tool_paths = tool_paths,
toolchain_identifier = "k8_ubuntu_kinetic",
toolchain_identifier = "k8_ubuntu_focal",
)

cc_toolchain(
name = "cc/ubuntu/kinetic",
name = "cc/ubuntu/focal",
all_files = ":exec-platform-provided",
compiler_files = ":exec-platform-provided",
dwp_files = ":exec-platform-provided",
linker_files = ":exec-platform-provided",
objcopy_files = ":exec-platform-provided",
strip_files = ":exec-platform-provided",
toolchain_config = ":config/ubuntu/kenetic",
toolchain_identifier = "cc_ubuntu_kinetic",
toolchain_config = ":config/ubuntu/focal",
toolchain_identifier = "cc_ubuntu_focal",
)

toolchain(
name = "ubuntu/kinetic",
name = "ubuntu/focal",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"//platforms/family:debian",
"//platforms/glibc:2.36",
"//platforms/glibc:2.34",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"//platforms/family:debian",
"//platforms/glibc:2.36",
"//platforms/glibc:2.34",
],
toolchain = ":cc/ubuntu/kinetic",
toolchain = ":cc/ubuntu/focal",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

cc_toolchain_config(
name = "config/ubuntu/lunar",
abi_libc_version = "glibc-2.37",
abi_version = "gcc-12.2.0",
name = "config/ubuntu/jammy",
abi_libc_version = "glibc-2.38",
abi_version = "gcc-11.4.0",
compile_flags = compile_flags,
compiler = "gcc-12.2.0",
compiler = "gcc-11.4.0",
cpu = "k8",
cxx_builtin_include_directories = [
"/usr/include",
"/usr/lib/gcc/x86_64-linux-gnu/12/include",
"/usr/lib/gcc/x86_64-linux-gnu/11/include",
],
cxx_flags = cxx_flags,
dbg_compile_flags = dbg_compile_flags,
Expand All @@ -574,38 +574,38 @@ cc_toolchain_config(
link_libs = link_libs,
opt_compile_flags = opt_compile_flags,
opt_link_flags = opt_link_flags,
target_libc = "glibc-2.37",
target_libc = "glibc-2.38",
target_system_name = "linux-gnu",
tool_paths = tool_paths,
toolchain_identifier = "k8_ubuntu_lunar",
toolchain_identifier = "k8_ubuntu_jammy",
)

cc_toolchain(
name = "cc/ubuntu/lunar",
name = "cc/ubuntu/jammy",
all_files = ":exec-platform-provided",
compiler_files = ":exec-platform-provided",
dwp_files = ":exec-platform-provided",
linker_files = ":exec-platform-provided",
objcopy_files = ":exec-platform-provided",
strip_files = ":exec-platform-provided",
toolchain_config = ":config/ubuntu/lunar",
toolchain_identifier = "cc_ubuntu_lunar",
toolchain_config = ":config/ubuntu/jammy",
toolchain_identifier = "cc_ubuntu_jammy",
)

toolchain(
name = "ubuntu/lunar",
name = "ubuntu/jammy",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"//platforms/family:debian",
"//platforms/glibc:2.37",
"//platforms/glibc:2.38",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"//platforms/family:debian",
"//platforms/glibc:2.37",
"//platforms/glibc:2.38",
],
toolchain = ":cc/ubuntu/lunar",
toolchain = ":cc/ubuntu/jammy",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

0 comments on commit 1e37052

Please sign in to comment.