Use system dependencies#15
Conversation
I had to delete some JSON tests because: - they use tmpnam - tmpnam causes the linker to emit a warning, since it's unsafe - Bazel linking rules treat warnings as errors I tried adding the linkopt -Wl,--no-fatal-warnings but it had no effect.
There was a problem hiding this comment.
Changes suggested to prevent build breakages, restore public API tests, and narrow warnings.
Status: Changes Suggested | Risk: Medium | Readiness: 5/10 (Needs Polish)
Issues Identified & Suggestions
- Fix missing system dependency targets:
score/concurrency/BUILD,third_party/boost/BUILD,score/json/internal/parser/nlohmann/BUILD - Reinstate public JsonParser::FromFile tests:
json_parser_test.cpp - Scope move-warning demotion per target:
.bazelrc
Review Details
📁 13 files reviewed | 💬 5 comments
👍 / 👎 individual comments to help improve reviews for you
| deps = [ | ||
| ":synchronized_queue", | ||
| ":valgrind_on_host", | ||
| ], |
There was a problem hiding this comment.
[Logic] The valgrind_on_host target and //third_party/valgrind package were deleted entirely, but synchronized_queue_test.cpp still contains #include <valgrind/valgrind.h> (line 17) and uses the RUNNING_ON_VALGRIND macro (line 172). Since no Bazel target provides this header anymore, this will cause a compile failure on non-QNX platforms.
Either:
- Remove the
#include <valgrind/valgrind.h>and replaceTEST_RUNNING_ON_VALGRINDwith a non-valgrind alternative (e.g., alwaysfalse), or - Add a system-level
cc_librarywrapper for valgrind headers (like the other system deps such aslibcap2,acl) and keep the dependency in the test target.
Context for Agents
The `valgrind_on_host` target and `//third_party/valgrind` package were deleted entirely, but `synchronized_queue_test.cpp` still contains `#include <valgrind/valgrind.h>` (line 17) and uses the `RUNNING_ON_VALGRIND` macro (line 172). Since no Bazel target provides this header anymore, this will cause a compile failure on non-QNX platforms.
Either:
1. Remove the `#include <valgrind/valgrind.h>` and replace `TEST_RUNNING_ON_VALGRIND` with a non-valgrind alternative (e.g., always `false`), or
2. Add a system-level `cc_library` wrapper for valgrind headers (like the other system deps such as `libcap2`, `acl`) and keep the dependency in the test target.
File: score/concurrency/BUILD
Line: 411Chain of Thought
- Validation Decision: accepted
- Confidence: 0.95
- Likelihood Score: 5/5
- Likelihood Reason: The test file at HEAD still contains
#include <valgrind/valgrind.h>(line 17) and uses theRUNNING_ON_VALGRINDmacro (line 172), but the PR deletes boththird_party/valgrind/BUILDandthird_party/valgrind/valgrind.BUILDentirely, removes thevalgrind_on_hostcc_library target, and removes:valgrind_on_hostfrom the test's deps. Without any Bazel target providing the valgrind headers, this will inevitably cause a compile failure on non-QNX platforms. - Suggested Action: modify
- Tool Calls Used: 10
Reasoning
The comment correctly identifies a build break introduced by this PR. Here's the evidence:
-
Test file still includes valgrind header:
synchronized_queue_test.cppat HEAD (line 17) still has#include <valgrind/valgrind.h>(guarded by#if !defined(__QNX__)), and uses theRUNNING_ON_VALGRINDmacro at line 172. -
All valgrind Bazel targets deleted: The PR deletes
third_party/valgrind/BUILDandthird_party/valgrind/valgrind.BUILDentirely (confirmed: both return "File not found" at HEAD). Thevalgrind_on_hostcc_library inscore/concurrency/BUILDis also deleted, and the:valgrind_on_hostdep is removed fromsynchronized_queue_test. -
No replacement system dependency: The PR converts other third-party deps to system wrappers using
cc_librarywithlinkopts(e.g.,libcap2,libseccomp2,acl), but no equivalent system wrapper was created for valgrind. Unlike linking libraries, valgrind is a headers-only dependency for annotations, but it still needs a Bazel target or system include path. -
This is introduced by the PR: Before this PR, the dependency chain was intact:
synchronized_queue_test→:valgrind_on_host→//third_party/valgrind→@valgrind-deb//:valgrindwhich provided the headers. The PR breaks this chain without updating the source file.
Minor inaccuracy: The comment mentions valgrind/helgrind.h and valgrind/memcheck.h, but the actual include is valgrind/valgrind.h. This doesn't affect the validity of the core issue.
The fix is clear: either remove the valgrind includes from the test source file and refactor the TEST_RUNNING_ON_VALGRIND macro, or create a system-level cc_library wrapper for valgrind headers (consistent with the pattern used for other system deps) and maintain the dependency.
Evidence Summary
1. File Lookup
- Filename:
synchronized_queue_test.cpp
Found 1 file(s) matching 'synchronized_queue_test.cpp':
- score/concurrency/synchronized_queue_test.cpp
2. File Snapshot (BASE)
- File:
third_party/valgrind/BUILD
1: alias(
2: name = "valgrind",
3: actual = "@valgrind-deb//:valgrind",
4: visibility = ["//visibility:public"],
5: )
3. File Snapshot (BASE)
- File:
third_party/valgrind/valgrind.BUILD
1: cc_library(
2: name = "valgrind",
3: hdrs = glob(["usr/include/**/*.h"]),
4: includes = ["usr/include/"],
5: visibility = ["//visibility:public"],
6: )
7:
4. File Snapshot (HEAD)
- File:
score/concurrency/synchronized_queue_test.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
5. File Snapshot (BASE)
- File:
score/concurrency/synchronized_queue_test.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
6. File Snapshot (HEAD)
- File:
third_party/libcap2/BUILD
1: cc_library(
2: name = "libcap2",
3: linkopts = ["-lcap"],
4: visibility = ["//visibility:public"],
5: )
6:
7. File Snapshot (HEAD)
- File:
third_party/acl/BUILD
1: cc_library(
2: name = "acl",
3: linkopts = ["-lacl"],
4: visibility = ["//visibility:public"],
5: )
6:
8. File Snapshot (HEAD)
- File:
third_party/libseccomp2/BUILD
1: cc_library(
2: name = "libseccomp2",
3: linkopts = ["-lseccomp"],
4: visibility = ["//visibility:public"],
5: )
6:
| cc_library( | ||
| name = "container", | ||
| actual = "@boost//:container", | ||
| visibility =["//visibility:public"], | ||
| linkopts = ["-lboost_container"], | ||
| visibility = ["//visibility:public"], | ||
| ) |
There was a problem hiding this comment.
[Reliability] Removing the //third_party/boost:interprocess target from the BUILD file and the dependency from map will break any downstream consumer (inside or outside this repo) that depends on //third_party/boost:interprocess. The program_options target was also silently removed. If any target in the wider build graph still references these, the build will fail with a missing target error.
Either keep stub cc_library targets for interprocess and program_options (with system linkopts, like container), or verify no remaining consumer exists and document the removal as a breaking change.
| cc_library( | |
| name = "container", | |
| actual = "@boost//:container", | |
| visibility =["//visibility:public"], | |
| linkopts = ["-lboost_container"], | |
| visibility = ["//visibility:public"], | |
| ) | |
| cc_library( | |
| name = "container", | |
| linkopts = ["-lboost_container"], | |
| visibility = ["//visibility:public"], | |
| ) | |
| cc_library( | |
| name = "interprocess", | |
| # header-only on Linux; no linkopts needed | |
| visibility = ["//visibility:public"], | |
| ) | |
| cc_library( | |
| name = "program_options", | |
| linkopts = ["-lboost_program_options"], | |
| visibility = ["//visibility:public"], | |
| ) |
Context for Agents
Removing the `//third_party/boost:interprocess` target from the BUILD file and the dependency from `map` will break any downstream consumer (inside or outside this repo) that depends on `//third_party/boost:interprocess`. The `program_options` target was also silently removed. If any target in the wider build graph still references these, the build will fail with a missing target error.
Either keep stub `cc_library` targets for `interprocess` and `program_options` (with system linkopts, like `container`), or verify no remaining consumer exists and document the removal as a breaking change.
```suggestion
cc_library(
name = "container",
linkopts = ["-lboost_container"],
visibility = ["//visibility:public"],
)
cc_library(
name = "interprocess",
# header-only on Linux; no linkopts needed
visibility = ["//visibility:public"],
)
cc_library(
name = "program_options",
linkopts = ["-lboost_program_options"],
visibility = ["//visibility:public"],
)
```
File: third_party/boost/BUILD
Line: 5Chain of Thought
- Validation Decision: accepted
- Confidence: 0.00
- Likelihood Score: 0/5
- Suggested Action: keep
- Tool Calls Used: 16
Reasoning
Failed to parse validation response
Evidence Summary
1. File Snapshot (HEAD)
- File:
score/memory/shared/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
2. File Snapshot (BASE)
- File:
score/memory/shared/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
3. File Snapshot (HEAD)
- File:
score/concurrency/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
4. File Snapshot (HEAD)
- File:
third_party/boost/BUILD
1: cc_library(
2: name = "container",
3: linkopts = ["-lboost_container"],
4: visibility = ["//visibility:public"],
5: )
6:
5. File Snapshot (BASE)
- File:
score/concurrency/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
6. File Snapshot (HEAD)
- File:
MODULE.bazel
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
7. File Snapshot (BASE)
- File:
MODULE.bazel
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
| deps = [ | ||
| "@score-baselibs//score/json/internal/model", | ||
| "@score-baselibs//score/result", | ||
| "@nlohmann_json//:json", | ||
| "@score-baselibs//score/language/futurecpp", | ||
| ], |
There was a problem hiding this comment.
[Maintainability] The @nlohmann_json//:json dependency was removed from both json_builder and nlohmann_parser targets, but the source code (e.g., nlohmann_parser.cpp includes "nlohmann/json.hpp") still requires this header. Unlike the other system dependencies (acl, libcap2, libseccomp2, boost), no cc_library wrapper was created in third_party/ for nlohmann_json. This makes the nlohmann header dependency invisible to Bazel's dependency graph and relies entirely on the system compiler's implicit include paths finding the header.
Create a wrapper target (e.g., third_party/nlohmann_json/BUILD) consistent with the pattern used for other system dependencies:
cc_library(
name = "json",
# header-only, no linkopts needed
visibility = ["//visibility:public"],
)and reference it from the deps here.
Context for Agents
The `@nlohmann_json//:json` dependency was removed from both `json_builder` and `nlohmann_parser` targets, but the source code (e.g., `nlohmann_parser.cpp` includes `"nlohmann/json.hpp"`) still requires this header. Unlike the other system dependencies (acl, libcap2, libseccomp2, boost), no `cc_library` wrapper was created in `third_party/` for nlohmann_json. This makes the nlohmann header dependency invisible to Bazel's dependency graph and relies entirely on the system compiler's implicit include paths finding the header.
Create a wrapper target (e.g., `third_party/nlohmann_json/BUILD`) consistent with the pattern used for other system dependencies:
```starlark
cc_library(
name = "json",
# header-only, no linkopts needed
visibility = ["//visibility:public"],
)
```
and reference it from the deps here.
File: score/json/internal/parser/nlohmann/BUILD
Line: 25Chain of Thought
- Validation Decision: accepted
- Confidence: 0.92
- Likelihood Score: 4/5
- Likelihood Reason: The nlohmann_json dependency is removed from both MODULE.bazel and the BUILD file, but source files still include nlohmann/json.hpp. This makes the build rely on implicit system include paths. In sandboxed Bazel builds or clean environments, this could break. The inconsistency with other system dependencies (which all have third_party/ wrappers) will create maintenance confusion and could cause build failures.
- Suggested Action: keep
- Tool Calls Used: 18
Reasoning
The comment is accurate on all points:
-
Dependency removal confirmed:
@nlohmann_json//:jsonwas removed from bothjson_builderandnlohmann_parsertargets in the BUILD file, ANDbazel_dep(name = "nlohmann_json", version = "3.11.3")was removed from MODULE.bazel. -
Source code still requires the header: Both
nlohmann_parser.cpp(line 17) andjson_builder.cpp(line 21) include"nlohmann/json.hpp". -
No wrapper created: There is no
third_party/nlohmann_json/BUILDfile — confirmed byfind_file. -
Inconsistency with other dependencies: The PR creates wrapper
cc_librarytargets inthird_party/for acl, boost, libcap2, and libseccomp2, but not for nlohmann_json. This is a clear inconsistency in the approach. -
Issue introduced by this PR: This is directly caused by the PR's changes — the dependency was properly managed before (via
bazel_dep+@nlohmann_json//:json), and this PR removes it without creating a replacement wrapper. -
Actionable: The comment provides a concrete code suggestion with a wrapper BUILD file, consistent with the pattern used for other system dependencies.
The only nuance is that nlohmann_json is header-only (no linkopts needed), but the comment correctly acknowledges this with its # header-only, no linkopts needed suggestion. Even without linkopts, a wrapper target would maintain consistency, make the dependency visible in the graph, and ensure proper Bazel sandboxing behavior.
Evidence Summary
1. File Snapshot (HEAD)
- File:
score/json/internal/parser/nlohmann/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
2. File Lookup
- Filename:
nlohmann_parser.cpp
Found 1 file(s) matching 'nlohmann_parser.cpp':
- score/json/internal/parser/nlohmann/nlohmann_parser.cpp
3. File Lookup
- Filename:
BUILD - Max Results:
10
Found 10 file(s) matching 'BUILD':
- bazel/settings/qemu/BUILD
- BUILD
- score/analysis/tracing/common/canary_wrapper/BUILD
- score/analysis/tracing/common/canary_wrapper/test/BUILD
- score/analysis/tracing/common/flexible_circular_allocator/BUILD
- score/analysis/tracing/common/flexible_circular_allocator/error_codes/factory/BUILD
- score/analysis/tracing/common/flexible_circular_allocator/error_codes/flexible_circular_allocator/BUILD
- score/analysis/tracing/common/flexible_circular_allocator/error_codes/lockless_flexible_circular_allocator/BUILD
- score/analysis/tracing/common/flexible_circular_allocator/test/mocks/BUILD
...
4. File Lookup
- Filename:
json_builder.cpp
Found 1 file(s) matching 'json_builder.cpp':
- score/json/internal/parser/nlohmann/json_builder.cpp
5. File Snapshot (HEAD)
- File:
third_party/libcap2/BUILD
1: cc_library(
2: name = "libcap2",
3: linkopts = ["-lcap"],
4: visibility = ["//visibility:public"],
5: )
6:
6. File Snapshot (HEAD)
- File:
third_party/libseccomp2/BUILD
1: cc_library(
2: name = "libseccomp2",
3: linkopts = ["-lseccomp"],
4: visibility = ["//visibility:public"],
5: )
6:
7. File Snapshot (HEAD)
- File:
.bazelrc
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
8. File Snapshot (HEAD)
- File:
third_party/acl/BUILD
1: cc_library(
2: name = "acl",
3: linkopts = ["-lacl"],
4: visibility = ["//visibility:public"],
5: )
6:
9. File Snapshot (HEAD)
- File:
third_party/boost/BUILD
1: cc_library(
2: name = "container",
3: linkopts = ["-lboost_container"],
4: visibility = ["//visibility:public"],
5: )
6:
10. File Snapshot (HEAD)
- File:
score/json/internal/parser/nlohmann/nlohmann_parser.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
11. File Snapshot (HEAD)
- File:
score/json/internal/parser/nlohmann/json_builder.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
12. File Snapshot (HEAD)
- File:
MODULE.bazel
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
13. File Lookup
- Filename:
nlohmann_json
No files found matching 'nlohmann_json'
14. File Snapshot (BASE)
- File:
MODULE.bazel
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
15. File Snapshot (HEAD)
- File:
score/concurrency/BUILD - Lines:
1-30
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
16. File Snapshot (HEAD)
- File:
score/memory/shared/BUILD - Lines:
1-30
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
| EXPECT_EXIT(JSON_ERROR_INPUT ""_json, ::testing::KilledBySignal(SIGABRT), ""); | ||
| } | ||
|
|
||
| TEST(JsonParserTest, FromFileSuceess) |
There was a problem hiding this comment.
[Testing] The FromFileSuceess and FromFileParseError tests that verified requirement SCR-5310867 for the public JsonParser::FromFile API were removed entirely. While the typed test suite in parsers_test_suite.h covers FromFile at the internal parser level (ParsingFromFileWorks, FromFileFail), these were the only tests exercising the public JsonParser::FromFile entry point. This reduces requirement coverage for a safety-relevant (ASIL B) API.
If these tests were removed solely because std::tmpnam doesn't work in the sandboxed build, consider rewriting them using TEST_TMPDIR (set by Bazel) or the existing FileTestUtils::GetTempDirectory() helper (seen in score/filesystem/file_utils/file_test_utils.cpp from the codebase context).
Context for Agents
The `FromFileSuceess` and `FromFileParseError` tests that verified requirement SCR-5310867 for the public `JsonParser::FromFile` API were removed entirely. While the typed test suite in `parsers_test_suite.h` covers `FromFile` at the internal parser level (`ParsingFromFileWorks`, `FromFileFail`), these were the only tests exercising the **public** `JsonParser::FromFile` entry point. This reduces requirement coverage for a safety-relevant (ASIL B) API.
If these tests were removed solely because `std::tmpnam` doesn't work in the sandboxed build, consider rewriting them using `TEST_TMPDIR` (set by Bazel) or the existing `FileTestUtils::GetTempDirectory()` helper (seen in `score/filesystem/file_utils/file_test_utils.cpp` from the codebase context).
File: score/json/internal/parser/json_parser_test.cpp
Line: 92Chain of Thought
- Validation Decision: accepted
- Confidence: 0.00
- Likelihood Score: 0/5
- Suggested Action: keep
- Tool Calls Used: 17
Reasoning
Failed to parse validation response
Evidence Summary
1. File Lookup
- Filename:
file_test_utils.cpp
Found 1 file(s) matching 'file_test_utils.cpp':
- score/filesystem/file_utils/file_test_utils.cpp
2. File Lookup
- Filename:
parsers_test_suite.h
Found 1 file(s) matching 'parsers_test_suite.h':
- score/json/internal/parser/parsers_test_suite.h
3. File Snapshot (BASE)
- File:
score/json/internal/parser/json_parser_test.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
4. File Snapshot (BASE)
- File:
score/json/internal/parser/parsers_test_suite.h
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
5. File Snapshot (BASE)
- File:
score/filesystem/file_utils/file_test_utils.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
6. File Lookup
- Filename:
json_parser.h
Found 1 file(s) matching 'json_parser.h':
- score/json/json_parser.h
7. File Lookup
- Filename:
nlohmann_parser_test.cpp
Found 1 file(s) matching 'nlohmann_parser_test.cpp':
- score/json/internal/parser/nlohmann/nlohmann_parser_test.cpp
8. File Snapshot (BASE)
- File:
score/json/json_parser.h
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
9. File Snapshot (BASE)
- File:
score/json/internal/parser/nlohmann/nlohmann_parser_test.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
10. File Lookup
- Filename:
json_parser.cpp
Found 1 file(s) matching 'json_parser.cpp':
- score/json/json_parser.cpp
11. File Lookup
- Filename:
nlohmann_parser.h
Found 1 file(s) matching 'nlohmann_parser.h':
- score/json/internal/parser/nlohmann/nlohmann_parser.h
12. File Snapshot (BASE)
- File:
score/json/json_parser.cpp
1: /********************************************************************************
2: * Copyright (c) 2025 Contributors to the Eclipse Foundation
3: *
4: * See the NOTICE file(s) distributed with this work for additional
5: * information regarding copyright ownership.
6: *
7: * This program and the accompanying materials are made available under the
8: * terms of the Apache License Version 2.0 which is available at
9: * https://www.apache.org/licenses/LICENSE-2.0
10: *
...
| common --//score/json:base_library=nlohmann | ||
| common --extra_toolchains=@gcc_toolchain//:host_gcc_12 | ||
| build --incompatible_strict_action_env | ||
| build --cxxopt=-std=c++17 --cxxopt=-Wno-error=deprecated-declarations --cxxopt=-Wno-error=self-move --cxxopt=-Wno-error=pessimizing-move |
There was a problem hiding this comment.
[Maintainability] -Wno-error=self-move and -Wno-error=pessimizing-move demote move-semantics warnings from errors to warnings globally for all targets. These warnings catch real bugs (e.g., return std::move(local) preventing copy elision, self-move-assignment). Applying them project-wide means these issues won't cause build failures in any existing or future code.
Consider scoping these to specific targets that need them (via copts in their cc_library/cc_test rules, e.g., the third_party wrappers) instead of applying globally in .bazelrc. The codebase already has per-target warning configuration via COMPILER_WARNING_FEATURES.
Context for Agents
`-Wno-error=self-move` and `-Wno-error=pessimizing-move` demote move-semantics warnings from errors to warnings globally for all targets. These warnings catch real bugs (e.g., `return std::move(local)` preventing copy elision, self-move-assignment). Applying them project-wide means these issues won't cause build failures in any existing or future code.
Consider scoping these to specific targets that need them (via `copts` in their `cc_library`/`cc_test` rules, e.g., the third_party wrappers) instead of applying globally in `.bazelrc`. The codebase already has per-target warning configuration via `COMPILER_WARNING_FEATURES`.
File: .bazelrc
Line: 22Chain of Thought
- Validation Decision: accepted
- Confidence: 0.85
- Likelihood Score: 4/5
- Likelihood Reason: The flags are newly introduced by this PR and apply globally to all build targets. As the codebase grows, this will hide real move-semantics issues in all future code. The individual targets already demonstrate per-target feature usage (COMPILER_WARNING_FEATURES), so scoping these overrides would be consistent and feasible.
- Suggested Action: modify
- Tool Calls Used: 9
Reasoning
The comment is valid and addresses a real issue introduced by this PR:
-
New issue introduced by PR: The base
.bazelrcdoes NOT contain-Wno-error=self-moveor-Wno-error=pessimizing-move. This PR adds line 22:build --cxxopt=-std=c++17 --cxxopt=-Wno-error=deprecated-declarations --cxxopt=-Wno-error=self-move --cxxopt=-Wno-error=pessimizing-move. This is clearly new, not legacy debt. -
Accuracy: The comment correctly identifies that these flags apply globally to all targets. Technically,
-Wno-error=flags don't suppress warnings entirely but prevent them from being treated as errors (demoting them from errors to warnings). The comment says "suppress...warnings" which is slightly imprecise, but the core concern is valid — issues that would otherwise cause build failures will now be silently passed. -
Actionability: The suggestion is concrete and actionable — use
coptsin specificcc_library/cc_testrules that actually need these suppressions. Looking at the BUILD files in this PR, the codebase already has a well-established pattern of per-target feature configuration (e.g.,features = COMPILER_WARNING_FEATURESis used extensively in score/concurrency/BUILD and score/memory/shared/BUILD). This makes the suggestion particularly apt — the infrastructure for per-target configuration already exists. -
Context: This PR is about switching to system dependencies. The warning suppressions are likely needed because system-installed headers (e.g., Boost, nlohmann-json) trigger these warnings. Scoping them to the
third_party/BUILD files (which wrap system libraries) would be the ideal approach, limiting the blast radius. -
Impact: Applying these globally means any future code with self-move or pessimizing-move issues will not trigger build errors, reducing code quality enforcement across the entire project.
Evidence Summary
1. File Snapshot (HEAD)
- File:
.bazelrc
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
2. File Snapshot (BASE)
- File:
.bazelrc
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
3. File Snapshot (HEAD)
- File:
third_party/boost/BUILD
1: cc_library(
2: name = "container",
3: linkopts = ["-lboost_container"],
4: visibility = ["//visibility:public"],
5: )
6:
4. File Snapshot (HEAD)
- File:
score/json/internal/parser/nlohmann/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
5. File Snapshot (HEAD)
- File:
score/concurrency/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
6. File Snapshot (HEAD)
- File:
score/memory/shared/BUILD
1: # *******************************************************************************
2: # Copyright (c) 2025 Contributors to the Eclipse Foundation
3: #
4: # See the NOTICE file(s) distributed with this work for additional
5: # information regarding copyright ownership.
6: #
7: # This program and the accompanying materials are made available under the
8: # terms of the Apache License Version 2.0 which is available at
9: # https://www.apache.org/licenses/LICENSE-2.0
10: #
...
This is a showcase of baselibs building with all system dependencies for all libraries and tools, for demonstration and discussion.
The S-CORE infrastructure team has been discussing how S-CORE can be integrated into a wider system. It is usually requirements for integrators that:
Currently, S-CORE components do not meet either of these requirements, because:
This PR modifies baselibs to address these points. All dependencies now must be installed in the system in order to build. For me on Ubuntu, that means installing these packages:
g++ libacl1-dev libcap-dev libseccomp-dev valgrind libboost-container1.83-dev nlohmann-json3-devIt also shifts responsibility for the compiler/toolchain itself to the host system rather than relying on Bazel-provisioned toolchains.
Architecture Diagram:
flowchart TD subgraph Build_Configuration M["MODULE.bazel (-81 lines)"] RC[".bazelrc (+1 line)"] BF["BUILD files (-27 lines)"] end subgraph Application_Code AC["Baselibs C++ Code"] JPT["json_parser_test.cpp (-45 lines)"] end subgraph Dependency_Sources OldDeps[/"'Bazel-managed Dependencies (removed)'"/] SysDeps[("System-installed Libraries")] end M -- "removes config for" --> OldDeps M -- "configures for" --> SysDeps RC -- "configures compiler for" --> SysDeps BF -- "updates links to" --> SysDeps AC -- "now uses" --> SysDeps JPT -- "removes tests for" --> ACThis summary was automatically generated by @propel-code-bot