Skip to content

Commit ad501b8

Browse files
authored
Added README describing toolchain patches (#1349)
1 parent d412700 commit ad501b8

8 files changed

+26
-13
lines changed

toolchains/built_toolchains.bzl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,11 @@ def built_toolchains(cmake_version, make_version, ninja_version, meson_version,
3333
3434
Args:
3535
cmake_version: The CMake version to build
36-
3736
make_version: The Make version to build
38-
3937
ninja_version: The Ninja version to build
40-
4138
meson_version: The Meson version to build
42-
4339
pkgconfig_version: The pkg-config version to build
44-
4540
register_toolchains: If true, registers the toolchains via native.register_toolchains. Used by bzlmod
46-
4741
register_built_pkgconfig_toolchain: If true, the built pkgconfig toolchain will be registered.
4842
"""
4943
_cmake_toolchain(cmake_version, register_toolchains)
@@ -73,7 +67,7 @@ def _cmake_toolchain(version, register_toolchains):
7367
strip_prefix = prefix,
7468
urls = urls,
7569
patches = [
76-
Label("//toolchains:cmake-c++11.patch"),
70+
Label("//toolchains/patches:cmake-c++11.patch"),
7771
],
7872
)
7973
return
@@ -118,7 +112,7 @@ def _make_toolchain(version, register_toolchains):
118112
http_archive,
119113
name = "gnumake_src",
120114
build_file_content = _ALL_CONTENT,
121-
patches = [Label("//toolchains:make-reproducible-bootstrap.patch")],
115+
patches = [Label("//toolchains/patches:make-reproducible-bootstrap.patch")],
122116
sha256 = "e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19",
123117
strip_prefix = "make-4.3",
124118
urls = [
@@ -340,13 +334,13 @@ cc_import(
340334
# The patch is required as bazel does not provide the VCINSTALLDIR or WINDOWSSDKDIR vars
341335
patches = [
342336
# This patch is required as bazel does not provide the VCINSTALLDIR or WINDOWSSDKDIR vars
343-
Label("//toolchains:pkgconfig-detectenv.patch"),
337+
Label("//toolchains/patches:pkgconfig-detectenv.patch"),
344338

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

348342
# This patch fixes explicit integer conversion which causes errors in clang >= 15 and gcc >= 14
349-
Label("//toolchains:pkgconfig-builtin-glib-int-conversion.patch"),
343+
Label("//toolchains/patches:pkgconfig-builtin-glib-int-conversion.patch"),
350344
],
351345
urls = [
352346
"https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz",

toolchains/patches/BUILD.bazel

Whitespace-only changes.

toolchains/patches/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Foreign CC toolchain patches
2+
3+
## [cmake-c++11.patch](./cmake-c++11.patch)
4+
5+
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>
6+
7+
## [make-reproducible-bootstrap.patch](./make-reproducible-bootstrap.patch)
8+
9+
This patch avoids reliance on host installed tools for bootstrapping make.
10+
11+
## [pkgconfig-builtin-glib-int-conversion.patch](./pkgconfig-builtin-glib-int-conversion.patch)
12+
13+
This patch fixes explicit integer conversion which causes errors in `clang >= 15` and `gcc >= 14`
14+
15+
## [pkgconfig-detectenv.patch](./pkgconfig-detectenv.patch)
16+
17+
This patch is required as bazel does not provide the VCINSTALLDIR or WINDOWSSDKDIR vars
18+
19+
## [pkgconfig-makefile-vc.patch](./pkgconfig-makefile-vc.patch)
20+
21+
This patch is required as rules_foreign_cc runs in MSYS2 on Windows and MSYS2's "mkdir" is used

toolchains/cmake-c++11.patch renamed to toolchains/patches/cmake-c++11.patch

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
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>
2-
31
--- CMakeLists.txt 2023-01-24 13:46:17.000000000 -0800
42
+++ CMakeLists.txt 2023-01-24 13:46:43.000000000 -0800
53
@@ -96,10 +96,6 @@

0 commit comments

Comments
 (0)