Skip to content

Conversation

@j-luong
Copy link
Contributor

@j-luong j-luong commented Dec 2, 2025

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages
    are release-note ready, emphasizing
    what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

What does this PR do?

This PR fixes an issue where an unsupported glibc version will result in a generic error catalog error and an exit code 1 for some Snyk commands.

We will not exit code 2 and provide a more useful RequirementsNotMet error catalog error.

Where should the reviewer start?

How should this be manually tested?

What's the product update that needs to be communicated to CLI users?

@j-luong j-luong force-pushed the fix/cli-1230_glibcChecker branch from 99a68d9 to 4027467 Compare December 3, 2025 15:14
@j-luong j-luong force-pushed the fix/cli-1230_glibcChecker branch from 4027467 to 7546c5a Compare December 3, 2025 16:23
// ValidateGlibcVersion checks if the glibc version is supported and returns an Error Catalog error if it is not.
// This check only applies to glibc-based Linux systems (amd64, arm64).
// Optionally accepts a custom GlibcVersion, mainly for testing.
func ValidateGlibcVersion(opt ...GlibcVersion) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Move the glibc validation logic and constants close to the legacycli workflow, since the requirement comes from there. The logic to return the glibc version can be here.

}

// detectGlibcVersion attempts to detect the glibc version on Linux systems
func detectGlibcVersion() (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: I think we do have plenty of examples on the structure of the ldd output, maybe we can improve the implementation by using this knowledge and adding tests for the different cases? Adding tests for the extraction logic would require it to be callable with a string though. But this would actually implement IOSP. So probably worth it.

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.

3 participants