Feature(launch): let --assets-path add assets roots to the core one - #47
Open
cmoron wants to merge 1 commit into
Open
Feature(launch): let --assets-path add assets roots to the core one#47cmoron wants to merge 1 commit into
cmoron wants to merge 1 commit into
Conversation
A consumer project could not use `lotusim run` with a world of its own that also includes a model from the core catalogue: --assets-path replaced the assets root instead of adding to it, so one had to choose between the two. The core root is now always searched first and --assets-path appends to it, so a scenario keeps its assets in its own repository and still runs through the supported entry point. The option takes a colon-separated list, like the GZ_SIM_RESOURCE_PATH it feeds, and stays repeatable; both forms append. A missing world now names every root searched instead of failing later in gz. Shell completion follows the same roots, so worlds living outside the core are offered too. This changes what a single --assets-path does: it used to replace the core root, it now adds to it. Nothing in the repository, the CI, the docs or LOTUSim-generic-scenario passes the option today, and the previous behaviour was what made out-of-tree scenarios impossible in the first place. Covered by launch/tests/test_assets_path.sh. Refs naval-group#46 Assisted-by: Claude Opus 5 (claude-opus-5) via Claude Code Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Cyril Moron <cyril.moron@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46.
What
--assets-pathnow adds an assets root instead of replacing the core one, so aproject that consumes LOTUSim can keep its own worlds and models in its own
repository and still run them through
lotusim run:The core catalogue stays available — the sailboat from
assets/modelsand the buoyfrom the scenario resolve in the same world.
Details
--assets-pathappends after it.--assets-path "$A:$B") and isrepeatable (
--assets-path $A --assets-path $B). Both forms are equivalent — thecolon form mirrors the
GZ_SIM_RESOURCE_PATHthis feeds.failing there with a less obvious message.
Behaviour change, stated plainly
A single
--assets-pathused to replace the core root; it now adds to it.We looked for callers before changing this: the option appears nowhere in this
repository, its CI, its documentation, the wiki, or LOTUSim-generic-scenario — only
in the completion script's option list. The replacing semantics were also the direct
cause of the limitation in #46. If you would rather keep them untouched, we are happy
to move the additive behaviour behind a separate flag.
There is no longer a way to exclude the core root. Nobody asked for that isolation and
an extra search entry is harmless, so we did not invent a flag for it.
Verification
launch/tests/test_assets_path.shis self-contained: it builds two throwaway assetsroots under
mktemp -d, touches nothing in the workspace, and needs only a builtLOTUSim environment.
It covers the unchanged default, the additive single option, both multi-root forms and
their equivalence, world resolution from the owning root, the error message, and
completion. The decisive case is an A/B on gz itself: a world in root B that includes
model://alphafrom root A loads with both roots and fails withUnable to find uri[model://alpha]without root A — so the test would notice if thecomposition silently stopped working.
Note for anyone reproducing it: the check needs
--debug, because at the default-v0gz reports nothing and the A/B would prove nothing.Run against
ghcr.io/naval-group/lotusim(Jazzy / Harmonic,noble).Not included
The wiki lives in its own repository, so the
--assets-pathentry in Getting-Startedis not part of this PR. Happy to send that separately if useful.
Assisted-by: Claude Opus 5 (claude-opus-5) via Claude Code.