-
Notifications
You must be signed in to change notification settings - Fork 414
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
[RFC] Add support for building menhir in workspace #2365
Conversation
I think we've encountered problems similar to this one in the past and Jeremie even proposed a general solution: #1185 I'm not against the solution proposed here as a temporary means, but I think that we should converge towards the relocation library eventually. |
Agreed, having a general solution would be nice since this is a general problem. However, it will take some time to develop it, mature it and get it adopted. So the proposed PR seems fine indeed. |
Regarding the implementation, what about systematically passing |
I thought about that, but there are some complications:
Of course we could do what you suggest when it is possible (if a |
Ok, if we still need the fallback let's not bother. |
@nojb, this is ready to merge BTW :) |
Ok, I'm merging this with the caveat that it may be tweaked before the |
Ah, sorry I missed that point in your original comment! If you expect that things might change, then I agree that it's definitely a good idea to wait until it's ready :) |
Somewhat related (not that much, but I didn't know where else to complain): the path to this This is actually very annoying. |
I agree!
Adding an option to Copying it into the |
Sure, that last bit is less important. (I can make my own adhoc rule in dune files if the subcommand exists). Ping @fpottier |
Do you think #2483 could have been also a solution if menhir had an environment variable to replace the option |
I guess that if an environment variable was available, then indeed |
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.
This feature needs some tests and an appropriate change log entry. Also, shall we enable it only for a newer version of the menhir extension?
I will try to add some tests. For the second question, I don't think it is worth versioning this change, since it applies only when menhir is built out of the workspace, which is not possible with any of the released versions of menhir. |
Signed-off-by: Nicolás Ojeda Bär <[email protected]>
For info, we ended up solving this problem in a different way (we embed the file in question directly inside the executable), so this PR is no longer needed. See https://gitlab.inria.fr/fpottier/menhir/merge_requests/10 for the details. |
(by the way, this also fixes the problem reported by @trefis due to changing line directives) |
Awesome, thanks @nojb! |
I am working on porting
menhir
to dune (there is initial agreement from the author, see https://github.com/nojb/menhir/tree/switch_to_dune if interested). It looks like we need a small change todune
so that the(menhir ...)
stanza can work with amenhir
which is in built out of the current workspace.The situation is very similar to
js_of_ocaml
: when executed,menhir
needs to find a "standard library" file (calledstandard.mly
), but the location of this file is chosen at installation time and is then hard-coded in the executable so it won't work before the executable is installed. Luckily one can override the standard library directory on the command-line by passing a--stdlib
option.This PR makes it so that when there is a
menhir
package in the current workspace,menhir
invocations add the necessary flag so that the standard library can be found.Note that this is a theoretical point right now as there isn't a released
menhir
that can be built withdune
yet (but this patch can be tested with the branch referenced above).In any case, I do not want to merge this now because things may change with the switch to
dune
but rather to put it out there for discussion.Thanks!