earthmover icon indicating copy to clipboard operation
earthmover copied to clipboard

Jinja imports broken in package composition

Open alchenist opened this issue 1 month ago • 0 comments

Jinja allows imports. This works in standalone projects, but breaks on composition in a few ways:

  • An earthmover project can have a config YAML file import some Jinja; however, installing that project as a dependency in another project via earthmover deps fails because the import statement now looks in the wrong directory when rendering that config.
  • A destination template can also import some Jinja and work outside of package composition; however, earthmover run fails because earthmover looks for the template from the root directory of the importing project.

Somewhat minimal reproducible example attached in jinja_em_composition.tar.gz:

  1. dependency represents an earthmover project with a Jinja import in its config YAML.
    • Running earthmover compile -c dependency/earthmover.yaml demonstrates that the import in the config is valid Jinja and produces a valid earthmover_compiled.yaml.
    • running earthmover run -c dependency/earthmover.yaml demonstrates that the import in the template is valid Jinja and produces valid output.
  2. Running earthmover deps -c earthmover.yaml from the root directory should fail: ERROR Jinja syntax error in YAML configuration template, near line 3 ('template.jinja' not found in search path: '.')

alchenist avatar Nov 20 '25 22:11 alchenist