-
Notifications
You must be signed in to change notification settings - Fork 412
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
Fix the priority order for environment variables between workspace and context #2476
Conversation
@nojb Perhaps you can take a look. |
I propose to change that relative path are absolutize with respect to the build directory instead of the source directory, since it is where things should be. It forces to have the right dependencies. |
I am not sure about this; if I understand correctly this is the right thing to do only if the binaries are being managed by Suppose that I have a toplevel
after this change it will have be
is that right? |
The dune-workspace is the same, you just add a |
This won't work for the compiler tools for example, which is one of the use-cases of #2426 . |
Oh, I though your compiler tools were in absolute directories. Sorry. In your case does |
I will give it a try, but I don't think we currently expand variables when interpreting |
I gave it a try; indeed variables are not expanded so that would need fixing, but by writing an absolute path by hand it seems to work fine. Do you think you could look into the issue of variable expansion? |
Now the variable is expanded. However since we are very early, the context record is not yet built and so I couldn't use |
We probably want to do this properly, so I would be OK if you merge your PR without the expansion of variables, and we look at that properly in a later PR. |
between workspace and context. Use `env-vars` from the `dune-workspace` for dune. Signed-off-by: François Bobot <francois.bobot@cea.fr>
Signed-off-by: François Bobot <francois.bobot@cea.fr>
Ok so I removed the last commit and created a new merge request with the last commit (not based on this PR) |
I haven't read this PR in detail, but just one important detail to keep in mind: currently, when Dune looks up a binary in the This is obviously incorrect if the Reading the discussion, I get the feeling that this PR allows to have parts of |
@@ -1,3 +1,3 @@ | |||
(executable | |||
(name hello) | |||
(promote (until-clean))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need $ make fmt
here
$ dune build | ||
$ dune build bin/hello.exe | ||
|
||
$ dune build @default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why $ dune build @default
over just $ dune build
?
@bobot will be able to give the definite answer, but yes, I think that all relative paths will now be interpreted relative the build directory. |
Ok, so that cannot work in the current world. We could change the way dune resolves binaries to make it work (which would be really nice!), but in the meantime components of |
@bobot please re-open if you rebase. |
Use
env-vars
from thedune-workspace
for dune use.