Skip to content

Commit

Permalink
Added README describing toolchain patches (#1349)
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre authored Jan 1, 2025
1 parent d412700 commit ad501b8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 13 deletions.
16 changes: 5 additions & 11 deletions toolchains/built_toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,11 @@ def built_toolchains(cmake_version, make_version, ninja_version, meson_version,
Args:
cmake_version: The CMake version to build
make_version: The Make version to build
ninja_version: The Ninja version to build
meson_version: The Meson version to build
pkgconfig_version: The pkg-config version to build
register_toolchains: If true, registers the toolchains via native.register_toolchains. Used by bzlmod
register_built_pkgconfig_toolchain: If true, the built pkgconfig toolchain will be registered.
"""
_cmake_toolchain(cmake_version, register_toolchains)
Expand Down Expand Up @@ -73,7 +67,7 @@ def _cmake_toolchain(version, register_toolchains):
strip_prefix = prefix,
urls = urls,
patches = [
Label("//toolchains:cmake-c++11.patch"),
Label("//toolchains/patches:cmake-c++11.patch"),
],
)
return
Expand Down Expand Up @@ -118,7 +112,7 @@ def _make_toolchain(version, register_toolchains):
http_archive,
name = "gnumake_src",
build_file_content = _ALL_CONTENT,
patches = [Label("//toolchains:make-reproducible-bootstrap.patch")],
patches = [Label("//toolchains/patches:make-reproducible-bootstrap.patch")],
sha256 = "e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19",
strip_prefix = "make-4.3",
urls = [
Expand Down Expand Up @@ -340,13 +334,13 @@ cc_import(
# The patch is required as bazel does not provide the VCINSTALLDIR or WINDOWSSDKDIR vars
patches = [
# This patch is required as bazel does not provide the VCINSTALLDIR or WINDOWSSDKDIR vars
Label("//toolchains:pkgconfig-detectenv.patch"),
Label("//toolchains/patches:pkgconfig-detectenv.patch"),

# This patch is required as rules_foreign_cc runs in MSYS2 on Windows and MSYS2's "mkdir" is used
Label("//toolchains:pkgconfig-makefile-vc.patch"),
Label("//toolchains/patches:pkgconfig-makefile-vc.patch"),

# This patch fixes explicit integer conversion which causes errors in clang >= 15 and gcc >= 14
Label("//toolchains:pkgconfig-builtin-glib-int-conversion.patch"),
Label("//toolchains/patches:pkgconfig-builtin-glib-int-conversion.patch"),
],
urls = [
"https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz",
Expand Down
Empty file added toolchains/patches/BUILD.bazel
Empty file.
21 changes: 21 additions & 0 deletions toolchains/patches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Foreign CC toolchain patches

## [cmake-c++11.patch](./cmake-c++11.patch)

See <https://discourse.cmake.org/t/cmake-error-at-cmakelists-txt-117-message-the-c-compiler-does-not-support-c-11-e-g-std-unique-ptr/3774/8>

## [make-reproducible-bootstrap.patch](./make-reproducible-bootstrap.patch)

This patch avoids reliance on host installed tools for bootstrapping make.

## [pkgconfig-builtin-glib-int-conversion.patch](./pkgconfig-builtin-glib-int-conversion.patch)

This patch fixes explicit integer conversion which causes errors in `clang >= 15` and `gcc >= 14`

## [pkgconfig-detectenv.patch](./pkgconfig-detectenv.patch)

This patch is required as bazel does not provide the VCINSTALLDIR or WINDOWSSDKDIR vars

## [pkgconfig-makefile-vc.patch](./pkgconfig-makefile-vc.patch)

This patch is required as rules_foreign_cc runs in MSYS2 on Windows and MSYS2's "mkdir" is used
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
See <https://discourse.cmake.org/t/cmake-error-at-cmakelists-txt-117-message-the-c-compiler-does-not-support-c-11-e-g-std-unique-ptr/3774/8>

--- CMakeLists.txt 2023-01-24 13:46:17.000000000 -0800
+++ CMakeLists.txt 2023-01-24 13:46:43.000000000 -0800
@@ -96,10 +96,6 @@
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit ad501b8

Please sign in to comment.