-
Notifications
You must be signed in to change notification settings - Fork 410
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
Meaning of project_root and workspace_root variables #1848
Comments
There are intentionally no such paths. Accessing the source directories is considered to be bad practice and it risks breaking features such as multi context builds, source dir hygiene, and the |
I'm closing this as there are certainly no plans to compromise hygiene. Please let us know of concrete use cases and we'd be glad to consider them instead. |
The use case was to run a build command that depends on the output of running |
Ah, but this is a bit problematic when shipping tarballs for example. It means that the rules will no longer work in that mode. So you do need something a little more clever than just depending on .git. I've been considering to add a more general purpose git plugin for dune that would handle nuances such as this one. Which git calls are you doing? If it's just getting the commit information, why not use |
Right, our logic handles both cases, that the
The issue we ran into with So what we do now is put |
I think it might. I'm following that PR now and added a comment there. |
The documentation of the variables
project_root
andworkspace_root
is unclear to me. In a folder structure like this:I was hoping for:
%{project_root} = /home/me/big_project/sub_project
%{workspace_root} = /home/me/big_project
However, the actual values are:
%{project_root} = ../..
%{workspace_root} = ../../..
which is equivalent to:
%{project_root} = /home/me/big_project/_build/default/sub_project
%{workspace_root} = /home/me/big_project/_build/default
Is there any way to get the absolute paths to the source directories?
The text was updated successfully, but these errors were encountered: