-
Notifications
You must be signed in to change notification settings - Fork 698
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
[nix-local-build] new-run, new-test, new-bench, new-exec #3638
Comments
So, I guess, if you say |
Note that however this gets implemented, make sure it works with |
Would it be possible to add new-exec to this list? I prefer using |
@elliottt on that topic, we should decide if that would be the better behaviour anyway and/or add a flag to repl to control it. I'm not sure if there's a ticket for it, but if not please open one and explain the advantages/disadvantages. |
I spent a little time looking at how to implement
|
@ezyang I don't understand why it's so difficult. Isn't it just a matter of doing what new-build does for an exe target, ie making sure it's up-to-date, and then executing it? Sure we have to check that the target the user has given does correspond to an exe. Not so hard. Then that gives us an elaborated plan that's up to date for the exe, and we can read off from that where the exe lives in the file system, then we just run it. If a "no rebuild" mode is needed, then we just make sure the plan is up to date, read off the location of the executable from the elaborated plan, checking the exe exists, and do the same invocation. And yes, the logic for invoking needs to be ported from What am I missing? |
Ok, so the runProjectPreBuildPhase should return the resolved targets selected. That'd be most direct. I'm doing some refactoring in ProjectOrchestration so I can do this. |
FWIW, there is bare bones |
#4304 has |
Per @dmwit, |
@dcoutts @ezyang @dmwit I notice with #4179 merged, there's now
So, this sounds like we're almost there? is the only thing left to do actually invoke the produced executable component now? |
@hvr yes, new-run and new-bench CLI bits are in but they only build the things, they don't yet run. |
Let's track the new-run business at #4477 |
I should note that this syntax is ambiguous: does |
Tracking the args issue at #4643 |
IMHO, everything left of To keep things simple (and avoid clever heuristics), this would imply that the use of Some examples to clarify what I mean:
We can still support per-test-component flags via
|
Our cmdline parser currently doesn't provide the information about the relative position of |
Summary by @ezyang. These should be easy to do, it's a copy-paste job of the existing run/test/bench code on top of invoking the new-build logic to build things.
These are very important quality-of-life features that make it impractical to use
new-build
for some of our larger projects. In general, we'd be happy with straightforward ports of the legacy commands, but a couple specific comments arose.Avoiding unnecessary work
This is a lot more important when working with metapackages, since we don't want to have to build every test suite in the metapackage in order to build one particular test. The way the
[COMPONENTS]
argument currently works fornew-build
should be fine for this.Easier argument passing for test and bench
cabal run [FLAGS] [EXECUTABLE] [-- EXECUTABLE_FLAGS]
makes it easy to pass arguments to the executable by just putting them after the--
. It would be nice to have the same fortest
andbench
, rather than having to use--test-options
or--benchmark-options
flags.The text was updated successfully, but these errors were encountered: