Skip to content

Ensure commands always silent for MSVC - #80

Merged
dra27 merged 1 commit into
ocaml:masterfrom
dra27:long-quiet-command
Nov 29, 2021
Merged

dra27 merged 1 commit into
ocaml:masterfrom
dra27:long-quiet-command

Conversation

@dra27

@dra27 dra27 commented Apr 11, 2020

Copy link
Copy Markdown
Member

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

@dra27
dra27 force-pushed the long-quiet-command branch from f9124f5 to 5a52106 Compare April 21, 2020 19:39
Comment thread reloc.ml
let oc = open_out fn in
output_string oc cmd;
close_out oc;
ignore (Sys.command invoke)

Copy link
Copy Markdown
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.

@dra27 dra27 Apr 22, 2020 •

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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...

@dra27
dra27 force-pushed the long-quiet-command branch from 5a52106 to 92ee954 Compare March 2, 2021 14:18
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
dra27 force-pushed the long-quiet-command branch from 92ee954 to 09a34ad Compare March 2, 2021 14:20
@dra27

dra27 commented Mar 2, 2021

Copy link
Copy Markdown
Member Author

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