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

entry points return non-zero exit code (at least for --help) #978

Closed
h-vetinari opened this issue Feb 20, 2024 · 2 comments
Closed

entry points return non-zero exit code (at least for --help) #978

h-vetinari opened this issue Feb 20, 2024 · 2 comments

Comments

@h-vetinari
Copy link
Contributor

Thanks a lot for the many clean-ups in 0.2.0! I was able to reduce the patches necessary for #876 quite substantially, I'll update that issue soon-ish.

In the meantime, I'm running into a new error that I need to figure out... As part of the integrity checks for the built package, we test that we can call the various CLI entry points without errors - for simplicity only with --help. For 0.1.99 and before this worked fine, but now I get:

+ spm_decode --help
spm_decode: Warning: SetProgramUsageMessage() never called

  Flags from src/spm_decode_main.cc:
    --extra_options (':' separated encoder extra options, e.g.,
      "reverse:bos:eos"); default: "";
    --input (input filename); default: "";
    --input_format (choose from piece or id); default: "piece";
    --model (model file name); default: "";
    --output (output filename); default: "";
    --output_format (choose from string or proto); default: "string";

Try --helpfull to get a list of all flags or --help=substring shows help for
flags which include specified substring in either in the name, or description or
path.

and then a non-zero exit code which generally indicates some sort of failure. This happens on all unix builds (windows is running into an unrelated problem that I'm in the process of fixing).

@h-vetinari
Copy link
Contributor Author

@taku910, could you comment on whether the non-zero exit code for --help is expected in 0.2.0?

@taku910
Copy link
Collaborator

taku910 commented Feb 26, 2024

This behavior happens when using the official abseil library with -DSPM_ABSL_PROVIDER=module.
However, it turned out that it is the correct and intended behavior. The previous and default abseil-flag-compatible library was not correctly ported. We've changed the return code to be 1 not zero, which is the same as the official abseil library.

@taku910 taku910 closed this as completed Feb 26, 2024
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

No branches or pull requests

2 participants