Skip to content

Commit 7a47b77

Browse files
authored
feat: bzlmodify (#68)
1 parent 683b7a7 commit 7a47b77

File tree

14 files changed

+118
-73
lines changed

14 files changed

+118
-73
lines changed

.bazelrc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
build --enable_platform_specific_config
2-
build --incompatible_use_platforms_repo_for_constraints
3-
build --incompatible_enable_cc_toolchain_resolution
4-
build --incompatible_strict_action_env
5-
6-
build:windows --platforms=//bazel/platforms:windows
7-
8-
build:linux --platforms=//bazel/platforms:linux
9-
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
10-
11-
common:ci --announce_rc
12-
common:ci --disk_cache=~/.cache/bazel-disk-cache
1+
import %workspace%/bazel/common.bazelrc
132

143
try-import %workspace%/user.bazelrc

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.3.2
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is maintained by ecsact-dev/ecsact_common
2+
# If changes are required please make them there
3+
4+
name: bzlmod archive
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
bzlmod-archive:
12+
uses: ecsact-dev/bazel_registry/.github/workflows/bzlmod-archive.yml@main
13+
secrets: inherit
14+
permissions:
15+
contents: write

.github/workflows/main.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
1-
name: CI
1+
# This file is maintained by ecsact-dev/ecsact_common
2+
# If changes are required please make them there
3+
4+
name: main
25

36
on:
47
push:
58
branches:
69
- "**"
710

8-
concurrency:
9-
group: ${{ github.ref }}
10-
cancel-in-progress: true
11-
1211
jobs:
1312
formatting-check:
1413
name: Formatting Check
1514
runs-on: ubuntu-latest
1615
steps:
17-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1817
- uses: jidicula/clang-format-action@v4.9.0
19-
with: { clang-format-version: "15" }
18+
with: { clang-format-version: "16" }
19+
20+
test-windows:
21+
runs-on: windows-latest
22+
steps:
23+
- uses: actions/cache@v3
24+
with:
25+
path: |
26+
/Users/runneradmin/AppData/Local/bazelisk
27+
/Users/runneradmin/.cache/bazel-disk-cache
28+
key: ${{runner.os}}-bazel-cache
29+
- uses: actions/checkout@v4
30+
- run: bazelisk build --config=ci //...
31+
- if: ${{ hashfiles('test/MODULE.bazel') != '' }}
32+
run: bazelisk test --config=ci ...
33+
working-directory: test
34+
35+
test-linux:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/cache@v3
39+
with:
40+
path: |
41+
~/.cache/bazelisk
42+
~/.cache/bazel-disk-cache
43+
key: ${{runner.os}}-bazel-cache
44+
- uses: actions/checkout@v4
45+
- run: bazelisk build --config=ci //...
46+
- if: ${{ hashfiles('test/MODULE.bazel') != '' }}
47+
run: bazelisk test --config=ci ...
48+
working-directory: test

MODULE.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module(
2+
name = "ecsact_lang_csharp",
3+
version = "0.1.0",
4+
compatibility_level = 1,
5+
)
6+
7+
bazel_dep(name = "ecsact_runtime", version = "0.5.4")
8+
bazel_dep(name = "ecsact_codegen", version = "0.1.3")
9+
bazel_dep(name = "rules_cc", version = "0.0.9")
10+
bazel_dep(name = "ecsact_lang_cpp", version = "0.3.1")

WORKSPACE.bazel

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,6 @@ workspace(name = "ecsact_lang_csharp")
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

5-
http_archive(
6-
name = "ecsact_runtime",
7-
sha256 = "219ce161deeb4865d3c190eac300dd257671e2b2ca0ec8752091506ccfa554a2",
8-
strip_prefix = "ecsact_runtime-5cbf7257d7cbc42762d22e7604bc5bc0efb837fe",
9-
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/5cbf7257d7cbc42762d22e7604bc5bc0efb837fe.zip",
10-
)
11-
12-
http_archive(
13-
name = "boost",
14-
sha256 = "c41441a6e9f8038ad626e9f937ddc3675ab896b6c3512eefc6840037b3816d03",
15-
strip_prefix = "boost-563e8e0de4eac4b48a02d296581dc2454127608e",
16-
urls = ["https://github.com/bazelboost/boost/archive/563e8e0de4eac4b48a02d296581dc2454127608e.zip"],
17-
)
18-
19-
load("@boost//:index.bzl", "boost_http_archives")
20-
21-
boost_http_archives()
22-
23-
http_archive(
24-
name = "com_google_googletest",
25-
sha256 = "41c14a5a4887125fe329235f00c5f92660f245b91bb8dde7c59f9a2540fdec28",
26-
strip_prefix = "googletest-40412d85124f7c6f3d88454583c4633e5e10fc8c",
27-
url = "https://github.com/google/googletest/archive/40412d85124f7c6f3d88454583c4633e5e10fc8c.zip",
28-
)
29-
305
http_archive(
316
name = "hedron_compile_commands",
327
sha256 = "ed5aea1dc87856aa2029cb6940a51511557c5cac3dbbcb05a4abd989862c36b4",
@@ -53,9 +28,7 @@ load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
5328

5429
llvm_toolchain(
5530
name = "llvm_toolchain",
56-
cxx_standard = {"linux": "c++20"},
57-
distribution = "clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
58-
llvm_version = "15.0.6",
31+
llvm_version = "16.0.4",
5932
)
6033

6134
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")

bazel/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
config_setting(
2+
name = "compiler_emscripten",
3+
flag_values = {"@bazel_tools//tools/cpp:compiler": "emscripten"},
4+
)

bazel/common.bazelrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
startup --windows_enable_symlinks
2+
common --enable_bzlmod
3+
common --registry=https://raw.githubusercontent.com/ecsact-dev/bazel_registry/main
4+
common --registry=https://raw.githubusercontent.com/bazelboost/registry/main
5+
common --registry=https://bcr.bazel.build
6+
build --enable_platform_specific_config
7+
build --incompatible_use_platforms_repo_for_constraints
8+
build --incompatible_enable_cc_toolchain_resolution
9+
build --incompatible_strict_action_env
10+
build --enable_runfiles
11+
build --noincompatible_remove_rule_name_parameter
12+
query --noincompatible_remove_rule_name_parameter
13+
14+
# Temporary until https://github.com/grailbio/bazel-toolchain/pull/198 is merged
15+
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
16+
17+
common:ci --announce_rc
18+
common:ci --verbose_failures
19+
common:ci --keep_going
20+
common:ci --disk_cache=~/.cache/bazel-disk-cache

bazel/copts.bzl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
copts = select({
2-
"@bazel_tools//tools/cpp:msvc": ["/std:c++latest", "/Zc:preprocessor", "/permissive-"],
3-
"//conditions:default": ["-std=c++20"],
1+
load("@bazel_skylib//lib:selects.bzl", "selects")
2+
3+
# Ecsact repositories currently only support clang, cl, and emscripten
4+
copts = selects.with_or({
5+
(Label("//bazel:compiler_emscripten")): [
6+
"-std=c++20",
7+
],
8+
("@rules_cc//cc/compiler:clang"): [
9+
"-std=c++20",
10+
"-fexperimental-library",
11+
],
12+
("@rules_cc//cc/compiler:msvc-cl", "@rules_cc//cc/compiler:clang-cl"): [
13+
"/std:c++20",
14+
"/permissive-",
15+
"/Zc:preprocessor",
16+
],
417
})

bazel/platforms/BUILD.bazel

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)