Skip to content

Commit

Permalink
feat: bzlmodify
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Sep 18, 2023
1 parent 93a0d7c commit 7441ea1
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 148 deletions.
18 changes: 2 additions & 16 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
common --enable_bzlmod
build --enable_platform_specific_config
build --incompatible_use_platforms_repo_for_constraints
build --incompatible_enable_cc_toolchain_resolution
build --incompatible_strict_action_env
build --enable_runfiles
import %workspace%/bazel/common.bazelrc

build:windows --platforms=//bazel/platforms:windows
build:windows --host_platform=//bazel/platforms:windows
common [email protected]//:use_std_fs
build:windows --workspace_status_command=bazel/tools/wsc.cmd

build:linux --platforms=//bazel/platforms:linux
build:linux --host_platform=//bazel/platforms:linux
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
build:linux --workspace_status_command=bazel/tools/wsc.sh

common:ci --announce_rc
common:ci --disk_cache=~/.cache/bazel-disk-cache
build:ci -c opt

try-import %workspace%/user.bazelrc
21 changes: 14 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
module(name = "ecsact_cli")

bazel_dep(name = "nlohmann_json", version = "3.11.2")
bazel_dep(name = "rules_cc", version = "0.0.8")
bazel_dep(name = "platforms", version = "0.0.7")
bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "bazel_skylib", version = "1.4.2")
module(name = "ecsact_cli")

bazel_dep(name = "nlohmann_json", version = "3.11.2")
bazel_dep(name = "rules_cc", version = "0.0.8")
bazel_dep(name = "platforms", version = "0.0.7")
bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "ecsact_parse", version = "0.3.0")
bazel_dep(name = "ecsact_runtime", version = "0.5.0")
bazel_dep(name = "ecsact_interpret", version = "0.5.0")
bazel_dep(name = "ecsact_codegen", version = "0.1.1")
bazel_dep(name = "boost.dll", version = "1.83.0.bzl.2")
bazel_dep(name = "magic_enum", version = "0.9.3")
bazel_dep(name = "docopt.cpp", version = "0.6.2")
145 changes: 50 additions & 95 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -1,95 +1,50 @@
workspace(name = "ecsact_cli")

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

http_archive(
name = "bazelregistry_docopt_cpp",
sha256 = "a06e705978b1c09427f130a187cb361916c1e7d66b69e91b865ebcd5390a6774",
strip_prefix = "docopt.cpp-1e38ceb67655f576814ae1c95f138eb8b61453c9",
url = "https://github.com/bazelregistry/docopt.cpp/archive/1e38ceb67655f576814ae1c95f138eb8b61453c9.zip",
)

http_archive(
name = "boost",
sha256 = "4a79c389add7e3d54d0e12c83098d471d24536ba2d6b8593d3a95f151f25eebb",
strip_prefix = "boost-da62319c330d81ef032517cbe13b6f35d97387cb",
urls = ["https://github.com/bazelboost/boost/archive/da62319c330d81ef032517cbe13b6f35d97387cb.zip"],
)

load("@boost//:index.bzl", "boost_http_archives")

boost_http_archives()

http_archive(
name = "rules_cc_stamp",
strip_prefix = "rules_cc_stamp-63d4861f4d420b574fa0f112599aae2b8aee785e",
urls = ["https://github.com/zaucy/rules_cc_stamp/archive/63d4861f4d420b574fa0f112599aae2b8aee785e.zip"],
sha256 = "f469a3b97eeabeb850c655f59ea17799ff40badd3a0b3e9de38534c89ad2f87d",
)

http_archive(
name = "ecsact_si_wasm",
sha256 = "e208a94d4f4a9c09f32b8a9ea91a4f799492e11c7c852b0329b4a3595a45cee6",
strip_prefix = "ecsact_si_wasm-0.1.0",
urls = ["https://github.com/seaube/ecsact_si_wasm/archive/refs/tags/0.1.0.tar.gz"],
)

http_archive(
name = "ecsact_parse",
sha256 = "706066e8870aa07f6937ca5f3187c7f3bb970255d028790b5f441e24e22d37f6",
strip_prefix = "ecsact_parse-0.2.1",
urls = ["https://github.com/ecsact-dev/ecsact_parse/archive/refs/tags/0.2.1.tar.gz"],
)

http_archive(
name = "ecsact_runtime",
sha256 = "35b03aaef0925fda5b5aefb2d6a6e2c9593f31d6414ab157091f9ca26a992da3",
strip_prefix = "ecsact_runtime-0.3.0",
urls = ["https://github.com/ecsact-dev/ecsact_runtime/archive/refs/tags/0.3.0.tar.gz"],
)

http_archive(
name = "ecsact_interpret",
sha256 = "27c42403d6dc9a435346ca94ac6cd385246c22caa2388e1283ca1dbb679167e1",
strip_prefix = "ecsact_interpret-0.3.0",
urls = ["https://github.com/ecsact-dev/ecsact_interpret/archive/refs/tags/0.3.0.tar.gz"],
)

load("@ecsact_parse//:repositories.bzl", "ecsact_parse_dependencies")

ecsact_parse_dependencies()

http_archive(
name = "hedron_compile_commands",
sha256 = "ed5aea1dc87856aa2029cb6940a51511557c5cac3dbbcb05a4abd989862c36b4",
strip_prefix = "bazel-compile-commands-extractor-e16062717d9b098c3c2ac95717d2b3e661c50608",
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/e16062717d9b098c3c2ac95717d2b3e661c50608.tar.gz",
)

load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")

hedron_compile_commands_setup()

http_archive(
name = "com_grail_bazel_toolchain",
sha256 = "4ea958dc114d3e02df2dd7864ce4b67b5151f863a0a81d8e66f481c23d94b6f7",
strip_prefix = "bazel-toolchain-edc058a175b93d38db312549b7d93a9a683aa748",
url = "https://github.com/grailbio/bazel-toolchain/archive/edc058a175b93d38db312549b7d93a9a683aa748.zip",
)

load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")

bazel_toolchain_dependencies()

load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")

llvm_toolchain(
name = "llvm_toolchain",
cxx_standard = {"linux": "c++20"},
distribution = "clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
llvm_version = "15.0.6",
)

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

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

http_archive(
name = "rules_cc_stamp",
strip_prefix = "rules_cc_stamp-63d4861f4d420b574fa0f112599aae2b8aee785e",
urls = ["https://github.com/zaucy/rules_cc_stamp/archive/63d4861f4d420b574fa0f112599aae2b8aee785e.zip"],
sha256 = "f469a3b97eeabeb850c655f59ea17799ff40badd3a0b3e9de38534c89ad2f87d",
)

http_archive(
name = "ecsact_si_wasm",
sha256 = "e208a94d4f4a9c09f32b8a9ea91a4f799492e11c7c852b0329b4a3595a45cee6",
strip_prefix = "ecsact_si_wasm-0.1.0",
urls = ["https://github.com/seaube/ecsact_si_wasm/archive/refs/tags/0.1.0.tar.gz"],
)

http_archive(
name = "hedron_compile_commands",
sha256 = "ed5aea1dc87856aa2029cb6940a51511557c5cac3dbbcb05a4abd989862c36b4",
strip_prefix = "bazel-compile-commands-extractor-e16062717d9b098c3c2ac95717d2b3e661c50608",
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/e16062717d9b098c3c2ac95717d2b3e661c50608.tar.gz",
)

load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")

hedron_compile_commands_setup()

http_archive(
name = "com_grail_bazel_toolchain",
sha256 = "4ea958dc114d3e02df2dd7864ce4b67b5151f863a0a81d8e66f481c23d94b6f7",
strip_prefix = "bazel-toolchain-edc058a175b93d38db312549b7d93a9a683aa748",
url = "https://github.com/grailbio/bazel-toolchain/archive/edc058a175b93d38db312549b7d93a9a683aa748.zip",
)

load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")

bazel_toolchain_dependencies()

load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")

llvm_toolchain(
name = "llvm_toolchain",
cxx_standard = {"linux": "c++20"},
distribution = "clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
llvm_version = "15.0.6",
)

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

llvm_register_toolchains()
19 changes: 0 additions & 19 deletions bazel/platforms/BUILD.bazel

This file was deleted.

14 changes: 7 additions & 7 deletions commands/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ cc_library(
":command",
"//executable_path",
"@magic_enum",
"@bazelregistry_docopt_cpp//:docopt",
"@boost//libs/dll",
"@docopt.cpp//:docopt",
"@boost.dll",
"@ecsact_runtime//:core",
"@ecsact_runtime//:async",
"@ecsact_runtime//:serialize",
Expand All @@ -37,11 +37,11 @@ cc_library(
":command",
"//executable_path",
"@magic_enum",
"@bazelregistry_docopt_cpp//:docopt",
"@boost//libs/dll",
"@docopt.cpp//:docopt",
"@boost.dll",
"@ecsact_interpret",
"@ecsact_runtime//:codegen_plugin",
"@ecsact_runtime//:codegen_plugin_validate",
"@ecsact_codegen//:plugin",
"@ecsact_codegen//:plugin_validate",
"@ecsact_runtime//:dylib",
"@ecsact_runtime//:meta",
],
Expand All @@ -55,7 +55,7 @@ cc_library(
deps = [
":command",
"//executable_path",
"@bazelregistry_docopt_cpp//:docopt",
"@docopt.cpp//:docopt",
"@nlohmann_json//:json",
],
)
2 changes: 1 addition & 1 deletion commands/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ int ecsact::cli::detail::benchmark_command(int argc, char* argv[]) {
);
auto reporter = stdout_json_benchmark_reporter{};

auto ec = boost::system::error_code{};
auto ec = std::error_code{};
auto runtime = boost::dll::shared_library();

exists_or_exit(runtime_path);
Expand Down
6 changes: 3 additions & 3 deletions commands/codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "ecsact/interpret/eval.hh"
#include "ecsact/runtime/meta.h"
#include "ecsact/runtime/dylib.h"
#include "ecsact/codegen_plugin.h"
#include "ecsact/codegen/plugin.h"
#include "ecsact/codegen/plugin_validate.hh"
#include "magic_enum.hpp"

Expand Down Expand Up @@ -135,8 +135,8 @@ int ecsact::cli::detail::codegen_command(int argc, char* argv[]) {
);

if(plugin_path) {
boost::system::error_code ec;
auto& plugin = plugins.emplace_back();
std::error_code ec;
auto& plugin = plugins.emplace_back();
plugin.load(plugin_path->string(), ec);
auto validate_result = ecsact::codegen::plugin_validate(*plugin_path);
if(validate_result.ok()) {
Expand Down

0 comments on commit 7441ea1

Please sign in to comment.