KKaylee LubickTry using c++2a for old NDK
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Update Bazel to 8.2.1 and use bzlmod The update to bzlmod [1] changes how we handle third_party deps (dramatically) and how our toolchains work (minorly). To review and understand the changes, I suggest going language by language through the changes: C++ === We have Bazel check out git repositories listed in deps.bzl (like before), but this has been converted to a module_extension [2] which behaves basically the same. In MODULE.bazel, we load the extension and then specify all the dependencies that Skia directly depends on from there. If we can depend on versions from the Bazel registry [3], for example bazel_dep(name = "libpng", version = "1.6.47.bcr.1") we could remove the git repository versions and this might make things easier for external clients if there are version mismatches. A big change was required with how we customize our compilation of expat, FreeType, Harfbuzz, and ICU. Previously, we'd copied in (or cleverly referenced) files from the Skia repo in the third party copy of the code and this sort of worked. External clients had to use some helpers to load these configs and it was Fine (tm). This does not work with bzlmod's dependency graph. I tried several things to make this work cleanly and ran into road blocks with either RBE or external client usage (or both). See earlier patchsets for that, if interested. What *did* work (at least ok) was making a patch file per third party dep that needed it using tools/generate_patches.py to combine all those files and specify an output location. This has the downside of not being in sync, but I made the existing roll scripts for expat, FreeType, Harfbuzz shell out to the script to minimize that. Toolchains needed to be slightly updated to have a different path in the external/ output directory, which now includes some prefixing. To make this as robust as possible, I made the trampoline scripts use paths relative to where the script lives and use a glob to find the path no matter what the prefix is. Clang remains at 15.0.1 for Bazel builds. Rust ==== The rust toolchain has been updated to 1.86.0 (this was the primary impetus for this change). External crate dependences use crate_universe [4] and specify the versions we need directly in MODULE.bazel instead of using a toml file. I chose that approach because it seemed more direct when one wants to figure out what version our Bazel build uses. All crates except cxx worked "out of the box", meaning the rules_rust generated BUILD.bazel files for them in a way that just worked. I had to use crate.annotation to customize cxx to use bazel/external/cxx/BUILD.bazel.skia in addition to the generated rule so we can overwrite the include path. This was a bit fiddly and required me to spend a while looking through the bazel cache to experiment with what the output was. The only other major change is how we reference rust dependencies now. For example in src/ports/fontations/BUILD.bazel see that all rust dependencies are based out of @crates instead of all being top level dependencies. Again, poking into the bazel cache is helpful for figuring out what the generated target names are. Another upside of this update is the big long "splicing workspaces" seems to have gone away. Golang ====== The golang version is now 1.24.2. These were the most fiddly changes - particularly with some changes in the ecosystem related to protos. In MODULE.bazel, the go.mod file is read in to get both the go version and the direct golang dependencies. go_rules uses gazelle [5] to generate BUILD.bazel files for any deps if they don't have them. This includes generating BUILD.bazel files for proto files, which are a bit messy due to there being some conflicting ways to include these and thus resolve the deps. This [6] is why I ended up mothballing the upgrade of the Skia Infra repo in favor of a minimal [7] change. In this case, we only had to tell the go.chromium.org/luci repo not to autogenerate .go files for .proto files because there are pre-existing ones. While building task drivers, there was a problem where some go deps were not being brought in and thus our transitive dependencies were failing to build. This is why tools.go was added (inspired by [8] to force those to be included. Python3 ======= This was a straightforward upgrade to Python 3.13. MODULE.bazel still reads requirements.txt to figure out what to download. The BUILD.bazel file we build for Dawn uses these requirements, but we didn't have to change how that worked at all. Other Notes =========== Renames ------- There are many mechanical changes (e.g. io_bazel_rules_go->rules_go) throughout as a result of bzlmod having different (non prefixed) package names in some cases. bazel/buildrc ------------- Sandboxing seems much faster in this new Bazel version on Mac. Thus I deleted the no_sandbox config. This change also updates the version of emsdk we use to compile CanvasKit. I had to squelch some warnings that they have via our config because I didn't see another way to override their toolchain settings. buildifier ---------- Updated the version used by Bazel to 8.0.3 I suggest folks also update their local version too, so presubmits work [9] Not working (yet) / disabled ============================ - karma_tests (JS tests for CanvasKit). This was based on long-deprecated rules and I didn't have the time to fix this. We still have GN based tests for CanvasKit, so this was low enough priority to skip for now - codesize_test. git_common.WithGitFinder was not working. As this is a test for our task_driver and has been stable for a while, it seemed like a low priority to fix. - bazel run //:gofmt. This moved with new go_rules and I couldn't find an easy replacement. - bazel run //:errcheck. This needs to shell out to golang and doesn't work on systems that don't have go installed because of the hermeticity. Not sure what to do about that. - clang_ios and clang_windows_amd64 toolchains. We don't have any CI jobs that use these atm, and they are lower priority for now. I made some changes based on other toolchains, but didn't test these. [1] https://bazel.build/external/migration [2] https://bazel.build/external/extension [3] https://registry.bazel.build/modules/libpng [4] https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html [5] https://github.com/bazel-contrib/bazel-gazelle/blob/master/extensions.md#go_deps [6] https://skia-review.googlesource.com/c/buildbot/+/988440/11/MODULE.bazel [7] http://review.skia.org/990801 [8] https://github.com/google/skia-buildbot/blob/b4a7f41e01ea288eadd197f9eee0b1a8a12c5aa4/tools.go [9] https://github.com/bazelbuild/buildtools/releases/tag/v8.0.3 Change-Id: I68be15c5c4a5d2b14359fa460075591dafab336a Bug: b/413044303 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/984976 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Dominik Röttsches <drott@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 1 年前 | |
Update Bazel to 8.2.1 and use bzlmod The update to bzlmod [1] changes how we handle third_party deps (dramatically) and how our toolchains work (minorly). To review and understand the changes, I suggest going language by language through the changes: C++ === We have Bazel check out git repositories listed in deps.bzl (like before), but this has been converted to a module_extension [2] which behaves basically the same. In MODULE.bazel, we load the extension and then specify all the dependencies that Skia directly depends on from there. If we can depend on versions from the Bazel registry [3], for example bazel_dep(name = "libpng", version = "1.6.47.bcr.1") we could remove the git repository versions and this might make things easier for external clients if there are version mismatches. A big change was required with how we customize our compilation of expat, FreeType, Harfbuzz, and ICU. Previously, we'd copied in (or cleverly referenced) files from the Skia repo in the third party copy of the code and this sort of worked. External clients had to use some helpers to load these configs and it was Fine (tm). This does not work with bzlmod's dependency graph. I tried several things to make this work cleanly and ran into road blocks with either RBE or external client usage (or both). See earlier patchsets for that, if interested. What *did* work (at least ok) was making a patch file per third party dep that needed it using tools/generate_patches.py to combine all those files and specify an output location. This has the downside of not being in sync, but I made the existing roll scripts for expat, FreeType, Harfbuzz shell out to the script to minimize that. Toolchains needed to be slightly updated to have a different path in the external/ output directory, which now includes some prefixing. To make this as robust as possible, I made the trampoline scripts use paths relative to where the script lives and use a glob to find the path no matter what the prefix is. Clang remains at 15.0.1 for Bazel builds. Rust ==== The rust toolchain has been updated to 1.86.0 (this was the primary impetus for this change). External crate dependences use crate_universe [4] and specify the versions we need directly in MODULE.bazel instead of using a toml file. I chose that approach because it seemed more direct when one wants to figure out what version our Bazel build uses. All crates except cxx worked "out of the box", meaning the rules_rust generated BUILD.bazel files for them in a way that just worked. I had to use crate.annotation to customize cxx to use bazel/external/cxx/BUILD.bazel.skia in addition to the generated rule so we can overwrite the include path. This was a bit fiddly and required me to spend a while looking through the bazel cache to experiment with what the output was. The only other major change is how we reference rust dependencies now. For example in src/ports/fontations/BUILD.bazel see that all rust dependencies are based out of @crates instead of all being top level dependencies. Again, poking into the bazel cache is helpful for figuring out what the generated target names are. Another upside of this update is the big long "splicing workspaces" seems to have gone away. Golang ====== The golang version is now 1.24.2. These were the most fiddly changes - particularly with some changes in the ecosystem related to protos. In MODULE.bazel, the go.mod file is read in to get both the go version and the direct golang dependencies. go_rules uses gazelle [5] to generate BUILD.bazel files for any deps if they don't have them. This includes generating BUILD.bazel files for proto files, which are a bit messy due to there being some conflicting ways to include these and thus resolve the deps. This [6] is why I ended up mothballing the upgrade of the Skia Infra repo in favor of a minimal [7] change. In this case, we only had to tell the go.chromium.org/luci repo not to autogenerate .go files for .proto files because there are pre-existing ones. While building task drivers, there was a problem where some go deps were not being brought in and thus our transitive dependencies were failing to build. This is why tools.go was added (inspired by [8] to force those to be included. Python3 ======= This was a straightforward upgrade to Python 3.13. MODULE.bazel still reads requirements.txt to figure out what to download. The BUILD.bazel file we build for Dawn uses these requirements, but we didn't have to change how that worked at all. Other Notes =========== Renames ------- There are many mechanical changes (e.g. io_bazel_rules_go->rules_go) throughout as a result of bzlmod having different (non prefixed) package names in some cases. bazel/buildrc ------------- Sandboxing seems much faster in this new Bazel version on Mac. Thus I deleted the no_sandbox config. This change also updates the version of emsdk we use to compile CanvasKit. I had to squelch some warnings that they have via our config because I didn't see another way to override their toolchain settings. buildifier ---------- Updated the version used by Bazel to 8.0.3 I suggest folks also update their local version too, so presubmits work [9] Not working (yet) / disabled ============================ - karma_tests (JS tests for CanvasKit). This was based on long-deprecated rules and I didn't have the time to fix this. We still have GN based tests for CanvasKit, so this was low enough priority to skip for now - codesize_test. git_common.WithGitFinder was not working. As this is a test for our task_driver and has been stable for a while, it seemed like a low priority to fix. - bazel run //:gofmt. This moved with new go_rules and I couldn't find an easy replacement. - bazel run //:errcheck. This needs to shell out to golang and doesn't work on systems that don't have go installed because of the hermeticity. Not sure what to do about that. - clang_ios and clang_windows_amd64 toolchains. We don't have any CI jobs that use these atm, and they are lower priority for now. I made some changes based on other toolchains, but didn't test these. [1] https://bazel.build/external/migration [2] https://bazel.build/external/extension [3] https://registry.bazel.build/modules/libpng [4] https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html [5] https://github.com/bazel-contrib/bazel-gazelle/blob/master/extensions.md#go_deps [6] https://skia-review.googlesource.com/c/buildbot/+/988440/11/MODULE.bazel [7] http://review.skia.org/990801 [8] https://github.com/google/skia-buildbot/blob/b4a7f41e01ea288eadd197f9eee0b1a8a12c5aa4/tools.go [9] https://github.com/bazelbuild/buildtools/releases/tag/v8.0.3 Change-Id: I68be15c5c4a5d2b14359fa460075591dafab336a Bug: b/413044303 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/984976 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Dominik Röttsches <drott@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 1 年前 | |
Remove IWYU build logic from Bazel Follow-up from https://skia-review.googlesource.com/c/skia/+/896098/13/infra/bots/jobs.json#b17 Change-Id: I7f9d3860ba2cedebe55523dfdf1d80d4387f2d46 Bug: b/40044159 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1024156 Auto-Submit: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Eric Boren <borenet@google.com> Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 11 个月前 | |
Fix fontations, icu4x, and vello rust builds This copies deps out of //bazel/external/icu4x:Cargo.toml //bazel/external/fontations:Cargo.toml //bazel/external/vello:Cargo.toml I had tried to use the crates.from_cargo but found odd errors with it erroring on unrelated .toml files. It seems that on linux, the rust libraries now need libc++ dynamically linked in. I had to run sudo apt-get install libc++-dev locally to get the new link commands to work. Our CI machines already have that installed. Getting rust to compile on x64 macs required a few changes: - rules_rust doesn't generate configs for intel macs by default, so I had to modify the from_specs in MODULE.bazel to incorporate the "x86_64-apple-darwin" target - I had to register a "compile for x64 mac on arm64 mac" toolchain (and this allows us to clean up the BUILD.gn commands). While doing this, I cleaned up some toolchain names. - I had to change the mac toolchain trampoline because Bazel's #include detection did not work as expected with the absolute paths, particularly when Rust was shelling out to C++. Using relative paths seems to have remedied this. Change-Id: I35053561039231c8ebc1f2062ff3004700e6d977 Bug: b/417974542 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/993638 Reviewed-by: Eric Boren <borenet@google.com> Commit-Queue: Kaylee Lubick <kjlubick@google.com> | 1 年前 | |
Update Bazel to 8.2.1 and use bzlmod The update to bzlmod [1] changes how we handle third_party deps (dramatically) and how our toolchains work (minorly). To review and understand the changes, I suggest going language by language through the changes: C++ === We have Bazel check out git repositories listed in deps.bzl (like before), but this has been converted to a module_extension [2] which behaves basically the same. In MODULE.bazel, we load the extension and then specify all the dependencies that Skia directly depends on from there. If we can depend on versions from the Bazel registry [3], for example bazel_dep(name = "libpng", version = "1.6.47.bcr.1") we could remove the git repository versions and this might make things easier for external clients if there are version mismatches. A big change was required with how we customize our compilation of expat, FreeType, Harfbuzz, and ICU. Previously, we'd copied in (or cleverly referenced) files from the Skia repo in the third party copy of the code and this sort of worked. External clients had to use some helpers to load these configs and it was Fine (tm). This does not work with bzlmod's dependency graph. I tried several things to make this work cleanly and ran into road blocks with either RBE or external client usage (or both). See earlier patchsets for that, if interested. What *did* work (at least ok) was making a patch file per third party dep that needed it using tools/generate_patches.py to combine all those files and specify an output location. This has the downside of not being in sync, but I made the existing roll scripts for expat, FreeType, Harfbuzz shell out to the script to minimize that. Toolchains needed to be slightly updated to have a different path in the external/ output directory, which now includes some prefixing. To make this as robust as possible, I made the trampoline scripts use paths relative to where the script lives and use a glob to find the path no matter what the prefix is. Clang remains at 15.0.1 for Bazel builds. Rust ==== The rust toolchain has been updated to 1.86.0 (this was the primary impetus for this change). External crate dependences use crate_universe [4] and specify the versions we need directly in MODULE.bazel instead of using a toml file. I chose that approach because it seemed more direct when one wants to figure out what version our Bazel build uses. All crates except cxx worked "out of the box", meaning the rules_rust generated BUILD.bazel files for them in a way that just worked. I had to use crate.annotation to customize cxx to use bazel/external/cxx/BUILD.bazel.skia in addition to the generated rule so we can overwrite the include path. This was a bit fiddly and required me to spend a while looking through the bazel cache to experiment with what the output was. The only other major change is how we reference rust dependencies now. For example in src/ports/fontations/BUILD.bazel see that all rust dependencies are based out of @crates instead of all being top level dependencies. Again, poking into the bazel cache is helpful for figuring out what the generated target names are. Another upside of this update is the big long "splicing workspaces" seems to have gone away. Golang ====== The golang version is now 1.24.2. These were the most fiddly changes - particularly with some changes in the ecosystem related to protos. In MODULE.bazel, the go.mod file is read in to get both the go version and the direct golang dependencies. go_rules uses gazelle [5] to generate BUILD.bazel files for any deps if they don't have them. This includes generating BUILD.bazel files for proto files, which are a bit messy due to there being some conflicting ways to include these and thus resolve the deps. This [6] is why I ended up mothballing the upgrade of the Skia Infra repo in favor of a minimal [7] change. In this case, we only had to tell the go.chromium.org/luci repo not to autogenerate .go files for .proto files because there are pre-existing ones. While building task drivers, there was a problem where some go deps were not being brought in and thus our transitive dependencies were failing to build. This is why tools.go was added (inspired by [8] to force those to be included. Python3 ======= This was a straightforward upgrade to Python 3.13. MODULE.bazel still reads requirements.txt to figure out what to download. The BUILD.bazel file we build for Dawn uses these requirements, but we didn't have to change how that worked at all. Other Notes =========== Renames ------- There are many mechanical changes (e.g. io_bazel_rules_go->rules_go) throughout as a result of bzlmod having different (non prefixed) package names in some cases. bazel/buildrc ------------- Sandboxing seems much faster in this new Bazel version on Mac. Thus I deleted the no_sandbox config. This change also updates the version of emsdk we use to compile CanvasKit. I had to squelch some warnings that they have via our config because I didn't see another way to override their toolchain settings. buildifier ---------- Updated the version used by Bazel to 8.0.3 I suggest folks also update their local version too, so presubmits work [9] Not working (yet) / disabled ============================ - karma_tests (JS tests for CanvasKit). This was based on long-deprecated rules and I didn't have the time to fix this. We still have GN based tests for CanvasKit, so this was low enough priority to skip for now - codesize_test. git_common.WithGitFinder was not working. As this is a test for our task_driver and has been stable for a while, it seemed like a low priority to fix. - bazel run //:gofmt. This moved with new go_rules and I couldn't find an easy replacement. - bazel run //:errcheck. This needs to shell out to golang and doesn't work on systems that don't have go installed because of the hermeticity. Not sure what to do about that. - clang_ios and clang_windows_amd64 toolchains. We don't have any CI jobs that use these atm, and they are lower priority for now. I made some changes based on other toolchains, but didn't test these. [1] https://bazel.build/external/migration [2] https://bazel.build/external/extension [3] https://registry.bazel.build/modules/libpng [4] https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html [5] https://github.com/bazel-contrib/bazel-gazelle/blob/master/extensions.md#go_deps [6] https://skia-review.googlesource.com/c/buildbot/+/988440/11/MODULE.bazel [7] http://review.skia.org/990801 [8] https://github.com/google/skia-buildbot/blob/b4a7f41e01ea288eadd197f9eee0b1a8a12c5aa4/tools.go [9] https://github.com/bazelbuild/buildtools/releases/tag/v8.0.3 Change-Id: I68be15c5c4a5d2b14359fa460075591dafab336a Bug: b/413044303 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/984976 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Dominik Röttsches <drott@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 1 年前 | |
Remove IWYU build logic from Bazel Follow-up from https://skia-review.googlesource.com/c/skia/+/896098/13/infra/bots/jobs.json#b17 Change-Id: I7f9d3860ba2cedebe55523dfdf1d80d4387f2d46 Bug: b/40044159 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1024156 Auto-Submit: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Eric Boren <borenet@google.com> Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 11 个月前 | |
Update Bazel to 8.2.1 and use bzlmod The update to bzlmod [1] changes how we handle third_party deps (dramatically) and how our toolchains work (minorly). To review and understand the changes, I suggest going language by language through the changes: C++ === We have Bazel check out git repositories listed in deps.bzl (like before), but this has been converted to a module_extension [2] which behaves basically the same. In MODULE.bazel, we load the extension and then specify all the dependencies that Skia directly depends on from there. If we can depend on versions from the Bazel registry [3], for example bazel_dep(name = "libpng", version = "1.6.47.bcr.1") we could remove the git repository versions and this might make things easier for external clients if there are version mismatches. A big change was required with how we customize our compilation of expat, FreeType, Harfbuzz, and ICU. Previously, we'd copied in (or cleverly referenced) files from the Skia repo in the third party copy of the code and this sort of worked. External clients had to use some helpers to load these configs and it was Fine (tm). This does not work with bzlmod's dependency graph. I tried several things to make this work cleanly and ran into road blocks with either RBE or external client usage (or both). See earlier patchsets for that, if interested. What *did* work (at least ok) was making a patch file per third party dep that needed it using tools/generate_patches.py to combine all those files and specify an output location. This has the downside of not being in sync, but I made the existing roll scripts for expat, FreeType, Harfbuzz shell out to the script to minimize that. Toolchains needed to be slightly updated to have a different path in the external/ output directory, which now includes some prefixing. To make this as robust as possible, I made the trampoline scripts use paths relative to where the script lives and use a glob to find the path no matter what the prefix is. Clang remains at 15.0.1 for Bazel builds. Rust ==== The rust toolchain has been updated to 1.86.0 (this was the primary impetus for this change). External crate dependences use crate_universe [4] and specify the versions we need directly in MODULE.bazel instead of using a toml file. I chose that approach because it seemed more direct when one wants to figure out what version our Bazel build uses. All crates except cxx worked "out of the box", meaning the rules_rust generated BUILD.bazel files for them in a way that just worked. I had to use crate.annotation to customize cxx to use bazel/external/cxx/BUILD.bazel.skia in addition to the generated rule so we can overwrite the include path. This was a bit fiddly and required me to spend a while looking through the bazel cache to experiment with what the output was. The only other major change is how we reference rust dependencies now. For example in src/ports/fontations/BUILD.bazel see that all rust dependencies are based out of @crates instead of all being top level dependencies. Again, poking into the bazel cache is helpful for figuring out what the generated target names are. Another upside of this update is the big long "splicing workspaces" seems to have gone away. Golang ====== The golang version is now 1.24.2. These were the most fiddly changes - particularly with some changes in the ecosystem related to protos. In MODULE.bazel, the go.mod file is read in to get both the go version and the direct golang dependencies. go_rules uses gazelle [5] to generate BUILD.bazel files for any deps if they don't have them. This includes generating BUILD.bazel files for proto files, which are a bit messy due to there being some conflicting ways to include these and thus resolve the deps. This [6] is why I ended up mothballing the upgrade of the Skia Infra repo in favor of a minimal [7] change. In this case, we only had to tell the go.chromium.org/luci repo not to autogenerate .go files for .proto files because there are pre-existing ones. While building task drivers, there was a problem where some go deps were not being brought in and thus our transitive dependencies were failing to build. This is why tools.go was added (inspired by [8] to force those to be included. Python3 ======= This was a straightforward upgrade to Python 3.13. MODULE.bazel still reads requirements.txt to figure out what to download. The BUILD.bazel file we build for Dawn uses these requirements, but we didn't have to change how that worked at all. Other Notes =========== Renames ------- There are many mechanical changes (e.g. io_bazel_rules_go->rules_go) throughout as a result of bzlmod having different (non prefixed) package names in some cases. bazel/buildrc ------------- Sandboxing seems much faster in this new Bazel version on Mac. Thus I deleted the no_sandbox config. This change also updates the version of emsdk we use to compile CanvasKit. I had to squelch some warnings that they have via our config because I didn't see another way to override their toolchain settings. buildifier ---------- Updated the version used by Bazel to 8.0.3 I suggest folks also update their local version too, so presubmits work [9] Not working (yet) / disabled ============================ - karma_tests (JS tests for CanvasKit). This was based on long-deprecated rules and I didn't have the time to fix this. We still have GN based tests for CanvasKit, so this was low enough priority to skip for now - codesize_test. git_common.WithGitFinder was not working. As this is a test for our task_driver and has been stable for a while, it seemed like a low priority to fix. - bazel run //:gofmt. This moved with new go_rules and I couldn't find an easy replacement. - bazel run //:errcheck. This needs to shell out to golang and doesn't work on systems that don't have go installed because of the hermeticity. Not sure what to do about that. - clang_ios and clang_windows_amd64 toolchains. We don't have any CI jobs that use these atm, and they are lower priority for now. I made some changes based on other toolchains, but didn't test these. [1] https://bazel.build/external/migration [2] https://bazel.build/external/extension [3] https://registry.bazel.build/modules/libpng [4] https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html [5] https://github.com/bazel-contrib/bazel-gazelle/blob/master/extensions.md#go_deps [6] https://skia-review.googlesource.com/c/buildbot/+/988440/11/MODULE.bazel [7] http://review.skia.org/990801 [8] https://github.com/google/skia-buildbot/blob/b4a7f41e01ea288eadd197f9eee0b1a8a12c5aa4/tools.go [9] https://github.com/bazelbuild/buildtools/releases/tag/v8.0.3 Change-Id: I68be15c5c4a5d2b14359fa460075591dafab336a Bug: b/413044303 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/984976 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Dominik Röttsches <drott@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 1 年前 | |
Create Bazel Toolchain for running iOS builds - Get //tools/window building with the toolchain. Change-Id: I93a460bbae895ab90f28ddd06d81b6e2f640650a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/894496 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Ashwin Verleker <ashwinpv@google.com> | 1 年前 | |
Update clang and iwyu for Linux Update from clang from 15.0.1 to 18.1.8 and update iwyu to match. Change-Id: I98b9636bdb829dccd3f7478b480a0a1915015b9b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/896098 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Julia Lavrova <jlavrova@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 11 个月前 | |
[bzl] Enable layering_check for Mac frameworks generate_system_module_map.sh in our current Bazel version uses find $dir -type f ... If the starting $dir happens to be a symlink (and our Frameworks dir is), then find does not follow by default. Adding a trailing slash ensures that find recurses as expected. Change-Id: Ie9e019a7159fb048f17af3cfb265cef5b67ab9bb Reviewed-on: https://skia-review.googlesource.com/c/skia/+/939422 Commit-Queue: Florin Malita <fmalita@google.com> Reviewed-by: Kaylee Lubick <kjlubick@google.com> | 1 年前 | |
[cdn] Use cdn.skia.org instead of gs://skia-world-readable Bug: b/430275865 Change-Id: If799d8ca903f81cedd61f46e6a0d98f658269fe2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1020436 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Eric Boren <borenet@google.com> | 11 个月前 | |
Update Bazel to 8.2.1 and use bzlmod The update to bzlmod [1] changes how we handle third_party deps (dramatically) and how our toolchains work (minorly). To review and understand the changes, I suggest going language by language through the changes: C++ === We have Bazel check out git repositories listed in deps.bzl (like before), but this has been converted to a module_extension [2] which behaves basically the same. In MODULE.bazel, we load the extension and then specify all the dependencies that Skia directly depends on from there. If we can depend on versions from the Bazel registry [3], for example bazel_dep(name = "libpng", version = "1.6.47.bcr.1") we could remove the git repository versions and this might make things easier for external clients if there are version mismatches. A big change was required with how we customize our compilation of expat, FreeType, Harfbuzz, and ICU. Previously, we'd copied in (or cleverly referenced) files from the Skia repo in the third party copy of the code and this sort of worked. External clients had to use some helpers to load these configs and it was Fine (tm). This does not work with bzlmod's dependency graph. I tried several things to make this work cleanly and ran into road blocks with either RBE or external client usage (or both). See earlier patchsets for that, if interested. What *did* work (at least ok) was making a patch file per third party dep that needed it using tools/generate_patches.py to combine all those files and specify an output location. This has the downside of not being in sync, but I made the existing roll scripts for expat, FreeType, Harfbuzz shell out to the script to minimize that. Toolchains needed to be slightly updated to have a different path in the external/ output directory, which now includes some prefixing. To make this as robust as possible, I made the trampoline scripts use paths relative to where the script lives and use a glob to find the path no matter what the prefix is. Clang remains at 15.0.1 for Bazel builds. Rust ==== The rust toolchain has been updated to 1.86.0 (this was the primary impetus for this change). External crate dependences use crate_universe [4] and specify the versions we need directly in MODULE.bazel instead of using a toml file. I chose that approach because it seemed more direct when one wants to figure out what version our Bazel build uses. All crates except cxx worked "out of the box", meaning the rules_rust generated BUILD.bazel files for them in a way that just worked. I had to use crate.annotation to customize cxx to use bazel/external/cxx/BUILD.bazel.skia in addition to the generated rule so we can overwrite the include path. This was a bit fiddly and required me to spend a while looking through the bazel cache to experiment with what the output was. The only other major change is how we reference rust dependencies now. For example in src/ports/fontations/BUILD.bazel see that all rust dependencies are based out of @crates instead of all being top level dependencies. Again, poking into the bazel cache is helpful for figuring out what the generated target names are. Another upside of this update is the big long "splicing workspaces" seems to have gone away. Golang ====== The golang version is now 1.24.2. These were the most fiddly changes - particularly with some changes in the ecosystem related to protos. In MODULE.bazel, the go.mod file is read in to get both the go version and the direct golang dependencies. go_rules uses gazelle [5] to generate BUILD.bazel files for any deps if they don't have them. This includes generating BUILD.bazel files for proto files, which are a bit messy due to there being some conflicting ways to include these and thus resolve the deps. This [6] is why I ended up mothballing the upgrade of the Skia Infra repo in favor of a minimal [7] change. In this case, we only had to tell the go.chromium.org/luci repo not to autogenerate .go files for .proto files because there are pre-existing ones. While building task drivers, there was a problem where some go deps were not being brought in and thus our transitive dependencies were failing to build. This is why tools.go was added (inspired by [8] to force those to be included. Python3 ======= This was a straightforward upgrade to Python 3.13. MODULE.bazel still reads requirements.txt to figure out what to download. The BUILD.bazel file we build for Dawn uses these requirements, but we didn't have to change how that worked at all. Other Notes =========== Renames ------- There are many mechanical changes (e.g. io_bazel_rules_go->rules_go) throughout as a result of bzlmod having different (non prefixed) package names in some cases. bazel/buildrc ------------- Sandboxing seems much faster in this new Bazel version on Mac. Thus I deleted the no_sandbox config. This change also updates the version of emsdk we use to compile CanvasKit. I had to squelch some warnings that they have via our config because I didn't see another way to override their toolchain settings. buildifier ---------- Updated the version used by Bazel to 8.0.3 I suggest folks also update their local version too, so presubmits work [9] Not working (yet) / disabled ============================ - karma_tests (JS tests for CanvasKit). This was based on long-deprecated rules and I didn't have the time to fix this. We still have GN based tests for CanvasKit, so this was low enough priority to skip for now - codesize_test. git_common.WithGitFinder was not working. As this is a test for our task_driver and has been stable for a while, it seemed like a low priority to fix. - bazel run //:gofmt. This moved with new go_rules and I couldn't find an easy replacement. - bazel run //:errcheck. This needs to shell out to golang and doesn't work on systems that don't have go installed because of the hermeticity. Not sure what to do about that. - clang_ios and clang_windows_amd64 toolchains. We don't have any CI jobs that use these atm, and they are lower priority for now. I made some changes based on other toolchains, but didn't test these. [1] https://bazel.build/external/migration [2] https://bazel.build/external/extension [3] https://registry.bazel.build/modules/libpng [4] https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html [5] https://github.com/bazel-contrib/bazel-gazelle/blob/master/extensions.md#go_deps [6] https://skia-review.googlesource.com/c/buildbot/+/988440/11/MODULE.bazel [7] http://review.skia.org/990801 [8] https://github.com/google/skia-buildbot/blob/b4a7f41e01ea288eadd197f9eee0b1a8a12c5aa4/tools.go [9] https://github.com/bazelbuild/buildtools/releases/tag/v8.0.3 Change-Id: I68be15c5c4a5d2b14359fa460075591dafab336a Bug: b/413044303 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/984976 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Dominik Röttsches <drott@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 1 年前 | |
[bazel] Move win_toolchain download into download_windows_amd64_toolchain This organization is a bit cleaner and it gives us access to the file and execute functionalities of repository_ctx, which makes vars.bzl generation much cleaner. I also changed windows_toolchain_config to hard-code the MSVC and Windows SDK versions. Doing so allows us to avoid downloading the Clang toolchain for Windows and the win_toolchain CIPD package on other platforms. Bug: b/256860862 Change-Id: I5db85c15b856ac19a0bc5e760c30250634ddc58e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/898137 Commit-Queue: Eric Boren <borenet@google.com> Auto-Submit: Eric Boren <borenet@google.com> Reviewed-by: Kaylee Lubick <kjlubick@google.com> | 1 年前 | |
Build everything with c++20 And clean up configs such as skia_use_cpp20. Bug: 311238827, chromium:388070065 Change-Id: I8149243f3f051c2432a1910febe1462d6292a360 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1082056 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Victor Vianna <victorvianna@google.com> Auto-Submit: Victor Vianna <victorvianna@google.com> | 8 个月前 | |
Build everything with c++20 And clean up configs such as skia_use_cpp20. Bug: 311238827, chromium:388070065 Change-Id: I8149243f3f051c2432a1910febe1462d6292a360 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1082056 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Victor Vianna <victorvianna@google.com> Auto-Submit: Victor Vianna <victorvianna@google.com> | 8 个月前 | |
Build everything with c++20 And clean up configs such as skia_use_cpp20. Bug: 311238827, chromium:388070065 Change-Id: I8149243f3f051c2432a1910febe1462d6292a360 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1082056 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Victor Vianna <victorvianna@google.com> Auto-Submit: Victor Vianna <victorvianna@google.com> | 8 个月前 | |
[bazel] Add hermetic NDK C++ toolchain. This toolchain is copied almost verbatim from the SkCMS repository. See links at the top of each relevant file. I chose to modify the copied toolchain as little as possible in order to preserve the ability to perform diffs against the original toolchain in the SkCMS repository. In future CLs, I might modify this toolchain to look more like the Linux toolchain (e.g. //toolchain/ndk_linux_arm64_toolchain_config.bzl vs. //toolchain/linux_amd64_toolchain_config.bzl). Bug: skia:14227 Change-Id: I009241b81d336b8a24f1e05b972a2f0cf87cfe0c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/663620 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Leandro Lovisolo <lovisolo@google.com> | 3 年前 | |
Try using c++2a for old NDK Change-Id: I01eb86142b007c3d741c4d8627caa9462baa514c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1085216 Reviewed-by: Julia Lavrova <jlavrova@google.com> | 8 个月前 | |
[cdn] Use cdn.skia.org instead of gs://skia-world-readable Bug: b/430275865 Change-Id: If799d8ca903f81cedd61f46e6a0d98f658269fe2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1020436 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Eric Boren <borenet@google.com> | 11 个月前 | |
Build everything with c++20 And clean up configs such as skia_use_cpp20. Bug: 311238827, chromium:388070065 Change-Id: I8149243f3f051c2432a1910febe1462d6292a360 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1082056 Reviewed-by: Kaylee Lubick <kjlubick@google.com> Commit-Queue: Victor Vianna <victorvianna@google.com> Auto-Submit: Victor Vianna <victorvianna@google.com> | 8 个月前 |