Skip to content

Commit

Permalink
🎨 Initialize move to new infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmondal committed Nov 3, 2022
1 parent 0c90c3d commit 6160ad1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 173 deletions.
21 changes: 6 additions & 15 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
# Upstream LLVM/Clang requires C++17. This will only configure rules_cc.
build --repo_env=BAZEL_CXXOPTS='-std=c++17:-O3'
run --repo_env=BAZEL_CXXOPTS='-std=c++17:-O3'
common --repo_env=BAZEL_CXXOPTS='-std=c++17:-O3'

# Separate the toolchain from regular code. This will put execution artifacts
# into bazel-out/ll_linux_exec_platform-opt-exec-<hash>.
build --experimental_platform_in_output_dir
run --experimental_platform_in_output_dir
common --experimental_platform_in_output_dir

# We require bzlmod.
build --experimental_enable_bzlmod
run --experimental_enable_bzlmod
common --experimental_enable_bzlmod

# We use a custom registry.
build --registry=https://raw.githubusercontent.com/eomii/bazel-eomii-registry/main/
run --registry=https://raw.githubusercontent.com/eomii/bazel-eomii-registry/main/
common --registry=https://raw.githubusercontent.com/eomii/bazel-eoii-registry/llvm-project-overlay/

# Hash diff (baseline config, transition config) in bazel-out directory names.
build --experimental_output_directory_naming_scheme=diff_against_baseline
run --experimental_output_directory_naming_scheme=diff_against_baseline

# Exec configuration handled by experimental_output_directory_layout.
build --experimental_exec_configuration_distinguisher=off
run --experimental_exec_configuration_distinguisher=off
# We need temporarily unresolved symlinks for CUDA.
common --experimental_allow_unresolved_symlinks
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0-pre.20220909.2
5.3.2
27 changes: 17 additions & 10 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module(
name = "rules_ll",
version = "20220905.0",
version = "20221103.0",
execution_platforms_to_register = [
"@rules_ll//ll:ll_linux_exec_platform",
],
compatibility_level = 0,
toolchains_to_register = [
"@rules_ll//ll:ll_toolchain",
],
)

register_toolchains("@rules_ll//ll:ll_toolchain")

# Platform support.
bazel_dep(name = "platforms", version = "0.0.4")

Expand All @@ -19,25 +18,33 @@ bazel_dep(name = "bazel_skylib", version = "1.2.0")
# Documentation.
bazel_dep(name = "stardoc", version = "0.5.0")

# Required by the original Clang/LLVM overlay.
bazel_dep(name = "rules_cc", version = "0.0.1")

# hipSYCL. In development.
# bazel_dep(name = "hipsycl", version = "0.9.2")
# bazel_dep(name = "hipsycl", version = "0.9.3")

# Build Clang/LLVM with zlib support.
bazel_dep(name = "zlib", version = "1.2.12")
bazel_dep(name = "zlib", version = "1.2.13")

bazel_dep(name = "llvm-project-overlay", version = "16.0.0-bcr.0")

# Configure the llvm-project Bazel overlay.
llvm_project_overlay = use_extension(
"@rules_ll//ll:extensions.bzl",
"@llvm-project-overlay//utils/bazel:extensions.bzl",
"llvm_project_overlay",
)
llvm_project_overlay.configure(
commit = "539fa1df4634dad7d99e4485e4fc3a82ff1a5481",
sha256 = "68d36e2cc6c217e4f2e5e5a4c8d82598d194f09b4a1ea60690f671bdedac4983",
targets = ["AMDGPU", "NVPTX", "X86"],
patches = [
"@rules_ll//patches:back_inserter_patch.diff",
"@rules_ll//patches:synth_three_way_patch.diff",
"@rules_ll//patches:compiler-rt_float128_patch.diff",
"@rules_ll//patches:mallinfo2_patch.diff",
"@rules_ll//patches:rules_ll_compatibility_patch.diff",
"@rules_ll//patches:rules_ll_overlay_patch.diff",
],
)

use_repo(
llvm_project_overlay,
"llvm-project",
Expand Down
27 changes: 7 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
☢️ WARNING: We are currently changing the infrastructure behind `rules_ll`.☢️

☢️The repo and all previous releases will be unusable until this warning is removed.☢️

An Upstream LLVM/Clang Toolchain for Bazel
------------------------------------------

Expand Down Expand Up @@ -79,36 +75,27 @@ workspace:
touch WORKSPACE.bazel .bazelrc
echo 6.0.0-pre.20220909.2 > .bazelversion
echo 'bazel_dep(name="rules_ll", version="20220905.0")' > MODULE.bazel
echo 'bazel_dep(name="rules_ll", version="20221103.0")' > MODULE.bazel
Copy the following lines into the just created ``.bazelrc`` file:

.. code:: bash
# Upstream LLVM/Clang requires C++17. This will only configure rules_cc.
build --repo_env=BAZEL_CXXOPTS='-std=c++17'
run --repo_env=BAZEL_CXXOPTS='-std=c++17'
common --repo_env=BAZEL_CXXOPTS='-std=c++17:-O3'
# Separate the toolchain from regular code. This will put execution artifacts
# into bazel-out/ll_linux_exec_platform-opt-exec-<hash>.
build --experimental_platform_in_output_dir
run --experimental_platform_in_output_dir
common --experimental_platform_in_output_dir
# We require bzlmod.
build --experimental_enable_bzlmod
run --experimental_enable_bzlmod
common --experimental_enable_bzlmod
# We use a custom registry.
build --registry=https://raw.githubusercontent.com/eomii/bazel-eomii-registry/main/
run --registry=https://raw.githubusercontent.com/eomii/bazel-eomii-registry/main/
# Hash diff (baseline config, transition config) in bazel-out directory names.
build --experimental_output_directory_naming_scheme=diff_against_baseline
run --experimental_output_directory_naming_scheme=diff_against_baseline
common --registry=https://raw.githubusercontent.com/eomii/bazel-eomii-registry/rules_ll/
# Exec configuration handled by experimental_output_directory_layout.
build --experimental_exec_configuration_distinguisher=off
run --experimental_exec_configuration_distinguisher=off
# We need temporarily unresolved symlinks for CUDA.
common --experimental_allow_unresolved_symlinks
You can now load the ``ll_library`` and ``ll_binary`` rule definitions in your
``BUILD.bazel`` files via
Expand Down
127 changes: 0 additions & 127 deletions ll/extensions.bzl

This file was deleted.

0 comments on commit 6160ad1

Please sign in to comment.