Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bazel_dep(name = "score_bazel_platforms", version = "0.1.2")
# *******************************************************************************
# C++ Rules for Bazel
# *******************************************************************************
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_cc", version = "0.2.17")

# *******************************************************************************
# Needed by S-CORE CI Automatic checks
Expand Down
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions docs/examples_and_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ platforms.
`examples/BUILD`

Contains small C++ targets used to verify compilation, linking, pthread
support, and sanitizer integration.
support, and optional sanitizer integration when sanitizer features are
registered explicitly.

`examples/test.sh`

Expand Down Expand Up @@ -85,4 +86,12 @@ In practice this means checking among other things:
- correct toolchain registration and platform matching,
- basic linking behavior,
- feature coverage such as pthread-enabled builds,
- optional sanitizer feature wiring for the local Linux toolchain path.
- optional sanitizer feature wiring for the local Linux toolchain path.

## Sanitizer Note

Sanitizer features are not included by default by the generated toolchains.
If a workspace wants to use targets such as `asan_test`, it must first
register the sanitizer `cc_feature` definitions explicitly, for example via
`extra_known_features` or `extra_enabled_features` when declaring the
toolchain and by providing the feature definitions from `score_cpp_policies`.
Comment on lines +93 to +97
6 changes: 6 additions & 0 deletions docs/extension_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ Flag and runtime attributes:
- `extra_c_compile_flags`
- `extra_cxx_compile_flags`
- `extra_link_flags`
- `extra_known_features`
- `extra_enabled_features`
- `ld_library_paths`
- `runtime_ecosystem`
- `use_base_constraints_only`
Expand Down Expand Up @@ -112,5 +114,9 @@ configurations for this activation step.
- The extension is intended for the root module.
- When `use_default_package` is enabled, the version matrix can inject extra
include and link flags required by non-standard sysroot layouts.
- Sanitizer features are not registered automatically. Workspaces that want
sanitizer support must provide the relevant rule-based `cc_feature`
definitions explicitly, typically from `score_cpp_policies`, through
`extra_known_features` or `extra_enabled_features`.
- QNX toolchains use additional licensing and include-path parameters that do
not apply to Linux toolchains.
54 changes: 0 additions & 54 deletions examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,57 +51,3 @@ cc_test(
linkstatic = False,
deps = [":math_lib"],
)

cc_test(
name = "asan_test",
srcs = ["asan_test.cpp"],
features = ["asan"],
deps = [
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

# for some reason this test is very flaky.
# cc_test(
# name = "tsan_test",
# srcs = ["tsan_test.cpp"],
# features = ["tsan"],
# env = {
# "TSAN_OPTIONS": "halt_on_error=1",
# },
# deps = [
# "@googletest//:gtest",
# "@googletest//:gtest_main",
# ],
# )

cc_test(
name = "ubsan_test",
srcs = ["ubsan_test.cpp"],
env = {
"UBSAN_OPTIONS": "halt_on_error=1",
},
features = ["ubsan"],
deps = [
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

cc_test(
name = "lsan_test",
srcs = ["lsan_test.cpp"],
env = {
"ASAN_OPTIONS": "detect_leaks=1",
"LSAN_OPTIONS": "exitcode=23",
},
features = [
"lsan",
"asan",
],
deps = [
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
2 changes: 1 addition & 1 deletion examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bazel_dep(name = "score_bazel_platforms", version = "0.1.2")
# *******************************************************************************
# C++ Rules for Bazel
# *******************************************************************************
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "googletest", version = "1.17.0")

# *******************************************************************************
Expand Down
26 changes: 21 additions & 5 deletions examples/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ The toolchain configurations are defined in:

## Building Targets

## Sanitizer Feature Registration

Sanitizer features are no longer included by default by the example toolchain
declarations. Targets that request features such as `score_asan` require the
workspace to register those feature definitions explicitly, for example from
`score_cpp_policies` via `extra_known_features` or `extra_enabled_features` on
the corresponding `gcc.toolchain(...)` declaration.

Without that explicit registration, sanitizer-specific example targets are not
expected to build.
Comment on lines +21 to +22

### Default Toolchain

Build a specific target with the default toolchain:
Expand Down
36 changes: 0 additions & 36 deletions examples/asan_test.cpp

This file was deleted.

31 changes: 0 additions & 31 deletions examples/lsan_test.cpp

This file was deleted.

40 changes: 0 additions & 40 deletions examples/tsan_test.cpp

This file was deleted.

Loading
Loading