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

Add absolute -> relative mode #112

Open
elliotgoodrich opened this issue Nov 7, 2024 · 0 comments
Open

Add absolute -> relative mode #112

elliotgoodrich opened this issue Nov 7, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@elliotgoodrich
Copy link
Owner

As mentioned here, we have an issue if Ninja uses absolute paths (CMake generates absolute paths for inputs for example) and those paths contain the name of the workspace, which differs across machines, e.g. C:/myserver1/projectX and C:/myserver73/projectX).

To fix this we could introduce a new mode --make-relative to trimja, which would:

  1. Rewrite all inputs, outputs, order-only dependencies, and validations as relative if they were absolute. When Ninja runs against this new build file it will generate the build commands and build log using the relative path. There's a possibility that commands here fail because they expect an absolute path or have a different working directory.
  2. Rewrite the .ninja_deps file and replace all absolute paths with relative ones. depfile generating commands can (and do) generate absolute paths so these need to be updated.
@elliotgoodrich elliotgoodrich added the enhancement New feature or request label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant