Skip to content

Commit 02b0321

Browse files
committed
Declare SQLite dependency
1 parent 2e9b6c2 commit 02b0321

3 files changed

Lines changed: 26 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,4 +366,4 @@ jobs:
366366
if: false
367367
with:
368368
sbom-path: bom.json
369-
subject-path: artifacts/
369+
subject-path: artifacts/*

crates/core/src/constants.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ pub const FULL_GIT_HASH: &'static str = env!("GIT_HASH");
55

66
// We need 3.44 or later to use an `ORDER BY` in an aggregate function invocation.
77
//
8-
// When raising the minimum version requirement, also change it in download_sqlite3.dart to ensure
9-
// we're testing with the minimum version we claim to support.
8+
// When raising the minimum version requirement, also change it in generate_sbom.dart.
109
pub const MIN_SQLITE_VERSION_NUMBER: c_int = 3044000;
1110

1211
pub const SUBTYPE_JSON: u32 = 'J' as u32;

dart/tool/generate_sbom.dart

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'package:uuid/uuid.dart';
77
///
88
/// Usage: `dart tool/generate_sbom.dart > bom.json`
99
void main() async {
10-
final crates = await findDependencies();
10+
final [coreExtension, ...dependencies] = await findDependencies();
1111

1212
const journeyApps = {
1313
'name': 'JourneyApps',
@@ -21,7 +21,7 @@ void main() async {
2121
if (Platform.environment['GITHUB_ACTIONS'] == 'true')
2222
'version': int.parse(Platform.environment['GITHUB_RUN_ID']!),
2323
'metadata': {
24-
'component': crates.first.describeAsBomComponent(),
24+
'component': coreExtension.describeAsBomComponent(),
2525
'lifecycles': [
2626
{'phase': 'build'}
2727
],
@@ -30,14 +30,33 @@ void main() async {
3030
'supplier': journeyApps,
3131
},
3232
'components': [
33-
for (final crate in crates.skip(1)) crate.describeAsBomComponent(),
33+
for (final crate in dependencies) crate.describeAsBomComponent(),
34+
// Also declare SQLite as an external component required at runtime (since
35+
// this is a SQLite extension).
36+
{
37+
'isExternal': true,
38+
'versionRange': 'vers:semver/>=3.44.0|<4.0.0',
39+
'type': 'library',
40+
'name': 'SQLite',
41+
'purl': 'pkg:generic/sqlite',
42+
'bom-ref': 'external-sqlite',
43+
'licenses': [
44+
{'expression': 'blessing'},
45+
],
46+
'externalReferences': [
47+
{'url': 'https://sqlite.org/', 'type': 'website'},
48+
],
49+
}
3450
],
3551
'dependencies': [
36-
for (final crate in crates)
52+
for (final crate in [coreExtension, ...dependencies])
3753
if (crate.dependencies.isNotEmpty)
3854
{
3955
'ref': crate.bomRef,
40-
'dependsOn': [for (final dep in crate.dependencies) dep.bomRef]
56+
'dependsOn': [
57+
for (final dep in crate.dependencies) dep.bomRef,
58+
if (crate == coreExtension) 'external-sqlite'
59+
]
4160
}
4261
],
4362
};

0 commit comments

Comments
 (0)