@cyclonedx/cdxgen 11.3.2 → 11.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "http://cyclonedx.org/schema/spdx.schema.json",
4
- "$comment": "v1.0-3.24.0",
4
+ "$comment": "v1.0-3.26.0",
5
5
  "type": "string",
6
6
  "enum": [
7
7
  "0BSD",
@@ -35,6 +35,7 @@
35
35
  "ANTLR-PD",
36
36
  "ANTLR-PD-fallback",
37
37
  "any-OSI",
38
+ "any-OSI-perl-modules",
38
39
  "Apache-1.0",
39
40
  "Apache-1.1",
40
41
  "Apache-2.0",
@@ -64,6 +65,7 @@
64
65
  "blessing",
65
66
  "BlueOak-1.0.0",
66
67
  "Boehm-GC",
68
+ "Boehm-GC-without-fee",
67
69
  "Borceux",
68
70
  "Brian-Gladman-2-Clause",
69
71
  "Brian-Gladman-3-Clause",
@@ -165,6 +167,8 @@
165
167
  "CC-BY-SA-3.0-IGO",
166
168
  "CC-BY-SA-4.0",
167
169
  "CC-PDDC",
170
+ "CC-PDM-1.0",
171
+ "CC-SA-1.0",
168
172
  "CC0-1.0",
169
173
  "CDDL-1.0",
170
174
  "CDDL-1.1",
@@ -215,6 +219,9 @@
215
219
  "DL-DE-BY-2.0",
216
220
  "DL-DE-ZERO-2.0",
217
221
  "DOC",
222
+ "DocBook-Schema",
223
+ "DocBook-Stylesheet",
224
+ "DocBook-XML",
218
225
  "Dotseqn",
219
226
  "DRL-1.0",
220
227
  "DRL-1.1",
@@ -256,6 +263,7 @@
256
263
  "fwlw",
257
264
  "GCR-docs",
258
265
  "GD",
266
+ "generic-xts",
259
267
  "GFDL-1.1",
260
268
  "GFDL-1.1-invariants-only",
261
269
  "GFDL-1.1-invariants-or-later",
@@ -308,6 +316,7 @@
308
316
  "Gutmann",
309
317
  "HaskellReport",
310
318
  "hdparm",
319
+ "HIDAPI",
311
320
  "Hippocratic-2.1",
312
321
  "HP-1986",
313
322
  "HP-1989",
@@ -326,6 +335,7 @@
326
335
  "HPND-Markus-Kuhn",
327
336
  "HPND-merchantability-variant",
328
337
  "HPND-MIT-disclaimer",
338
+ "HPND-Netrek",
329
339
  "HPND-Pbmplus",
330
340
  "HPND-sell-MIT-disclaimer-xserver",
331
341
  "HPND-sell-regexpr",
@@ -345,6 +355,7 @@
345
355
  "Imlib2",
346
356
  "Info-ZIP",
347
357
  "Inner-Net-2.0",
358
+ "InnoSetup",
348
359
  "Intel",
349
360
  "Intel-ACPI",
350
361
  "Interbase-1.0",
@@ -413,10 +424,12 @@
413
424
  "McPhee-slideshow",
414
425
  "metamail",
415
426
  "Minpack",
427
+ "MIPS",
416
428
  "MirOS",
417
429
  "MIT",
418
430
  "MIT-0",
419
431
  "MIT-advertising",
432
+ "MIT-Click",
420
433
  "MIT-CMU",
421
434
  "MIT-enna",
422
435
  "MIT-feh",
@@ -557,6 +570,7 @@
557
570
  "RSA-MD",
558
571
  "RSCPL",
559
572
  "Ruby",
573
+ "Ruby-pty",
560
574
  "SAX-PD",
561
575
  "SAX-PD-2.0",
562
576
  "Saxpath",
@@ -564,6 +578,7 @@
564
578
  "SchemeReport",
565
579
  "Sendmail",
566
580
  "Sendmail-8.23",
581
+ "Sendmail-Open-Source-1.1",
567
582
  "SGI-B-1.0",
568
583
  "SGI-B-1.1",
569
584
  "SGI-B-2.0",
@@ -576,6 +591,7 @@
576
591
  "SISSL-1.2",
577
592
  "SL",
578
593
  "Sleepycat",
594
+ "SMAIL-GPL",
579
595
  "SMLNJ",
580
596
  "SMPPL",
581
597
  "SNIA",
@@ -604,16 +620,19 @@
604
620
  "TCP-wrappers",
605
621
  "TermReadKey",
606
622
  "TGPPL-1.0",
623
+ "ThirdEye",
607
624
  "threeparttable",
608
625
  "TMate",
609
626
  "TORQUE-1.1",
610
627
  "TOSL",
611
628
  "TPDL",
612
629
  "TPL-1.0",
630
+ "TrustedQSL",
613
631
  "TTWL",
614
632
  "TTYP0",
615
633
  "TU-Berlin-1.0",
616
634
  "TU-Berlin-2.0",
635
+ "Ubuntu-font-1.0",
617
636
  "UCAR",
618
637
  "UCL-1.0",
619
638
  "ulem",
@@ -637,9 +656,11 @@
637
656
  "Widget-Workshop",
638
657
  "Wsuipa",
639
658
  "WTFPL",
659
+ "wwl",
640
660
  "wxWindows",
641
661
  "X11",
642
662
  "X11-distribute-modifications-variant",
663
+ "X11-swapped",
643
664
  "Xdebug-1.03",
644
665
  "Xerox",
645
666
  "Xfig",
@@ -674,11 +695,13 @@
674
695
  "Bison-exception-1.24",
675
696
  "Bison-exception-2.2",
676
697
  "Bootloader-exception",
698
+ "CGAL-linking-exception",
677
699
  "Classpath-exception-2.0",
678
700
  "CLISP-exception-2.0",
679
701
  "cryptsetup-OpenSSL-exception",
680
702
  "DigiRule-FOSS-exception",
681
703
  "eCos-exception-2.0",
704
+ "erlang-otp-linking-exception",
682
705
  "Fawkes-Runtime-exception",
683
706
  "FLTK-exception",
684
707
  "fmt-exception",
@@ -692,13 +715,16 @@
692
715
  "GNOME-examples-exception",
693
716
  "GNU-compiler-exception",
694
717
  "gnu-javamail-exception",
718
+ "GPL-3.0-389-ds-base-exception",
695
719
  "GPL-3.0-interface-exception",
696
720
  "GPL-3.0-linking-exception",
697
721
  "GPL-3.0-linking-source-exception",
698
722
  "GPL-CC-1.0",
699
723
  "GStreamer-exception-2005",
700
724
  "GStreamer-exception-2008",
725
+ "harbour-exception",
701
726
  "i2p-gpl-java-exception",
727
+ "Independent-modules-exception",
702
728
  "KiCad-libraries-exception",
703
729
  "LGPL-3.0-linking-exception",
704
730
  "libpri-OpenH323-exception",
@@ -708,6 +734,7 @@
708
734
  "LLVM-exception",
709
735
  "LZMA-exception",
710
736
  "mif-exception",
737
+ "mxml-exception",
711
738
  "Nokia-Qt-exception-1.1",
712
739
  "OCaml-LGPL-linking-exception",
713
740
  "OCCT-exception-1.0",
@@ -719,6 +746,7 @@
719
746
  "Qt-GPL-exception-1.0",
720
747
  "Qt-LGPL-exception-1.1",
721
748
  "Qwt-exception-1.0",
749
+ "romic-exception",
722
750
  "RRDtool-FLOSS-exception-2.0",
723
751
  "SANE-exception",
724
752
  "SHL-2.0",
package/lib/cli/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Buffer } from "node:buffer";
2
- import { spawnSync } from "node:child_process";
3
2
  import {
4
3
  constants,
5
4
  accessSync,
@@ -163,6 +162,7 @@ import {
163
162
  recomputeScope,
164
163
  safeExistsSync,
165
164
  safeMkdirSync,
165
+ safeSpawnSync,
166
166
  shouldFetchLicense,
167
167
  splitOutputByGradleProjects,
168
168
  } from "../helpers/utils.js";
@@ -588,6 +588,10 @@ function addMetadata(parentComponent = {}, options = {}, context = {}) {
588
588
  if (lifecycles) {
589
589
  metadata.lifecycles = lifecycles;
590
590
  }
591
+ // TLP classification
592
+ if (options.specVersion >= 1.7 && options?.tlpClassification) {
593
+ metadata.distribution = options.tlpClassification;
594
+ }
591
595
  if (parentComponent && Object.keys(parentComponent).length) {
592
596
  if (parentComponent) {
593
597
  cleanParentComponent(parentComponent);
@@ -1435,7 +1439,7 @@ export async function createJarBom(path, options) {
1435
1439
  rmSync(tempDir, { recursive: true, force: true });
1436
1440
  }
1437
1441
  }
1438
- pkgList = pkgList.concat(convertJarNSToPackages(nsMapping));
1442
+ pkgList = pkgList.concat(await convertJarNSToPackages(nsMapping));
1439
1443
  return buildBomNSData(options, pkgList, "maven", {
1440
1444
  src: path,
1441
1445
  parentComponent,
@@ -1614,8 +1618,8 @@ export async function createJavaBom(path, options) {
1614
1618
  }
1615
1619
  // specVersion 1.4 doesn't support externalReferences.type=disribution-intake
1616
1620
  // so we need to run the plugin with the correct version
1617
- if (options.specVersion === 1.4) {
1618
- mvnArgs = mvnArgs.concat("-DschemaVersion=1.4");
1621
+ if (options.specVersion) {
1622
+ mvnArgs = mvnArgs.concat(`-DschemaVersion=${options.specVersion}`);
1619
1623
  }
1620
1624
  }
1621
1625
  const firstPom = pomFiles.length ? pomFiles[0] : undefined;
@@ -1660,7 +1664,7 @@ export async function createJavaBom(path, options) {
1660
1664
  `Executing '${mavenCmd} ${mvnArgs.join(" ")}' in`,
1661
1665
  basePath,
1662
1666
  );
1663
- result = spawnSync(mavenCmd, mvnArgs, {
1667
+ result = safeSpawnSync(mavenCmd, mvnArgs, {
1664
1668
  cwd: basePath,
1665
1669
  shell: true,
1666
1670
  encoding: "utf-8",
@@ -1709,7 +1713,7 @@ export async function createJavaBom(path, options) {
1709
1713
  thoughtLog(
1710
1714
  "What is the parent component here? Let's use maven command to find out.",
1711
1715
  );
1712
- result = spawnSync(
1716
+ result = safeSpawnSync(
1713
1717
  "mvn",
1714
1718
  ["dependency:tree", "-N", `-DoutputFile=${tempMvnParentTree}`],
1715
1719
  {
@@ -1748,7 +1752,7 @@ export async function createJavaBom(path, options) {
1748
1752
  );
1749
1753
  }
1750
1754
  // Prefer the built-in maven
1751
- result = spawnSync(
1755
+ result = safeSpawnSync(
1752
1756
  PREFER_MAVEN_DEPS_TREE ? "mvn" : mavenCmd,
1753
1757
  mvnTreeArgs,
1754
1758
  {
@@ -2147,7 +2151,7 @@ export async function createJavaBom(path, options) {
2147
2151
  thoughtLog(
2148
2152
  `Let's invoke '${basename(gradleCmd)}' with the arguments '${gradleArg.join(" ").substring(0, 100)} ...'.`,
2149
2153
  );
2150
- const sresult = spawnSync(gradleCmd, gradleArg, {
2154
+ const sresult = safeSpawnSync(gradleCmd, gradleArg, {
2151
2155
  cwd: gradleRootPath,
2152
2156
  encoding: "utf-8",
2153
2157
  shell: isWin,
@@ -2232,7 +2236,7 @@ export async function createJavaBom(path, options) {
2232
2236
  if (DEBUG_MODE) {
2233
2237
  console.log("Stopping gradle daemon...");
2234
2238
  }
2235
- const sresult = spawnSync(gradleCmd, ["--stop"], {
2239
+ const sresult = safeSpawnSync(gradleCmd, ["--stop"], {
2236
2240
  cwd: gradleRootPath,
2237
2241
  encoding: "utf-8",
2238
2242
  shell: isWin,
@@ -2293,7 +2297,7 @@ export async function createJavaBom(path, options) {
2293
2297
  bArgs = ["--bazelrc=.bazelrc", "build", bazelTarget];
2294
2298
  }
2295
2299
  console.log("Executing", BAZEL_CMD, bArgs.join(" "), "in", basePath);
2296
- let result = spawnSync(BAZEL_CMD, bArgs, {
2300
+ let result = safeSpawnSync(BAZEL_CMD, bArgs, {
2297
2301
  cwd: basePath,
2298
2302
  shell: true,
2299
2303
  encoding: "utf-8",
@@ -2331,7 +2335,7 @@ export async function createJavaBom(path, options) {
2331
2335
  bazelParser = parseBazelSkyframe;
2332
2336
  }
2333
2337
  console.log("Executing", BAZEL_CMD, `${query.join(" ")} in`, basePath);
2334
- result = spawnSync(BAZEL_CMD, query, {
2338
+ result = safeSpawnSync(BAZEL_CMD, query, {
2335
2339
  cwd: basePath,
2336
2340
  encoding: "utf-8",
2337
2341
  timeout: TIMEOUT_MS,
@@ -2509,7 +2513,7 @@ export async function createJavaBom(path, options) {
2509
2513
  tempSbtgDir,
2510
2514
  );
2511
2515
  // Note that the command has to be invoked with `shell: true` to properly execut sbt
2512
- const result = spawnSync(SBT_CMD, sbtArgs, {
2516
+ const result = safeSpawnSync(SBT_CMD, sbtArgs, {
2513
2517
  cwd: basePath,
2514
2518
  shell: true,
2515
2519
  encoding: "utf-8",
@@ -2628,7 +2632,7 @@ export async function createJavaBom(path, options) {
2628
2632
  if (DEBUG_MODE) {
2629
2633
  console.log("Executing", millCmd, millArgs.join(" "), "in", millRootPath);
2630
2634
  }
2631
- let sresult = spawnSync(millCmd, millArgs, {
2635
+ let sresult = safeSpawnSync(millCmd, millArgs, {
2632
2636
  cwd: millRootPath,
2633
2637
  encoding: "utf-8",
2634
2638
  shell: isWin,
@@ -2651,7 +2655,7 @@ export async function createJavaBom(path, options) {
2651
2655
  millRootPath,
2652
2656
  );
2653
2657
  }
2654
- sresult = spawnSync(millCmd, millResolveArgs, {
2658
+ sresult = safeSpawnSync(millCmd, millResolveArgs, {
2655
2659
  cwd: millRootPath,
2656
2660
  encoding: "utf-8",
2657
2661
  shell: isWin,
@@ -2717,7 +2721,7 @@ export async function createJavaBom(path, options) {
2717
2721
  if (DEBUG_MODE) {
2718
2722
  console.log("Shutting down mill server...");
2719
2723
  }
2720
- const sresult = spawnSync(millCmd, ["shutdown"], {
2724
+ const sresult = safeSpawnSync(millCmd, ["shutdown"], {
2721
2725
  cwd: millRootPath,
2722
2726
  encoding: "utf-8",
2723
2727
  shell: isWin,
@@ -2943,7 +2947,7 @@ export async function createNodejsBom(path, options) {
2943
2947
  `Executing '${pkgMgr} ${installArgs.join(" ")}' in`,
2944
2948
  basePath,
2945
2949
  );
2946
- const result = spawnSync(pkgMgr, installArgs, {
2950
+ const result = safeSpawnSync(pkgMgr, installArgs, {
2947
2951
  cwd: basePath,
2948
2952
  encoding: "utf-8",
2949
2953
  timeout: TIMEOUT_MS,
@@ -3140,6 +3144,10 @@ export async function createNodejsBom(path, options) {
3140
3144
  const basePath = dirname(f);
3141
3145
  // Determine the parent component
3142
3146
  const packageJsonF = join(basePath, "package.json");
3147
+ const pnpmHooks = join(basePath, ".pnpmfile.cjs");
3148
+ if (safeExistsSync(pnpmHooks)) {
3149
+ thoughtLog("Wait, this pnpm project uses install hooks.");
3150
+ }
3143
3151
  if (!Object.keys(parentComponent).length) {
3144
3152
  if (safeExistsSync(packageJsonF)) {
3145
3153
  const pcs = await parsePkgJson(packageJsonF, true);
@@ -3270,7 +3278,7 @@ export async function createNodejsBom(path, options) {
3270
3278
  // Do rush install if we don't have node_modules directory
3271
3279
  if (!safeExistsSync(nmDir)) {
3272
3280
  console.log("Executing 'rush install --no-link'", path);
3273
- const result = spawnSync(
3281
+ const result = safeSpawnSync(
3274
3282
  "rush",
3275
3283
  ["install", "--no-link", "--bypass-policy"],
3276
3284
  {
@@ -3806,7 +3814,7 @@ export async function createPythonBom(path, options) {
3806
3814
  if (requirementsMode || pipenvMode) {
3807
3815
  if (pipenvMode) {
3808
3816
  // TODO: Support for nested directories
3809
- spawnSync("pipenv", ["install"], { cwd: path, encoding: "utf-8" });
3817
+ safeSpawnSync("pipenv", ["install"], { cwd: path, encoding: "utf-8" });
3810
3818
  const piplockFile = join(path, "Pipfile.lock");
3811
3819
  if (safeExistsSync(piplockFile)) {
3812
3820
  const lockData = JSON.parse(readFileSync(piplockFile));
@@ -4033,7 +4041,7 @@ export async function createPythonBom(path, options) {
4033
4041
  tempDir,
4034
4042
  parentComponent,
4035
4043
  );
4036
- if (DEBUG_MODE && newPkgMap.failedPkgList.length) {
4044
+ if (DEBUG_MODE && newPkgMap?.failedPkgList?.length) {
4037
4045
  if (newPkgMap.failedPkgList.length < pkgList.length) {
4038
4046
  console.log(
4039
4047
  `${newPkgMap.failedPkgList.length} packages failed to install.`,
@@ -4148,7 +4156,7 @@ export async function createGoBom(path, options) {
4148
4156
  if (DEBUG_MODE) {
4149
4157
  console.log(`go mod why -m -vendor ${pkgFullName}`);
4150
4158
  }
4151
- const mresult = spawnSync(
4159
+ const mresult = safeSpawnSync(
4152
4160
  "go",
4153
4161
  ["mod", "why", "-m", "-vendor", pkgFullName],
4154
4162
  {
@@ -4250,7 +4258,7 @@ export async function createGoBom(path, options) {
4250
4258
  if (DEBUG_MODE) {
4251
4259
  console.log("Executing go list -deps in", basePath);
4252
4260
  }
4253
- let result = spawnSync(
4261
+ let result = safeSpawnSync(
4254
4262
  "go",
4255
4263
  [
4256
4264
  "list",
@@ -4298,7 +4306,7 @@ export async function createGoBom(path, options) {
4298
4306
  console.log("Executing go mod graph in", basePath);
4299
4307
  }
4300
4308
  // Next we use the go mod graph command to construct the dependency tree
4301
- result = spawnSync("go", ["mod", "graph"], {
4309
+ result = safeSpawnSync("go", ["mod", "graph"], {
4302
4310
  cwd: basePath,
4303
4311
  encoding: "utf-8",
4304
4312
  timeout: TIMEOUT_MS,
@@ -4351,7 +4359,7 @@ export async function createGoBom(path, options) {
4351
4359
  console.log("Executing go mod graph in", basePath);
4352
4360
  }
4353
4361
  // Next we use the go mod graph command to construct the dependency tree
4354
- result = spawnSync("go", ["mod", "graph"], {
4362
+ result = safeSpawnSync("go", ["mod", "graph"], {
4355
4363
  cwd: basePath,
4356
4364
  encoding: "utf-8",
4357
4365
  timeout: TIMEOUT_MS,
@@ -4541,7 +4549,7 @@ export async function createRustBom(path, options) {
4541
4549
  basePath,
4542
4550
  );
4543
4551
  }
4544
- const cargoInstallResult = spawnSync(CARGO_CMD, cargoArgs, {
4552
+ const cargoInstallResult = safeSpawnSync(CARGO_CMD, cargoArgs, {
4545
4553
  cwd: basePath,
4546
4554
  encoding: "utf-8",
4547
4555
  shell: isWin,
@@ -4907,7 +4915,7 @@ export function createClojureBom(path, options) {
4907
4915
  }
4908
4916
  const basePath = dirname(f);
4909
4917
  console.log("Executing", LEIN_CMD, LEIN_ARGS.join(" "), "in", basePath);
4910
- const result = spawnSync(LEIN_CMD, LEIN_ARGS, {
4918
+ const result = safeSpawnSync(LEIN_CMD, LEIN_ARGS, {
4911
4919
  cwd: basePath,
4912
4920
  encoding: "utf-8",
4913
4921
  timeout: TIMEOUT_MS,
@@ -4956,7 +4964,7 @@ export function createClojureBom(path, options) {
4956
4964
  for (const f of ednFiles) {
4957
4965
  const basePath = dirname(f);
4958
4966
  console.log("Executing", CLJ_CMD, CLJ_ARGS.join(" "), "in", basePath);
4959
- const result = spawnSync(CLJ_CMD, CLJ_ARGS, {
4967
+ const result = safeSpawnSync(CLJ_CMD, CLJ_ARGS, {
4960
4968
  cwd: basePath,
4961
4969
  encoding: "utf-8",
4962
4970
  timeout: TIMEOUT_MS,
@@ -5339,7 +5347,7 @@ export async function createSwiftBom(path, options) {
5339
5347
  `Executing '${swiftCommand} ${packageArgs.join(" ")}' in ${basePath}. Please wait ...`,
5340
5348
  );
5341
5349
  }
5342
- const result = spawnSync(swiftCommand, packageArgs, {
5350
+ const result = safeSpawnSync(swiftCommand, packageArgs, {
5343
5351
  cwd: basePath,
5344
5352
  encoding: "utf-8",
5345
5353
  timeout: TIMEOUT_MS,
@@ -5923,7 +5931,7 @@ export function createPHPBom(path, options) {
5923
5931
  if (DEBUG_MODE) {
5924
5932
  console.log("About to invoke composer --version");
5925
5933
  }
5926
- const versionResult = spawnSync("composer", ["--version"], {
5934
+ const versionResult = safeSpawnSync("composer", ["--version"], {
5927
5935
  encoding: "utf-8",
5928
5936
  });
5929
5937
  if (versionResult.status !== 0 || versionResult.error) {
@@ -5956,7 +5964,7 @@ export function createPHPBom(path, options) {
5956
5964
  console.log("Executing 'composer install' in", basePath);
5957
5965
  args = ["install", "--ignore-platform-reqs"];
5958
5966
  }
5959
- const result = spawnSync("composer", args, {
5967
+ const result = safeSpawnSync("composer", args, {
5960
5968
  cwd: basePath,
5961
5969
  encoding: "utf-8",
5962
5970
  });
@@ -6108,7 +6116,7 @@ export async function createRubyBom(path, options) {
6108
6116
  for (const f of gemFiles) {
6109
6117
  const basePath = dirname(f);
6110
6118
  console.log("Executing 'bundle install' in", basePath);
6111
- const result = spawnSync("bundle", ["install"], {
6119
+ const result = safeSpawnSync("bundle", ["install"], {
6112
6120
  cwd: basePath,
6113
6121
  encoding: "utf-8",
6114
6122
  });
@@ -6368,7 +6376,7 @@ export async function createCsharpBom(path, options) {
6368
6376
  `Executing '${buildCmd} ${buildArgs.join(" ")}' in ${basePath}`,
6369
6377
  );
6370
6378
  }
6371
- const result = spawnSync(buildCmd, buildArgs, {
6379
+ const result = safeSpawnSync(buildCmd, buildArgs, {
6372
6380
  cwd: path,
6373
6381
  encoding: "utf-8",
6374
6382
  env: { ...process.env, DOTNET_ROLL_FORWARD: "Major" },
@@ -286,7 +286,11 @@ export async function createSlice(
286
286
  if (sliceType === "usages") {
287
287
  // Generate OpenAPI specification for endpoints. Needs atom-tools pypi package to be installed.
288
288
  args.push("--extract-endpoints");
289
- if (process.env?.CDXGEN_IN_CONTAINER !== "true") {
289
+ if (
290
+ process.env?.CDXGEN_IN_CONTAINER !== "true" &&
291
+ !process.env?.DEVENV_NIX &&
292
+ !process.env?.NIX_STORE
293
+ ) {
290
294
  console.log(
291
295
  "Use an official cdxgen container image to improve the precision of endpoints detection (for SaaSBOM).",
292
296
  );
@@ -1,5 +1,4 @@
1
1
  import { Buffer } from "node:buffer";
2
- import { spawnSync } from "node:child_process";
3
2
  import { arch, homedir } from "node:os";
4
3
  import { delimiter, dirname, join } from "node:path";
5
4
  import process from "node:process";
@@ -23,6 +22,7 @@ import {
23
22
  isMac,
24
23
  isWin,
25
24
  safeExistsSync,
25
+ safeSpawnSync,
26
26
  } from "./utils.js";
27
27
 
28
28
  export const GIT_COMMAND = process.env.GIT_CMD || "git";
@@ -35,7 +35,7 @@ export const SDKMAN_JAVA_TOOL_ALIASES = {
35
35
  java21: process.env.JAVA21_TOOL || "21.0.7-tem",
36
36
  java22: process.env.JAVA22_TOOL || "22.0.2-tem",
37
37
  java23: process.env.JAVA23_TOOL || "23.0.2-tem",
38
- java24: process.env.JAVA24_TOOL || "24-tem",
38
+ java24: process.env.JAVA24_TOOL || "24.0.1-tem",
39
39
  };
40
40
 
41
41
  /**
@@ -399,7 +399,7 @@ const getCommandOutput = (cmd, dir, args) => {
399
399
  if (DEBUG_MODE) {
400
400
  console.log(`Executing ${commandToUse} ${args.join(" ")} in ${dir}`);
401
401
  }
402
- const result = spawnSync(commandToUse, args, {
402
+ const result = safeSpawnSync(commandToUse, args, {
403
403
  cwd: dir,
404
404
  encoding: "utf-8",
405
405
  shell: isWin,
@@ -440,7 +440,7 @@ export function isSdkmanAvailable() {
440
440
  * Method to check if nvm is available.
441
441
  */
442
442
  export function isNvmAvailable() {
443
- const result = spawnSync(
443
+ const result = safeSpawnSync(
444
444
  process.env.SHELL || "bash",
445
445
  ["-i", "-c", process.env.NVM_CMD || "nvm"],
446
446
  {
@@ -502,7 +502,7 @@ export function installSdkmanTool(toolType, toolName) {
502
502
  installDir = join(process.env.SDKMAN_CANDIDATES_DIR, toolType);
503
503
  }
504
504
  console.log("About to install", toolType, toolName, installDir);
505
- result = spawnSync(
505
+ result = safeSpawnSync(
506
506
  process.env.SHELL || "bash",
507
507
  [
508
508
  "-i",
@@ -597,7 +597,7 @@ export function installSdkmanTool(toolType, toolName) {
597
597
  * @returns {String} path of nvm if present, otherwise false
598
598
  */
599
599
  export function getNvmToolDirectory(toolName) {
600
- const resultWhichNode = spawnSync(
600
+ const resultWhichNode = safeSpawnSync(
601
601
  process.env.SHELL || "bash",
602
602
  ["-i", "-c", `"nvm which ${toolName}"`],
603
603
  {
@@ -632,7 +632,7 @@ export function getOrInstallNvmTool(toolVersion) {
632
632
  const nvmNodePath = getNvmToolDirectory(toolVersion);
633
633
  if (!nvmNodePath) {
634
634
  // nvm couldn't directly use toolName so maybe needs to be installed
635
- const resultInstall = spawnSync(
635
+ const resultInstall = safeSpawnSync(
636
636
  process.env.SHELL || "bash",
637
637
  ["-i", "-c", `"nvm install ${toolVersion}"`],
638
638
  {
@@ -678,7 +678,7 @@ function getSdkmanToolFullname(toolName) {
678
678
  * @returns {Boolean} true if rbenv is available. false otherwise.
679
679
  */
680
680
  export function isRbenvAvailable() {
681
- let result = spawnSync(
681
+ let result = safeSpawnSync(
682
682
  process.env.SHELL || "bash",
683
683
  ["-i", "-c", process.env.RBENV_CMD || "rbenv", "--version"],
684
684
  {
@@ -688,7 +688,7 @@ export function isRbenvAvailable() {
688
688
  },
689
689
  );
690
690
  if (result.status !== 0) {
691
- result = spawnSync(process.env.RBENV_CMD || "rbenv", ["--version"], {
691
+ result = safeSpawnSync(process.env.RBENV_CMD || "rbenv", ["--version"], {
692
692
  shell: isWin,
693
693
  encoding: "utf-8",
694
694
  });
@@ -732,7 +732,7 @@ export function bundleInstallWithDocker(rubyVersion, cdxgenGemHome, filePath) {
732
732
  "install",
733
733
  ];
734
734
  console.log(`Performing bundle install with: ${ociCmd} ${ociArgs.join(" ")}`);
735
- const result = spawnSync(ociCmd, ociArgs, {
735
+ const result = safeSpawnSync(ociCmd, ociArgs, {
736
736
  encoding: "utf-8",
737
737
  shell: isWin,
738
738
  timeout: TIMEOUT_MS,
@@ -765,7 +765,7 @@ export function installRubyVersion(rubyVersion, filePath) {
765
765
  }
766
766
  const fullToolBinDir = rubyVersionDir(rubyVersion);
767
767
  if (safeExistsSync(fullToolBinDir)) {
768
- const result = spawnSync(
768
+ const result = safeSpawnSync(
769
769
  process.env.RBENV_CMD || "rbenv",
770
770
  ["local", rubyVersion],
771
771
  {
@@ -809,7 +809,7 @@ export function installRubyVersion(rubyVersion, filePath) {
809
809
  `To speed up this step, use bind mounts. Example: "--mount type=bind,src=/tmp/rbenv,dst=/root/.rbenv/versions/${rubyVersion}"`,
810
810
  );
811
811
  }
812
- const result = spawnSync(
812
+ const result = safeSpawnSync(
813
813
  process.env.RBENV_CMD || "rbenv",
814
814
  ["install", rubyVersion],
815
815
  {
@@ -879,7 +879,7 @@ export function installRubyBundler(rubyVersion, bundlerVersion) {
879
879
  );
880
880
  }
881
881
  }
882
- const result = spawnSync(join(fullToolBinDir, "gem"), gemInstallArgs, {
882
+ const result = safeSpawnSync(join(fullToolBinDir, "gem"), gemInstallArgs, {
883
883
  encoding: "utf-8",
884
884
  shell: isWin,
885
885
  timeout: TIMEOUT_MS,
@@ -946,7 +946,7 @@ export function performBundleInstall(
946
946
  console.log(
947
947
  `Invoking ${bundleCommand} ${installArgs.join(" ")} from ${basePath} with GEM_HOME ${cdxgenGemHome}. Please wait ...`,
948
948
  );
949
- let result = spawnSync(bundleCommand, installArgs, {
949
+ let result = safeSpawnSync(bundleCommand, installArgs, {
950
950
  encoding: "utf-8",
951
951
  shell: isWin,
952
952
  timeout: TIMEOUT_MS,
@@ -1003,7 +1003,7 @@ export function performBundleInstall(
1003
1003
  );
1004
1004
  }
1005
1005
  console.log(`${bundleCommand} ${updateArgs.join(" ")}`);
1006
- result = spawnSync(bundleCommand, updateArgs, {
1006
+ result = safeSpawnSync(bundleCommand, updateArgs, {
1007
1007
  encoding: "utf-8",
1008
1008
  shell: isWin,
1009
1009
  timeout: TIMEOUT_MS,
@@ -1048,7 +1048,7 @@ export function performBundleInstall(
1048
1048
  }
1049
1049
  if (process.env?.CDXGEN_IN_CONTAINER === "true") {
1050
1050
  console.log(
1051
- "TIP: Create your own container image by using an existing Ruby base image from here: https://github.com/CycloneDX/cdxgen/tree/master/ci/base-images/debian",
1051
+ "TIP: Create your own container image by using an existing Ruby base image from here: https://github.com/CycloneDX/cdxgen/tree/master/ci/images/debian",
1052
1052
  );
1053
1053
  }
1054
1054
  }