Skip to content

Avoid redirecting cds compiler stdout #174

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

Conversation

data-douser
Copy link
Collaborator

Revokes the approach of redirecting stdout for 'cds compile' commands used in the CDS extractor. In some cases, stdout may contain more than just the contents of the generated JSON, which creates errors that are difficult to troubleshoot as they only occur in some environments.

Returns to the approach of using CLI arguments to instruct the CDS compiler to output to a specified path, and adds some logic to account for variations in CDS compiler behavior when using the '-o' or '--dest' CLI argument. Because some CDS compiler versions say that they output to a directory but actually output to a file, and some CDS compiler versions actually output to a directory as specified in the CLI docs, we trust the use of the '--dest' argument (more than we trust a redirect of stdout to a JSON file), but we verify whether the output is a regular '.cds.json' file or is, indeed, a directory.

Revokes the approach of redirecting stdout for 'cds compile' commands
used in the CDS extractor. In some cases, stdout may contain more than
just the contents of the generated JSON, which creates errors that are
difficult to troubleshoot as they only occur in some environments.

Returns to the approach of using CLI arguments to instruct the CDS
compiler to output to a specified path, and adds some logic to account
for variations in CDS compiler behavior when using the '-o' or '--dest'
CLI argument. Because some CDS compiler versions say that they output
to a directory but actually output to a file, and some CDS compiler
versions actually output to a directory as specified in the CLI docs,
we trust the use of the '--dest' argument (more than we trust a redirect
of stdout to a JSON file), but we *verify* whether the output is a
regular '.cds.json' file or is, indeed, a directory.
@data-douser data-douser self-assigned this Feb 27, 2025
@data-douser data-douser marked this pull request as ready for review February 27, 2025 15:08
Copy link
Contributor

@lcartey lcartey left a comment

Choose a reason for hiding this comment

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

I think we can consider the topic of whether we need to recursively scan the output directory in the rewritten JavaScript version. Thanks for the speedy resolution!

@data-douser data-douser merged commit c3d6d1c into advanced-security:main Feb 28, 2025
5 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