Repository navigation
Description
I've been converting a few of my own libraries to use jbuilder. It's gone fairly well so far, so thanks :) (and sorry for the influx of issues, I'll quiet down soon I promise ;))
But a number of times I've hit a wall when jbuilder says "nope", but I can't find a way to get more information about what it tried or why it couldn't do what I asked. Here's an example:
$ jbuilder build _build/default/examples/todomvc/main.bc.js
Don't know how to build _build/default/examples/todomvc/main.bc.js
Well.. there should be a build target there. In these sorts of cases I'd love some flags which enable logging about:
- what
jbuildfiles it's loading - what targets are defined in the given directory
- if I'm getting really desperate, what targets are defined in the entire workspace
In this case, the only troubleshooting I could do was:
ls examples/todomvc/main.ml(yep, it's there)cat examples/todomvc/jbuild(yep, it defines an executable called "main")
At which point I'm pretty much out of ideas.
In the end, I figured out that I had created a bad jbuild-workspace - it was empty (which is documented as equivalent to (context default), but maybe that's not implemented in beta12?). I expect doing any sort of dump of "which targets are defined" would have more quickly pointed to a project-wide issue, as it would have been empty.
I eventually figured it out by trying other targets which had previously worked, and they could no longer be found. This process wasn't obvious either though, since top-level targets still seemed to kind of work (until I did a clean, then they became suspicious):
jbuilder build vdoml.install- successfully built the install file, but didn't build any of the files it depends onjbuilder build @install- didn't appear to build anything (but didn't fail either)
Activity
timbertson commentedon Oct 2, 2017
"Did you mean" is neat, but it's probably only going to work for typos - if it only gives you zero or one suggestion, it's not likely to be a good debugging aid, where you often want to scan the list of what's available to pick out patterns or surprises.
I tried
jbuilder rules, but it wasn't happy:I don't depend on utop anywhere, and I have a
src/directory but nosrc/.utop. I'm assuming it's a builtin thing?rgrinberg commentedon Oct 10, 2017
@timbertson utop is necessary for launching utop toplevels (
$ jbuilder utop). Its absence shouldn't be breaking$ jbuilder utopthough. That's an annoying deficiency.rgrinberg commentedon Sep 21, 2018
What I think might help here is a command to print targets. Would something like
$ dune targets <dir>be useful for you @timbertson ?timbertson commentedon Sep 21, 2018
rgrinberg commentedon Sep 21, 2018
The team is pretty busy at the moment, so it's unlikely that we'll get to tackle this in the near/medium future. But if you'd like we can guide on how to implement this feature. It shouldn't be too difficult.
timbertson commentedon Sep 22, 2018
feature: dune targets
feature: dune targets
feature: dune targets
feature: dune targets
9 remaining items
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases
feature: dune show targets and dune show aliases (#7770)
[new release] dune (15 packages) (3.9.0~alpha1)
[new release] dune (15 packages) (3.9.0)