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

Please change ninja process exit code for 'no work to do' #2470

Open
LostTime76 opened this issue Jul 17, 2024 · 1 comment
Open

Please change ninja process exit code for 'no work to do' #2470

LostTime76 opened this issue Jul 17, 2024 · 1 comment

Comments

@LostTime76
Copy link

LostTime76 commented Jul 17, 2024

It would be beneficial if the exit code of the ninja process for 'no work to do' = 0 and 'build success' = 0 are differentiated with different values. The reason is because there is a use case where one may want to determine if anything was actually built and run something else based on this distinction. For my use case, I am just using ninja to compile. nothing else. If something was actually compiled, I need to relink, but if nothing was built, I don't need to relink. Before I relink I have to generate additional files each time. In the non relink case I want to avoid generating those files.

I think this could be done several ways.

  1. Either you just change the return code in the 'no work to do case' to something unique and other than 0
  2. Provide a command line argument for users that want to do what I am doing so they can change the code themselves:
    --no_work_to_do_exit_code=2. This would keep backwards compatibility for existing tools.

For now, I have checked out the code myself and it was easy to build it. This is the change I made and it works for what we need.

image

@scivision
Copy link
Contributor

In my opinion, this should be a command line option as you suggest. Thinking like curl etc.

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