-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Problem with Generating SBOM for Workspaces in a TypeScript Project #1657
Comments
Could you share a sample project to reproduce this? Even I want individual sboms for one of my polyglot project. This could be a special scenario where the split is based on the sub-project. Related: #689 |
@prabhu you can easily verify this behaviour in the theia-ide project: https://github.com/eclipse-theia/theia-ide
I just did
|
Thank you! This requires implementing workspace support for yarn. We added this feature for pnpm and uv recently. Will look for sponsors. |
Are you sure yarn causes this issue? Afaik, Theia just recently (version 1.58) moved from yarn to npm. While for my project I still use yarn, it should be npm for Theia. |
I am seeing yarn being used for building etc. https://github.com/eclipse-theia/theia-ide/blob/master/package.json#L39 How do you know it is npm? |
I was assuming it should be npm for Theia, because it was prominently announced for the 1.58 release, e.g. here: |
Interesting! It does build cleanly with both npm and yarn, which is good. Wish they had committed the package-lock.json in the repo. The workspace feature still needs to be added to cdxgen though since the lock file is not granular enough to specify which workspace and which dependency requested a specific package. From a quick test, noticed that cdxgen is throwing some warnings even with a lock file, so needs some work.
|
Is there any way to work around this for now? |
Added some fixes to the master. Can you try using the master with "-t npm"? |
I have pulled the latest master branch and did
|
Give me more time. It works without warnings from the root folder by running cdxgen after doing |
Since, I am just a downstream adopter of the theia project I cannot answer for the Theia team, of course. For my own theia-adopted project I clearly see two SBOMs: One for the electron build and one for the browser-build. These result in two different applications and they even have different dependencies in their |
I am using cdxgen to generate SBOMs for a TypeScript project based on Eclipse Theia. My project structure is as follows:
The
package.json
file inmyproj/theia-app/
contains:When I run
cdxgen -o sbom.json
insidemyproj/theia-app/
, it successfully generates an SBOM that includes components from bothbrowser-app
andelectron-app
.However, my goal is to generate separate SBOMs for
browser-app
andelectron-app
. When I try to do this by runningcdxgen -o sbom.json
insidemyproj/theia-app/browser-app/
ormyproj/theia-app/electron-app/
, I receive the following error:The resulting
sbom.json
is mostly empty and only contains minimal metadata:Steps to Reproduce
npm i -g @cyclonedx/cdxgen
cdxgen -o sbom.json
insidemyproj/theia-app/
→ Works as expected.cdxgen -o sbom.json
insidemyproj/theia-app/browser-app/
→ Fails with npm install has failed and produces an empty SBOM.cdxgen -o sbom.json ./browser-app
frommyproj/theia-app/
→ Same result.Note that is build my project using
yarn
.Expected Behavior
I should be able to generate separate SBOMs for
browser-app
andelectron-app
by runningcdxgen -o sbom.json
inside each respective subfolder.Alternatively, running
cdxgen -o sbom.json ./browser-app
frommyproj/theia-app/
should work.Environment
Question
What do I need to do in order to generate separate SBOMs for
browser-app
andelectron-app
without encountering thenpm install has failed
issue? Is there a specific flag or workaround to make this work in subfolders of a workspace-based project?The text was updated successfully, but these errors were encountered: