Skip to content

Commit 3a1dba8

Browse files
committed
Merge branch 'main' into nira_add_local_sdp_support
2 parents 55afdec + 7408c8c commit 3a1dba8

3 files changed

Lines changed: 14 additions & 40 deletions

File tree

tests/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bazel_dep(name = "bazel_skylib", version = "1.9.0")
3333
bazel_dep(name = "platforms", version = "1.1.0")
3434
bazel_dep(name = "score_bazel_platforms", version = "0.1.2")
3535
git_override(
36-
name = "score_bazel_platforms",
36+
module_name = "score_bazel_platforms",
3737
remote = "https://github.com/eclipse-score/bazel_platforms.git",
3838
commit = "6c45a8f2a973fe396c392f727d9dae510692eb88",
3939
)

tests/MODULE.bazel.lock

Lines changed: 1 addition & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/feature_verification/fully_static_link_test.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
// (/proc/self/maps): a fully static binary maps no shared objects, so no
2020
// mapped file path ends in ".so" (or contains ".so.").
2121

22-
#include <cassert>
2322
#include <fstream>
2423
#include <iostream>
2524
#include <string>
@@ -30,7 +29,11 @@ namespace {
3029
// which would indicate the binary was NOT fully statically linked.
3130
bool has_shared_object_mappings() {
3231
std::ifstream maps("/proc/self/maps");
33-
assert(maps.is_open() && "could not open /proc/self/maps");
32+
if (!maps.is_open()) {
33+
std::cerr << "FAIL: could not open /proc/self/maps" << std::endl;
34+
// Treat as failure by reporting a shared-object mapping.
35+
return true;
36+
}
3437

3538
std::string line;
3639
while (std::getline(maps, line)) {
@@ -46,8 +49,13 @@ bool has_shared_object_mappings() {
4649
int main() {
4750
std::cout << "Testing fully_static_link feature (-static)..." << std::endl;
4851

49-
assert(!has_shared_object_mappings() &&
50-
"expected a fully static binary (no .so mappings)");
52+
// Note: the check must not rely on assert(), which is compiled out under
53+
// -DNDEBUG (applied in both fastbuild and opt modes by this toolchain).
54+
if (has_shared_object_mappings()) {
55+
std::cerr << "FAIL: shared object mapped; binary is not fully static"
56+
<< std::endl;
57+
return 1;
58+
}
5159

5260
std::cout << "fully_static_link test passed: no shared objects mapped"
5361
<< std::endl;

0 commit comments

Comments
 (0)