From 02593b9243e398b51ac71fa79237adcdbb72f300 Mon Sep 17 00:00:00 2001 From: jheaff1 Date: Mon, 20 Feb 2023 09:23:49 +0000 Subject: [PATCH] wip --- .github/workflows/ci.bazelrc | 3 +++ NOTES | 7 ++++++- e2e/workspace/WORKSPACE | 6 ++++++ qt/repositories3.bzl | 2 +- qt/repositories4.bzl | 2 +- third_party/llvm/BUILD.llvm.bazel | 4 ++-- third_party/mesa/BUILD.mesa.bazel | 2 +- third_party/qt/BUILD.qt.bazel | 1 + 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc index a21ece4..28cedd1 100644 --- a/.github/workflows/ci.bazelrc +++ b/.github/workflows/ci.bazelrc @@ -11,3 +11,6 @@ build --repository_cache=~/.cache/bazel-repo test --test_output=errors # Allows tests to run bazelisk-in-bazel, since this is the cache folder used test --test_env=XDG_CACHE_HOME + +build --incompatible_strict_action_env +test --incompatible_strict_action_env diff --git a/NOTES b/NOTES index 181c1be..5cee234 100644 --- a/NOTES +++ b/NOTES @@ -5,4 +5,9 @@ have requirements.txt in rules_qt repo, not e2e, and call the pip repo rules_qt_ replacement of "-config" files breaks llvm-config, see https://github.com/bazelbuild/rules_foreign_cc/pull/109. commit bf2cb01 llvm-config --ldflags will refer to an old sandbox. This was solved for libpng and freetype by replacing the -config file, but they were ascii scripts, not executables! could use it if no-sandbox for llvm build, but try mesa without llvm-config -could try to change replace_in_files to only do so if "file " result contains "ascii" \ No newline at end of file +could try to change replace_in_files to only do so if "file " result contains "ascii" + +Add the following to Bazel rc and use Bazel 6.0 to see if it prevents llvm being built twice - https://github.com/bazelbuild/bazel/issues/14023#issuecomment-1325718022 + +See if qt cmake variable can be set to not build the docs and therefore not require llvm + diff --git a/e2e/workspace/WORKSPACE b/e2e/workspace/WORKSPACE index fe19ecb..ac777b9 100644 --- a/e2e/workspace/WORKSPACE +++ b/e2e/workspace/WORKSPACE @@ -4,6 +4,12 @@ local_repository( path = "../..", ) +# (copied from https://github.com/tensorflow/tensorflow/blob/58e320bee974240b4193ffe7da7bc1cc1c43a551/WORKSPACE#L5) +# The cascade of load() statements and rules_qt_dependencies?() calls works around the +# restriction that load() statements need to be at the top of .bzl files. +# E.g. we can not retrieve a new repository with http_archive and then load() +# a macro from that repository in the same file. + load("@rules_qt//qt:repositories.bzl", "rules_qt_dependencies") rules_qt_dependencies(qt_version = "6.2.4") diff --git a/qt/repositories3.bzl b/qt/repositories3.bzl index 522381b..5597f6e 100644 --- a/qt/repositories3.bzl +++ b/qt/repositories3.bzl @@ -11,7 +11,7 @@ def rules_qt_dependencies3(): ) pip_parse( - name = "pip", + name = "rules_qt_pip", python_interpreter_target = py3_interpreter, requirements_lock = "//:requirements_lock.txt", ) diff --git a/qt/repositories4.bzl b/qt/repositories4.bzl index 7c7089a..43d2b7d 100644 --- a/qt/repositories4.bzl +++ b/qt/repositories4.bzl @@ -1,6 +1,6 @@ """Run dependency workspace macros""" -load("@pip//:requirements.bzl", "install_deps") +load("@rules_qt_pip//:requirements.bzl", "install_deps") def rules_qt_dependencies4(): install_deps() diff --git a/third_party/llvm/BUILD.llvm.bazel b/third_party/llvm/BUILD.llvm.bazel index 9983b76..ef5bac2 100644 --- a/third_party/llvm/BUILD.llvm.bazel +++ b/third_party/llvm/BUILD.llvm.bazel @@ -60,8 +60,8 @@ cmake( # "llvm-config", ], # TODO remove - build_args=["-j4"], - tags = ["no-sandbox"], + build_args=["-j6"], + # tags = ["no-sandbox"], out_data_dirs = ["lib"], # required as clang-tidy needs the lib folder, which contains system includes like stddef.h targets = [ # "install-clang-format-stripped", diff --git a/third_party/mesa/BUILD.mesa.bazel b/third_party/mesa/BUILD.mesa.bazel index 3497441..c993c3f 100644 --- a/third_party/mesa/BUILD.mesa.bazel +++ b/third_party/mesa/BUILD.mesa.bazel @@ -1,4 +1,4 @@ -load("@pip//:requirements.bzl", "requirement") +load("@rules_qt_pip//:requirements.bzl", "requirement") load("@rules_foreign_cc//foreign_cc:defs.bzl", "meson_with_requirements") filegroup( diff --git a/third_party/qt/BUILD.qt.bazel b/third_party/qt/BUILD.qt.bazel index db625b4..e379717 100644 --- a/third_party/qt/BUILD.qt.bazel +++ b/third_party/qt/BUILD.qt.bazel @@ -296,6 +296,7 @@ cmake( "@nodejs_toolchains//:resolved_toolchain" ], deps = [ + # TODO this caused llvm rebuild even after building llvm for mesa. probably because meson_with_requirements transition affects deps. See if i can change it to be an incoming transition, not outgoing "@llvm", "@mesa", "@openssl",