Skip to content
Draft
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 .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ common --registry=https://bcr.bazel.build
common --//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
common --//score/mw/log/flags:KRemote_Logging=False
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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a good solution for compiler flags, since this .bazelrc is not applied when building this project as a dependenciy via another Bazel project.

A better approach would be to define a toolchain in Bazel which just wraps the system compiler and exposes flags as features.

test --test_tag_filters=-manual
81 changes: 0 additions & 81 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,88 +12,7 @@
# *******************************************************************************
module(name = "score-baselibs")

bazel_dep(name = "toolchains_llvm", version = "1.3.0", dev_dependency=True)

# Configure and register the toolchain.
bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=True)
gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=True)
gcc.toolchain(
url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz",
sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600",
strip_prefix = "x86_64-unknown-linux-gnu",
)
gcc.extra_features(
features = [
"minimal_warnings",
"treat_warnings_as_errors",
],
)
gcc.warning_flags(
minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations", "-Wno-error=narrowing"],
strict_warnings = ["-Wextra", "-Wpedantic"],
)
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")

bazel_dep(name = "googletest", version = "1.15.0")
bazel_dep(name = "google_benchmark", version = "1.9.1")

bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
archive_override(
module_name = "rules_boost",
urls = "https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz",
strip_prefix = "rules_boost-master",
)

non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
use_repo(
non_module_boost_repositories,
"boost",
)

bazel_dep(name = "download_utils", version = "1.0.1")

deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb")

deb(
name = "acl-deb",
build = "//third_party/acl:acl.BUILD",
urls = ["https://archive.ubuntu.com/ubuntu/pool/main/a/acl/libacl1-dev_2.2.52-3build1_amd64.deb"],
visibility = ["//visibility:public"],
)

deb(
name = "valgrind-deb",
build = "//third_party/valgrind:valgrind.BUILD",
urls = ["https://archive.ubuntu.com/ubuntu/pool/main/v/valgrind/valgrind_3.15.0-1ubuntu9.1_amd64.deb"],
visibility = ["//visibility:public"],
)

deb(
name = "libcap2-deb",
urls = ["https://archive.ubuntu.com/ubuntu/pool/main/libc/libcap2/libcap2_2.25-1.2_amd64.deb"],
visibility = ["//visibility:public"],
)

deb(
name = "libcap2-dev-deb",
build = "//third_party/libcap2:libcap2.BUILD",
urls = ["https://archive.ubuntu.com/ubuntu/pool/main/libc/libcap2/libcap-dev_2.25-1.2_amd64.deb"],
visibility = ["//visibility:public"],
)

deb(
name = "libseccomp2-deb",
urls = ["https://archive.ubuntu.com/ubuntu/pool/main/libs/libseccomp/libseccomp2_2.5.1-1ubuntu1~18.04.2_amd64.deb"],
visibility = ["//visibility:public"],
)

deb(
name = "libseccomp2-dev-deb",
build = "//third_party/libseccomp2:libseccomp2.BUILD",
urls = ["https://archive.ubuntu.com/ubuntu/pool/main/libs/libseccomp/libseccomp-dev_2.5.1-1ubuntu1~18.04.2_i386.deb"],
visibility = ["//visibility:public"],
)

bazel_dep(name = "nlohmann_json", version = "3.11.3")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
275 changes: 80 additions & 195 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions score/concurrency/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,6 @@ cc_library(
],
)

cc_library(
name = "valgrind_on_host",
deps = select({
"@platforms//os:qnx": [],
"//conditions:default": ["//third_party/valgrind"],
}),
)

cc_gtest_unit_test(
name = "synchronized_queue_test",
srcs = ["synchronized_queue_test.cpp"],
Expand All @@ -416,7 +408,6 @@ cc_gtest_unit_test(
flaky = True, # TODO: Remove flakiness (Ticket-178835)
deps = [
":synchronized_queue",
":valgrind_on_host",
],
)

Expand Down
45 changes: 0 additions & 45 deletions score/json/internal/parser/json_parser_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,51 +89,6 @@ TEST(JsonParserTest, ViaErrorLiteral)
EXPECT_EXIT(JSON_ERROR_INPUT ""_json, ::testing::KilledBySignal(SIGABRT), "");
}

TEST(JsonParserTest, FromFileSuceess)
{
RecordProperty("Verifies", "SCR-5310867");
RecordProperty("ASIL", "B");
RecordProperty("Description", "Parsing json object from file path, cf. RFC-8259 section 9");
RecordProperty("TestType", "Requirements-based test");
RecordProperty("DerivationTechnique", "Analysis of requirements");

const std::string file_path = std::tmpnam(nullptr);
std::ofstream file(file_path);
if (file.is_open())
{
file << JSON_INPUT;
file.close();
}

json::JsonParser json_parser{};
auto result = json_parser.FromFile(file_path);
ASSERT_TRUE(result.has_value());
json_verify(result.value());
}

TEST(JsonParserTest, FromFileParseError)
{
RecordProperty("Verifies", "SCR-5310867");
RecordProperty("ASIL", "B");
RecordProperty("Description", "Parsing invalid json object from file path causes failure, cf. RFC-8259 section 9");
RecordProperty("TestType", "Requirements-based test");
RecordProperty("DerivationTechnique", "Analysis of requirements");

const std::string file_path = std::tmpnam(nullptr);
std::ofstream file(file_path);
if (file.is_open())
{
file << JSON_INPUT;
file << "!"; // append garbage
file.close();
}

json::JsonParser json_parser{};
auto result = json_parser.FromFile(file_path);
ASSERT_FALSE(result.has_value());
EXPECT_EQ(result.error(), score::json::Error::kParsingError);
}

} // namespace
} // namespace json
} // namespace score
2 changes: 0 additions & 2 deletions score/json/internal/parser/nlohmann/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cc_library(
deps = [
"@score-baselibs//score/json/internal/model",
"@score-baselibs//score/result",
"@nlohmann_json//:json",
"@score-baselibs//score/language/futurecpp",
],
)
Expand All @@ -37,7 +36,6 @@ cc_library(
":json_builder",
"@score-baselibs//score/json/internal/model",
"@score-baselibs//score/result",
"@nlohmann_json//:json",
],
)

Expand Down
1 change: 0 additions & 1 deletion score/memory/shared/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ cc_library(
] + select({
"@platforms//os:linux": [
"//third_party/boost:container",
"//third_party/boost:interprocess",
],
"@platforms//os:qnx": [],
}),
Expand Down
8 changes: 4 additions & 4 deletions third_party/acl/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
alias(
cc_library(
name = "acl",
actual = "@acl-deb//:acl",
visibility = ["//visibility:public"],
)
linkopts = ["-lacl"],
visibility = ["//visibility:public"],
)
20 changes: 3 additions & 17 deletions third_party/boost/BUILD
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
alias(
cc_library(
name = "container",
actual = "@boost//:container",
visibility =["//visibility:public"],
linkopts = ["-lboost_container"],
visibility = ["//visibility:public"],
)


alias(
name = "interprocess",
actual = "@boost//:interprocess",
visibility =["//visibility:public"],
)


alias(
name = "program_options",
actual = "@boost//:program_options",
visibility =["//visibility:public"],
)
8 changes: 4 additions & 4 deletions third_party/libcap2/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
alias(
cc_library(
name = "libcap2",
actual = "@libcap2-dev-deb//:libcap2",
visibility = ["//visibility:public"],
)
linkopts = ["-lcap"],
visibility = ["//visibility:public"],
)
8 changes: 4 additions & 4 deletions third_party/libseccomp2/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
alias(
cc_library(
name = "libseccomp2",
actual = "@libseccomp2-dev-deb//:libseccomp2",
visibility = ["//visibility:public"],
)
linkopts = ["-lseccomp"],
visibility = ["//visibility:public"],
)
5 changes: 0 additions & 5 deletions third_party/valgrind/BUILD

This file was deleted.

6 changes: 0 additions & 6 deletions third_party/valgrind/valgrind.BUILD

This file was deleted.