diff --git a/.bazelrc b/.bazelrc index 17f5b92..c776090 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,10 +1,10 @@ startup --windows_enable_symlinks common --enable_bzlmod common --registry=https://raw.githubusercontent.com/ecsact-dev/bazel_registry/main +common --registry=https://raw.githubusercontent.com/zaucy/bazel-central-registry/add-curl-config2 # temporary common --registry=https://raw.githubusercontent.com/bazelboost/registry/main common --registry=https://bcr.bazel.build 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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7bb8325..69a373e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | ~/.cache/bazelisk @@ -33,7 +33,7 @@ jobs: steps: - name: bazel visual studio 17.6 workaround # https://github.com/bazelbuild/bazel/issues/18592 run: Remove-Item -Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\vcpkg" -Force -Recurse - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | /Users/runneradmin/AppData/Local/bazelisk @@ -44,7 +44,7 @@ jobs: check-dist: runs-on: ubuntu-latest steps: - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | ~/.cache/bazelisk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd499cb..21155e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: release-draft: runs-on: ubuntu-latest steps: - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 common-dist: runs-on: ubuntu-latest @@ -30,7 +30,7 @@ jobs: - run: rm -rf dist/bin/ecsact_rtb.runfiles/boost_mp11_files/meta - run: rm -rf dist/bin/ecsact_rtb.runfiles/boost_mp11_files/tools - run: rm -rf dist/bin/ecsact_rtb.runfiles/boost_mp11_files/test - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: common-dist path: dist @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - run: bazel run --config=ci //:copy_dist_bin - run: bazel run --config=ci //:copy_dist_codegen_plugins - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: windows-x64-binaries path: dist @@ -64,7 +64,7 @@ jobs: - uses: actions/checkout@v4 - run: bazel run --config=ci //:copy_dist_bin - run: bazel run --config=ci //:copy_dist_codegen_plugins - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: linux-x64-binaries path: dist @@ -75,16 +75,16 @@ jobs: - common-dist - linux-x64-binaries steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: common-dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: linux-x64-binaries # https://github.com/actions/upload-artifact#permission-loss - run: chmod +x bin/ecsact bin/ecsact_rtb bin/ecsact_lsp_server - run: tar -czf ecsact_sdk_${{github.ref_name}}_linux_x64.tar.gz bin include share - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: linux-x64-archive path: ecsact_sdk_${{github.ref_name}}_linux_x64.tar.gz @@ -96,17 +96,17 @@ jobs: - linux-x64-binaries steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: common-dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: linux-x64-binaries # https://github.com/actions/upload-artifact#permission-loss - run: chmod +x bin/ecsact bin/ecsact_rtb bin/ecsact_lsp_server - shell: pwsh run: ./CreateDeb.ps1 -Version ${{github.ref_name}} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: amd64-deb-package path: ecsact_sdk_${{github.ref_name}}_amd64.deb @@ -117,16 +117,16 @@ jobs: - common-dist - windows-x64-binaries steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: common-dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: windows-x64-binaries - run: > mv bin/ecsact_rtb.runfiles bin/ecsact_rtb.exe.runfiles && zip -r ecsact_sdk_${{github.ref_name}}_windows_x64.zip bin include share - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: windows-x64-archive path: ecsact_sdk_${{github.ref_name}}_windows_x64.zip @@ -137,10 +137,10 @@ jobs: - release-draft - linux-x64-archive steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: linux-x64-archive - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 with: fail_on_unmatched_files: true files: ecsact_sdk_${{github.ref_name}}_linux_x64.tar.gz @@ -151,10 +151,10 @@ jobs: - release-draft - amd64-deb-package steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: amd64-deb-package - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 with: fail_on_unmatched_files: true files: ecsact_sdk_${{github.ref_name}}_amd64.deb @@ -165,10 +165,10 @@ jobs: - release-draft - windows-x64-archive steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: windows-x64-archive - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 with: fail_on_unmatched_files: true files: ecsact_sdk_${{github.ref_name}}_windows_x64.zip @@ -180,7 +180,7 @@ jobs: - release-upload-linux-x64-archive - release-upload-amd64-deb-package steps: - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 with: name: ${{github.ref_name}} generate_release_notes: true diff --git a/.gitignore b/.gitignore index 042de61..546a4d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # bazel /bazel-* /user.bazelrc +*.bazel.lock # https://github.com/hedronvision/bazel-compile-commands-extractor /compile_commands.json diff --git a/BUILD.bazel b/BUILD.bazel index c9633c5..2f56f87 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,6 +1,4 @@ -load(":pkg.bzl", "pkg_executable") -load("@rules_pkg//pkg:tar.bzl", "pkg_tar") -load("@bzlws//:index.bzl", "bzlws_copy", "bzlws_extract") +load("@bzlws//:index.bzl", "bzlws_copy") bzlws_copy( name = "copy_dist_bin", @@ -36,13 +34,12 @@ bzlws_copy( # keep sorted _plugins = [ - "@ecsact_lang_cpp//cpp_header_codegen:ecsact_cpp_header_codegen_bin", - "@ecsact_lang_cpp//cpp_meta_header_codegen:ecsact_cpp_meta_header_codegen_bin", - "@ecsact_lang_cpp//cpp_systems_header_codegen:ecsact_cpp_systems_header_codegen_bin", - "@ecsact_lang_cpp//cpp_systems_source_codegen:ecsact_cpp_systems_source_codegen_bin", - "@ecsact_lang_cpp//systems_header_codegen:ecsact_systems_header_codegen_bin", - "@ecsact_lang_csharp//csharp_codegen:ecsact_csharp_codegen_bin", - "@ecsact_lang_json//json_codegen:ecsact_json_codegen_bin", + "@ecsact_lang_cpp//cpp_header_codegen:ecsact_cpp_header_codegen", + "@ecsact_lang_cpp//cpp_systems_header_codegen:ecsact_cpp_systems_header_codegen", + "@ecsact_lang_cpp//cpp_systems_source_codegen:ecsact_cpp_systems_source_codegen", + "@ecsact_lang_cpp//systems_header_codegen:ecsact_systems_header_codegen", + "@ecsact_lang_csharp//csharp_codegen:ecsact_csharp_codegen", + "@ecsact_lang_json//json_codegen:ecsact_json_codegen", ] bzlws_copy( @@ -52,6 +49,15 @@ bzlws_copy( "@platforms//os:linux": _plugins + ["@ecsact_rust_codegen_linux//file"], "//conditions:default": _plugins, }), - out = "dist/share/ecsact/plugins/{BAZEL_LABEL_NAME}[:-4].{EXTNAME}", + out = "dist/share/ecsact/plugins/{BAZEL_LABEL_NAME}.{EXTNAME}", + force = True, +) + +bzlws_copy( + name = "copy_dist_recipe_bundles", + srcs = [ + "@ecsact_rt_entt", + ], + out = "dist/share/ecsact/recipes/{FILENAME}", force = True, ) diff --git a/CopyDist.ps1 b/CopyDist.ps1 index c4452b3..b8a06fe 100755 --- a/CopyDist.ps1 +++ b/CopyDist.ps1 @@ -8,3 +8,4 @@ bazel run --ui_event_filters=-info --noshow_progress //:copy_dist_include bazel run --ui_event_filters=-info --noshow_progress //:copy_dist_images bazel run --ui_event_filters=-info --noshow_progress //:copy_dist_bin bazel run --ui_event_filters=-info --noshow_progress //:copy_dist_codegen_plugins +bazel run --ui_event_filters=-info --noshow_progress //:copy_dist_recipe_bundles diff --git a/MODULE.bazel b/MODULE.bazel index b3eaa8b..b857b58 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,35 +1,50 @@ module(name = "ecsact_sdk") bazel_dep(name = "rules_cc", version = "0.0.9") -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_si_wasm", version = "0.1.1") -bazel_dep(name = "rules_ecsact", version = "0.4.5") -bazel_dep(name = "ecsact_rt_entt", version = "0.2.2") -bazel_dep(name = "ecsact_codegen", version = "0.1.3") -bazel_dep(name = "ecsact_parse", version = "0.3.3") -bazel_dep(name = "ecsact_runtime", version = "0.5.4") -bazel_dep(name = "ecsact_interpret", version = "0.5.3") -bazel_dep(name = "ecsact_lang_cpp", version = "0.3.1") -bazel_dep(name = "ecsact_cli", version = "0.2.3") -bazel_dep(name = "ecsact_lsp_server", version = "0.2.0") -bazel_dep(name = "ecsact_lang_json", version = "0.1.2") -bazel_dep(name = "ecsact_lang_csharp", version = "0.1.2") +bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "rules_pkg", version = "0.10.1") +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "ecsact_si_wasm", version = "0.1.2") +bazel_dep(name = "rules_ecsact", version = "0.5.3") +bazel_dep(name = "ecsact_rt_entt", version = "0.3.3") +bazel_dep(name = "ecsact_codegen", version = "0.3.1") +bazel_dep(name = "ecsact_parse", version = "0.5.1") +bazel_dep(name = "ecsact_runtime", version = "0.6.7") +bazel_dep(name = "ecsact_interpret", version = "0.6.4") +bazel_dep(name = "ecsact_lang_cpp", version = "0.4.5") +bazel_dep(name = "ecsact_cli", version = "0.3.13") +bazel_dep(name = "ecsact_lsp_server", version = "0.2.1") +bazel_dep(name = "ecsact_lang_json", version = "0.1.4") +bazel_dep(name = "ecsact_lang_csharp", version = "0.1.4") +bazel_dep(name = "yaml-cpp", version = "0.8.0") bazel_dep(name = "boost.dll", version = "1.83.0.bzl.2") bazel_dep(name = "boost.process", version = "1.83.0.bzl.2") -# https://github.com/jbeder/yaml-cpp/issues/1229 -bazel_dep(name = "yaml-cpp") +bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True) +bazel_dep(name = "hedron_compile_commands", dev_dependency = True) git_override( - module_name = "yaml-cpp", - commit = "37f1b8b8c9e5172ff3a79a3d5fdbb87f2994842b", - remote = "https://github.com/jbeder/yaml-cpp", + module_name = "hedron_compile_commands", + commit = "204aa593e002cbd177d30f11f54cff3559110bb9", + remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git", +) + +ecsact = use_extension("@rules_ecsact//ecsact:extensions.bzl", "ecsact", dev_dependency = True) +ecsact.toolchain(use_ecsact_cli = True) +use_repo(ecsact, "ecsact_toolchain") + +llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) +llvm.toolchain(llvm_version = "17.0.6") +use_repo(llvm, "llvm_toolchain") + +register_toolchains( + "@llvm_toolchain//:all", + "@ecsact_toolchain//:all", + dev_dependency = True, ) bazel_dep(name = "bzlws") git_override( module_name = "bzlws", - commit = "b90ae6b38e351979cae2af355f55d2c68d997030", + commit = "b7b10a115da356ec23b0cf0c697919baa7b7301c", remote = "https://github.com/zaucy/bzlws", ) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 7c75688..f008fd6 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -4,16 +4,16 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file" http_file( name = "ecsact_rust_codegen_windows", + downloaded_file_path = "ecsact_rust_codegen.dll", sha256 = "d35c8226f4953faf2d527d295c41adefd3215c61bad6f709e8ac812919c07daf", url = "https://github.com/ecsact-dev/ecsact_lang_rust/releases/download/0.1.0/ecsact_rust_codegen_bin.dll", - downloaded_file_path = "ecsact_rust_codegen.dll", ) http_file( name = "ecsact_rust_codegen_linux", + downloaded_file_path = "ecsact_rust_codegen.so", sha256 = "cac4856b63217960b4194812119def5f9a7126483533cc24e847abe66a120536", url = "https://github.com/ecsact-dev/ecsact_lang_rust/releases/download/0.1.0/ecsact_rust_codegen_bin.so", - downloaded_file_path = "ecsact_rust_codegen.so", ) http_archive( @@ -44,36 +44,3 @@ http_archive( strip_prefix = "logo-f2c8a487ea702a551e00044e766bc913c5e7c771", urls = ["https://github.com/ecsact-dev/logo/archive/f2c8a487ea702a551e00044e766bc913c5e7c771.zip"], ) - -http_archive( - name = "hedron_compile_commands", - sha256 = "05f7fb324290c147ed29361a6a6fef7459c61816084fc07b3676a9639f4fcab7", - strip_prefix = "bazel-compile-commands-extractor-eca42c63700fccdc49cf58177e0a96f0f6075a68", - url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/eca42c63700fccdc49cf58177e0a96f0f6075a68.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 = "afe9154ad85f0c0eb1f68b6036ad4e415ecf938b5e2bc17e4a76707452b48222", - strip_prefix = "bazel-toolchain-ade23e0e37c5308162c012a4f4224459c1c4fa22", - url = "https://github.com/grailbio/bazel-toolchain/archive/ade23e0e37c5308162c012a4f4224459c1c4fa22.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", - llvm_version = "16.0.4", -) - -load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") - -llvm_register_toolchains() diff --git a/pkg.bzl b/pkg.bzl index b9acf53..f0e8ac3 100644 --- a/pkg.bzl +++ b/pkg.bzl @@ -1,4 +1,4 @@ -load("@rules_pkg//:providers.bzl", "PackageFilegroupInfo", "PackageFilesInfo", "PackageSymlinkInfo") +load("@rules_pkg//pkg:providers.bzl", "PackageFilegroupInfo", "PackageFilesInfo", "PackageSymlinkInfo") def _runfile_path(workspace_name, file): path = file.short_path