-
Notifications
You must be signed in to change notification settings - Fork 413
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
Jbuilder exec rebuilt if possible option #345
Conversation
d0b3f26
to
36f09c7
Compare
Right now the only caveat with this PR is the error handling. In some cases, we know the path must exist locally in the build system, so a build error is more appropriate than a not found error. |
BTW, I just saw the comments about For me the issue is the following, if you type: $ jbuilder build --dev bin/main.exe
$ jbuilder exec bin/main.exe then the second line will rebuild the executable from scratch since the compilation flags have changed globally. This is annoying but this is not specific to Regarding |
Thanks for clarifying @diml, I understand now. So I think it's just a matter of switch the flag to be |
I will also add the |
b410dc6
to
87062c6
Compare
87062c6
to
3a357b3
Compare
I had a quick look at the code, it looks fine to me. In the test case, I would prefer if the first error was something like: BTW, |
Done.
You only expect this to work for relative paths, right? Because to make it work in general, i.e. for things like
+1 |
Well, we can test if (** Returns the first file that the build system knows how to build *)
val find_buildable_target : t -> Path.t list -> Path.t option Future.t then we'd do calls such as
That'd make the code a bit simpler overall I think. |
OK, so then there's no more work in this PR to be done if we should do the refactoring to improve the error message. I'll create the relevant ticket for this work on this PR is merged then. |
resolve_targets -> resolve_targets_exn resolve_targets' -> resolve_targets
4f27ff5
to
4614d1d
Compare
only works for relative paths so far
3101dc6
to
302c20c
Compare
@diml i ended up implementing your error message improvement for all jbuilder exec variations because it was easy enough. |
OK, seems good |
This option turns out to be quite handy in practice. Been using it for the last day without major issues. I've elected to just make its own option for now because
--dev
seems like it would leave the user guessing. Maybe it's best to support both flags?Fix #317
cc @copy