Avoid redirecting cds compiler stdout #174
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.