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

Ensure commands always silent for MSVC #80

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Apr 11, 2020

If a command is routed through bash because it's too long, the fact it's meant to be piped to NUL is forgotten. Ensure the bash command is piped to >/dev/null (with the slightly tedious recovery of the script needed if the command fails).

#68 needs to be merged first, because it corrects a magic number in this PR

let oc = open_out fn in
output_string oc cmd;
close_out oc;
ignore (Sys.command invoke)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the purpose of running the command again without the redirection? We don't do that in the "direct" case (where bash is not used); and we might get errors (printed to stderr) twice.

Copy link
Member Author

@dra27 dra27 Apr 22, 2020

Choose a reason for hiding this comment

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

Yes we do - see deleted lines 224 and 225 below.

It's a good point, though - the treatment on the other branch is for MSVC where errors are also sent to stdout. I think the correct thing is probably to do &>/dev/null on this side and a belt-and-braces 2>&1 on the other?

Copy link
Member Author

Choose a reason for hiding this comment

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

The whole lot exists to get rid of those pesky "foo.c" lines from MSVC...

If a command is routed through bash because it's too long, the fact it's
meant to be piped to NUL is forgotten. Ensure the bash command is piped
to >/dev/null (with the slightly tedious recovery of the script needed
if the command fails).
@dra27
Copy link
Member Author

dra27 commented Mar 2, 2021

Rebased and I think ready to merge?

@dra27 dra27 merged commit a0a90ce into ocaml:master Nov 29, 2021
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