Repository navigation
feat: use score_sbom for license handling #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d07307d
ead85a4
18fb413
b75abdf
08b3115
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,8 @@ | |
|
|
||
| load("@score_docs_as_code//:docs.bzl", "docs") | ||
| load("@score_format_checker//:macros.bzl", "use_format_targets") | ||
| load("@score_sbom//:defs.bzl", "sbom") | ||
| load("@score_tooling//:defs.bzl", "cli_helper", "copyright_checker", "dash_license_checker", "setup_starpls") | ||
| load("//:project_config.bzl", "PROJECT_CONFIG") | ||
|
|
||
| # Creates all documentation targets: | ||
| # - `:docs` for building documentation at build-time | ||
|
|
@@ -60,34 +60,45 @@ copyright_checker( | |
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| # Needed for Dash tool to check python dependency licenses. | ||
| # This is a workaround to filter out local packages from the Cargo.lock file. | ||
| # The tool is intended for third-party content. | ||
| genrule( | ||
| name = "filtered_cargo_lock", | ||
| srcs = ["Cargo.lock"], | ||
| outs = ["Cargo.lock.filtered"], | ||
| cmd = """ | ||
| awk ' | ||
| BEGIN { skip = 0; data = "" } | ||
| /^\\[\\[package\\]\\]/ { | ||
| if (data != "" && !skip) print data; | ||
| skip = 1; | ||
| data = $$0; | ||
| next; | ||
| } | ||
| data != "" { data = data "\\n" $$0 } | ||
| # any package that has a "source = " line will not be skipped. | ||
| /^source = / { skip = 0 } | ||
| END { if (data != "" && !skip) print data } | ||
| ' $(location Cargo.lock) > $@ | ||
| """, | ||
| dash_license_checker( | ||
| src = "//:Cargo.lock", | ||
| file_type = "cargo", | ||
| filter_keywords = ["github.com/eclipse-score/"], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| dash_license_checker( | ||
| src = ":filtered_cargo_lock", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no licence gate left for Rust. Licences now come from what publishers declare on crates.io, not from Dash/IP approval, and sbom-tool doesn't fail on any licence. Something still needs to gate this: Dash, or a policy check on the SBOM output.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "gate" is back (no more review needed with the filter and the updated Cargo.lock) the updated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The updated Cargo.lock is much closer: down from ~40 version mismatches to 2 compared to what Bazel builds. Crate: libc Cargo.lock: 0.2.189 Bazel: 0.2.186 (pinned exactly in score_crates for QNX 8) Could you align these two? Otherwise Dash checks a libc version we don't ship. Regarding a "correct" Cargo.lock: score_crates v0.0.12 now ships its own Cargo.lock (score-crates #69), which could serve as the reference, although it covers all S-CORE crates, not only ours. On "gate": the shared workflow (also the new d2083d5) never fails the job; the exit code only switches the comment between "Passed" and "Needs Review", and without a DASH token there is no IP-team review request. That's the same as on main, so no regression from this PR, but it's a report rather than a merge gate. Where this should go long-term needs a broader discussion: eclipse-dash/dash-licenses#533. The Eclipse IP team is investigating a move to an Eclipse Apoapsis/ORT-based solution, with Dash/IPLab to be retired eventually over a deprecation period of years. Similarly, https://github.com/bazelbuild/rules_license (used in #432) states that active development has moved to https://github.com/bazel-contrib/supply-chain, and score_sbom doesn't consume rules_license providers yet. I'd suggest we take the gate question and the target toolchain (Dash → ORT, rules_license → supply-chain) to cicd-workflows / the tooling community, and keep this PR to the libc / lazy_static fix.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. explicite synced versions in 08b3115 |
||
| file_type = "", # let it auto-detect based on project_config | ||
| project_config = PROJECT_CONFIG, | ||
| # Generates the product SBOM (SPDX 2.3 + CycloneDX 1.6) for the KVS library. | ||
| # - Rust crate licenses/suppliers come from the crates.io API via | ||
| # auto_crates_cache (network access required at build time). | ||
| # - Build-time/test tooling is covered separately by //:sbom_docs_tests. | ||
| sbom( | ||
| name = "sbom_product", | ||
| component_name = "score_persistency", | ||
| module_lockfiles = [":MODULE.bazel.lock"], | ||
| targets = [ | ||
| "//score/kvs:kvs_cpp", | ||
| "//score/kvs/rust_kvs:rust_kvs", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| # Qualification inventory for Python-based build and test tools. This is kept | ||
| # separate from the product SBOM because build-time dependencies are not | ||
| # product/runtime dependencies. | ||
| sbom( | ||
| name = "sbom_docs_tests", | ||
| testonly = True, | ||
| component_name = "score_persistency", | ||
| module_lockfiles = [":MODULE.bazel.lock"], | ||
| python_lockfiles = [ | ||
| "//score/kvs/tests/test_cases:requirements.txt.lock", | ||
| "@score_docs_as_code//src:requirements_lock", | ||
| ], | ||
| targets = [ | ||
| "//:docs", | ||
| "//:unit_tests", | ||
| "//:cit_tests", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.