Skip to content
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

Fix pnpm and yarn lock file detection #1643

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Conversation

konstantinas1
Copy link
Contributor

This PR aims to fix issues described in #1642.

When a pnpm-lock.yaml or yarn.lock files are not present in the root directory cdxgen fails to detect them. This causes cdxgen to try and install dependencies without using the lock file in the first place.

To reproduce on v11.1.8 have a pnpm-lock.yaml file in /frontend and run: CDXGEN_DEBUG_MODE=debug cdxgen $(pwd)

Scanning /Users/konstantin/Documents/GitHub/my-app
Performing babel-based package usage analysis with source code at /Users/konstantin/Documents/GitHub/my-app
Executing 'pnpm install' in /Users/konstantin/Documents/GitHub/my-app/frontend
pnpm install has failed. Generated SBOM will be empty or with a lower precision.

Cdxgen fails to detect the lock file and tries to install dependencies based on package.json.
Same problem exists for yarn.lock.

Signed-off-by: konstantinas1 <konstantin.averkin@nedap.com>
Signed-off-by: konstantinas1 <konstantin.averkin@nedap.com>
Copy link
Collaborator

@prabhu prabhu left a comment

Choose a reason for hiding this comment

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

Thank you!

@prabhu prabhu merged commit 8f161cb into CycloneDX:master Feb 20, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants