-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
121 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.cache | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copied from the original workspace | ||
.bazelrc | ||
.bazeliskrc | ||
.bazelignore | ||
|
||
# Bazel | ||
/bazel-* | ||
MODULE.bazel.lock | ||
|
||
/.cache |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Test module for `rules_build_error`. | ||
""" | ||
|
||
module( | ||
name = "rules_build_error_examples", | ||
version = "0.0.0", | ||
) | ||
|
||
bazel_dep(name = "rules_build_error", version = "0.0.0") | ||
local_path_override( | ||
module_name = "rules_build_error", | ||
path = "..", | ||
) | ||
|
||
# Register LLVM toolchain for C/C++ | ||
bazel_dep(name = "toolchains_llvm", version = "1.0.0") | ||
|
||
llvm = use_extension( | ||
"@toolchains_llvm//toolchain/extensions:llvm.bzl", | ||
"llvm", | ||
) | ||
llvm.toolchain( | ||
llvm_version = "17.0.6", | ||
) | ||
use_repo(llvm, "llvm_toolchain") | ||
|
||
register_toolchains("@llvm_toolchain//:all") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
load("@rules_build_error//lang/cc:defs.bzl", "cc_build_error") | ||
load("@rules_build_error//matcher:defs.bzl", "matcher") | ||
|
||
cc_build_error( | ||
name = "example", | ||
src = "compile_error.cpp", | ||
compile_stderr = matcher.has_substr("Example compile error"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
int main() | ||
{ | ||
static_assert(false, "Example compile error message"); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Validate example directory | ||
|
||
set -euo pipefail | ||
|
||
# Bazel executable with some arguments | ||
BAZEL_EXECUTABLE=( | ||
"env" | ||
"-i" | ||
BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 | ||
BAZELISK_HOME=../.cache/bazelisk | ||
"HOME=${HOME}" | ||
"PATH=${PATH}" | ||
bazelisk | ||
) | ||
|
||
copied_files=( | ||
".bazelignore" | ||
".bazeliskrc" | ||
".bazelrc" | ||
) | ||
|
||
for copied_file in "${copied_files[@]}"; do | ||
cp "${copied_file}" examples | ||
done | ||
|
||
cd examples | ||
|
||
"${BAZEL_EXECUTABLE[@]}" build //... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters