Skip to content

Make :seo_jsonld compiler recursive so it works in umbrella projects - #23

Merged
dbernheisel merged 1 commit into
dbernheisel:mainfrom
ssbb:umbrella-recursive-compiler
Jul 17, 2026
Merged

Make :seo_jsonld compiler recursive so it works in umbrella projects#23
dbernheisel merged 1 commit into
dbernheisel:mainfrom
ssbb:umbrella-recursive-compiler

Conversation

@ssbb

@ssbb ssbb commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Running mix compile from an umbrella root crashes with:

** (RuntimeError) trying to access Mix.Project.app_path/1 for an
umbrella project but umbrellas have no app

Because the compiler is not marked recursive, an umbrella mix compile dispatches it mid-recursion via Mix.ProjectStack.on_recursing_root/1, which switches the active project to the umbrella root. sources_dir/0 (and compile_path/0/manifest_path/0) then call Mix.Project.app_path/0, which raises for an umbrella.

Marking the compiler @recursive true keeps it executing in the child app that lists it in :compilers, so the project-path helpers resolve correctly. Non-umbrella projects are unaffected.

Running `mix compile` from an umbrella root crashes with:

    ** (RuntimeError) trying to access Mix.Project.app_path/1 for an
    umbrella project but umbrellas have no app

Because the compiler is not marked recursive, an umbrella `mix compile`
dispatches it mid-recursion via `Mix.ProjectStack.on_recursing_root/1`,
which switches the active project to the umbrella root. `sources_dir/0`
(and `compile_path/0`/`manifest_path/0`) then call `Mix.Project.app_path/0`,
which raises for an umbrella.

Marking the compiler `@recursive true` keeps it executing in the child
app that lists it in `:compilers`, so the project-path helpers resolve
correctly. Non-umbrella projects are unaffected.
@dbernheisel

Copy link
Copy Markdown
Owner

Thanks for the report and PR!

@dbernheisel
dbernheisel merged commit f023db0 into dbernheisel:main Jul 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants