Skip to content

Commit

Permalink
wip: module
Browse files Browse the repository at this point in the history
  • Loading branch information
0-Sacha committed Oct 29, 2024
1 parent c852745 commit 6c5738c
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 49 deletions.
16 changes: 11 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ common --show_timestamps
common --verbose_failures
test --test_output=errors

# Winlibs
common:winlibs-gcc --extra_toolchains=@winlibs//:gcc-toolchain
common:winlibs-clang --extra_toolchains=@pthread-winlibs//:clang-toolchain

# BuildBuddy
common:linux --workspace_status_command=$(pwd)/.buildbuddy/workspace_status.sh
common:windows --workspace_status_command=.buildbuddy/workspace_status.bat

#
common:buildbuddy --build_metadata=ROLE=CI
common:buildbuddy --bes_results_url=https://sacha.buildbuddy.io/invocation/
common:buildbuddy --bes_backend=grpcs://sacha.buildbuddy.io
common:buildbuddy --remote_cache=grpcs://sacha.buildbuddy.io
common:buildbuddy --remote_executor=grpcs://sacha.buildbuddy.io
common:buildbuddy --experimental_remote_cache_compression
common:buildbuddy --jobs=50
common:buildbuddy --nolegacy_important_outputs
common:buildbuddy --platforms=@buildbuddy_test//:buildbuddy_linux_x86_64
common:buildbuddy --extra_execution_platforms=@buildbuddy_test//:buildbuddy_linux_x86_64
common:buildbuddy --remote_instance_name=littleecs
common:buildbuddy --extra_toolchains=@buildbuddy_test//:toolchain_buildbuddy_gcc_12
common:buildbuddy --remote_instance_name=streamformat
#
common:buildbuddy --extra_execution_platforms=@buildbuddy//:platform
common:buildbuddy --extra_toolchains=@buildbuddy//:gcc-toolchain
common:buildbuddy --platforms=@buildbuddy//:platform
8 changes: 7 additions & 1 deletion .buildkite/windows_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ agents:
steps:
- label: ":bazel: Build"
commands:
- bazelisk build //:LittleECSTests
- bazelisk test //:LittleECSTests

- label: ":bazel: Build And Test Winlibs/clang"
commands:
- bazelisk build --config=winlibs-clang //:LittleECSTests
- label: ":bazel: Build And Test Winlibs/gcc"
commands:
- bazelisk build --config=winlibs-gcc //:LittleECSTests
15 changes: 15 additions & 0 deletions .github/workflows/LittleECS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ jobs:
run: bazelisk build //:LittleECSTests
- name: Testing...
run: bazelisk test //:LittleECSTests

windows-latest-winlibs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v3
- name: Mount bazel cache
uses: actions/cache@v4
with:
path: "~/.cache/bazel"
key: bazel
- name: Build Winlibs/clang...
run: bazelisk build --config=winlibs-clang //:StreamFormatTests
- name: Build Winlibs/gcc...
run: bazelisk build --config=winlibs-gcc //:StreamFormatTests

ubuntu-latest-gcc:
runs-on: ubuntu-latest
Expand Down
File renamed without changes.
26 changes: 14 additions & 12 deletions Examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
module(
name = "littleecs_examples",
version = "0.1",
repo_name = "com_sacha_littleecs_examples",
)

bazel_dep(name = "rules_cc", version = "0.0.9")
git_override(module_name="bazel_utilities", remote="https://github.com/0-Sacha/bazel_utilities.git", commit="7f6c3585c41278918428ed48d45b12413c197fc0")
git_override(module_name="bazel_buildbuddy", remote="https://github.com/0-Sacha/bazel_buildbuddy.git", commit="b60314cac7826edb87efe285b032b877ad725f84")
git_override(module_name="bazel_winlibs", remote="https://github.com/0-Sacha/bazel_winlibs.git", commit="e2cc97b61cb9115fbc2b7169dc9d1cb36b351935")
local_path_override(module_name = "littleecs", path = "../")

bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_utilities", version = "0.0.1")
bazel_dep(name = "bazel_winlibs", version = "0.0.1")
bazel_dep(name = "littleecs")
local_path_override(
module_name = "littleecs",
path = "../",
)

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "StreamFormat",
urls = [ "https://github.com/0-Sacha/StreamFormat/archive/refs/heads/dev.zip" ],
strip_prefix = "StreamFormat-dev"
)
winlibs_toolchain_extension = use_extension("@bazel_winlibs//:rules.bzl", "winlibs_toolchain_extension")
inject_repo(winlibs_toolchain_extension, "platforms", "bazel_utilities")
winlibs_toolchain_extension.winlibs_toolchain(name = "ex_winlibs")
winlibs_toolchain_extension.winlibs_toolchain(name = "pthread-ex_winlibs", linklibs = [ "pthread" ])
use_repo(winlibs_toolchain_extension, "ex_winlibs")
use_repo(winlibs_toolchain_extension, "pthread-ex_winlibs")
File renamed without changes.
35 changes: 28 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,35 @@
module(
name = "littleecs",
version = "0.1",
repo_name = "com_sacha_littleecs",
)

bazel_dep(name = "rules_cc", version = "0.0.9")
git_override(module_name="bazel_utilities", remote="https://github.com/0-Sacha/bazel_utilities.git", commit="7f6c3585c41278918428ed48d45b12413c197fc0")
git_override(module_name="bazel_buildbuddy", remote="https://github.com/0-Sacha/bazel_buildbuddy.git", commit="b60314cac7826edb87efe285b032b877ad725f84")
git_override(module_name="bazel_winlibs", remote="https://github.com/0-Sacha/bazel_winlibs.git", commit="e2cc97b61cb9115fbc2b7169dc9d1cb36b351935")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "StreamFormat",
urls = [ "https://github.com/0-Sacha/StreamFormat/archive/refs/heads/dev.zip" ],
strip_prefix = "StreamFormat-dev",
bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_utilities", version = "0.0.1")
bazel_dep(name = "bazel_buildbuddy", version = "0.0.1")
bazel_dep(name = "bazel_winlibs", version = "0.0.1")

bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
commit = "1e08f8e0507b6b6b1f4416a9a22cf5c28beaba93",
)

winlibs_toolchain_extension = use_extension("@bazel_winlibs//:rules.bzl", "winlibs_toolchain_extension")
inject_repo(winlibs_toolchain_extension, "platforms", "bazel_utilities")
winlibs_toolchain_extension.winlibs_toolchain(name = "winlibs")
winlibs_toolchain_extension.winlibs_toolchain(name = "pthread-winlibs", linklibs = [ "pthread" ])
use_repo(winlibs_toolchain_extension, "winlibs")
use_repo(winlibs_toolchain_extension, "pthread-winlibs")
# register_toolchains("@winlibs//:clang-toolchain")

buildbuddy_toolchain_extension = use_extension("@bazel_buildbuddy//:rules.bzl", "buildbuddy_toolchain_extension")
inject_repo(buildbuddy_toolchain_extension, "platforms", "bazel_utilities")
buildbuddy_toolchain_extension.buildbuddy_toolchain(name = "buildbuddy")
use_repo(buildbuddy_toolchain_extension, "buildbuddy")
# register_toolchains("@buildbuddy//:gcc-toolchain")
24 changes: 0 additions & 24 deletions WORKSPACE

This file was deleted.

13 changes: 13 additions & 0 deletions conf/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
"""

load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")

refresh_compile_commands(
name = "compile_commands",
exclude_external_sources = True,
exclude_headers = "external",
targets = {
"//:LittleECS": "",
},
)

0 comments on commit 6c5738c

Please sign in to comment.