Repository navigation
Use native Bazel commands for live GraalVM development - #67
Conversation
There was a problem hiding this comment.
Devin Review found 2 potential issues.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| roots = tuple(watch_dirs) | ||
| for path, source in sources.items(): | ||
| for parent in source.parents: | ||
| if parent in roots: | ||
| break | ||
| watch_dirs.add(parent) |
There was a problem hiding this comment.
🟡 New sources missed in empty directories
When a developer adds a source to an existing empty subdirectory, scan has left that directory unwatched. The addition leaves the watched parent listing unchanged, so Bazel keeps using a graph without the new source.
Learn more
The live repository links in only the files listed by scan. Bazel refreshes the repository when one of the directory listings registered by _live_repository_impl changes. Each listing covers immediate entries only. A directory with no inventoried files beneath it never gets registered unless it is a checkout or suite root.
Example: Create an empty fixture subdirectory, query the live Truffle targets, and then add a SimpleLanguage fixture to that subdirectory without staging it. A second query still omits the target that the fixture generator would emit, because the only changed directory listing was not registered.
Recommended fix: Inventory watchable directories independently of inventoried files, including empty source directories. Keep Git internals out of that traversal. Add a qualification case that creates a fixture in a directory that was empty during the previous fetch and queries its new target without forcing a refresh.
Was this helpful? React with 👍 or 👎 to provide feedback.
| helper = ctx.path(ctx.attr._helper) | ||
| for label in ctx.attr._graph_inputs + ctx.attr.patches: | ||
| ctx.watch(label) |
There was a problem hiding this comment.
🟡 Live graph skips two cache inputs
Editing only _helper or the HSDIS lock leaves the cached live graph valid. Bazel does not watch _helper through ctx.path(), and the lock is absent from _graph_inputs. The next dev command skips updated discovery or HSDIS compatibility validation.
Learn more
The live repository runs a Python helper to discover checkouts, generate BUILD files, and run check_input_pins. That check compares each generated JSON file with its committed counterpart. The generator emits an HSDIS pin, which the compiler's disassembler targets consume through the HSDIS repository rule. Bazel 9.3.3 disables implicit watches on labels passed to ctx.path(), and neither the helper nor the committed HSDIS lock gets an explicit watch.
Example: Fetch the live repository, change just the helper's discovery logic, and run another dev query. Bazel reuses the previous BUILD files, so the query does not exercise the revised helper.
Recommended fix: Explicitly watch ctx.attr._helper and add Label("//graal:hsdis.json") to _graph_inputs. This makes a change to either file invalidate an existing fetch.
Was this helpful? React with 👍 or 👎 to provide feedback.
Use Bazel's dev configuration to select live GraalVM checkouts next to rules_mx.
bazel test --config=dev @graal//graalpython:jvm_standalone_testThe repository rule generates the mx and Gazelle overlay inside Bazel's external repository. It watches file additions, removals and suite metadata. Edits to existing sources go directly into the compile and test graph. An ignored user.bazelrc can enable the configuration for plain Bazel commands.
The existing CI qualification uses the same Bazel profile. It edits Truffle, runs GraalJS and GraalPy, checks the five affected test results are cached on repeat, and tests the relocated GraalPy standalone.