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

Warnings printed to stderr, --no-warning partially ignored #2083

Closed
poshul opened this issue Dec 7, 2024 · 3 comments · Fixed by #2084
Closed

Warnings printed to stderr, --no-warning partially ignored #2083

poshul opened this issue Dec 7, 2024 · 3 comments · Fixed by #2084

Comments

@poshul
Copy link

poshul commented Dec 7, 2024

Expected Behavior

Warnings should be printed to stdout not stderr. --no-warning should silence warnings

Actual Behavior

warnings are printed to stderr. passing --no-warning does not silence warnings.

Example output:

with --no-warning

py_venv) samuel@Wald2:~/git/OpenMS$ cwltool --no-warning --validate --non-strict share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:21:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#db_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:24:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#digest_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:33:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#exp_ms2_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:18:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#id_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:27:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#lfq_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:15:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:30:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#theo_ms2_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl is valid CWL.

without --no-warning:

(py_venv) samuel@Wald2:~/git/OpenMS$ cwltool --validate --non-strict share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl 1>/dev/null
INFO /home/samuel/Downloads/py_venv/bin/cwltool 3.1.20241112140730
INFO Resolved 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl' to 'file:///home/samuel/git/OpenMS/share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl'
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:21:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#db_out' previously defined
WARNING share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:21:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#db_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:24:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#digest_out' previously defined
WARNING share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:24:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#digest_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:33:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#exp_ms2_out' previously defined
WARNING share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:33:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#exp_ms2_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:18:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#id_out' previously defined
WARNING share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:18:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#id_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:27:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#lfq_out' previously defined
WARNING share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:27:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#lfq_out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:15:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#out' previously defined
WARNING share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:15:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#out' previously defined
share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:30:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#theo_ms2_out' previously defined
WARNING share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl:30:3: object id 'share/OpenMS/commonwl/NucleicAcidSearchEngine.cwl#theo_ms2_out' previously defined
@mr-c
Copy link
Member

mr-c commented Dec 9, 2024

Warnings should be printed to stdout

For cwltool --validate that could be okay, but for the normal use of cwltool to execute a CWL document, we can't print warnings to stdout as the output of cwltool is the JSON CWL output object representing the results of the execution.

I agree that --no-warning should silence the previously defined messages (which come from Schema Salad)

@poshul
Copy link
Author

poshul commented Dec 9, 2024

For our CI purposes, as long as --no-warning silences the warnings we don't care too much where they'd get printed otherwise, so if changing that (even for --validate only) is problematic I'm okay just not doing it.

@mr-c
Copy link
Member

mr-c commented Dec 9, 2024

@poshul a fix for --no-warnings to not print warnings is incoming. But maybe more interesting is that --validate will have all warnings and errors in stdout, so maybe you won't need --no-warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants