Skip to content

fix(daemon): give solutions of generated presets the default output path - #227

Open
sergej-koscejev wants to merge 2 commits into
mainfrom
fix/199-solution-output-path
Open

sergej-koscejev wants to merge 2 commits into
mainfrom
fix/199-solution-output-path

Conversation

@sergej-koscejev

Copy link
Copy Markdown
Member

Summary

Solutions created with a generated usage preset (text, java, java-tests, java-mps-plugin) now get the default output root ${module}/source_gen, like languages already did. MPS then writes no generatorOutputPath attribute, so their models generate.

 createSolutionModule(name, descriptor, preset)
   add facets for preset
+  if preset != NOT_GENERATED
+    outputRoot = "${module}/source_gen"

Why: SolutionDescriptorPersistence (checked on MPS 2024.1 and 2026.1) saves a null output root as generatorOutputPath="", which means "no output path". An output root equal to ${module}/source_gen is saved as no attribute, which MPS reads back as the default.

Sibling paths: mops create solution and Code Mode project.createSolution both go through ModuleCreator.createSolution, so both get the fix. Edit batches do not create modules.

Left as is:

Evidence

On MPS 2024.1.6 with _theSimplestLanguage:

  • Before: mops create solution repro.java --usage-preset java writes <solution … moduleVersion="0" generatorOutputPath="">; mops make module repro.java after adding a class fails with No output location specified for model repro.java.main. mops test on a java-tests solution reports BUILD_FAILED.

    After: the .msd has no generatorOutputPath for all four generated presets; make module reports success and writes source_gen/…/Example.java and classes_gen/…/Example.class; mops test on a java-tests solution with a JUnit 3 test reports SUCCESS: 1 passed.

New tests:

  • ModuleCreationSemanticsTest: solution of a generated preset keeps the default generator output path, one case per generated preset. Failed for all four before the fix.
  • CreatedSolutionIntegrationTest: creates a java-tests solution with mops create solution, adds a model with a JUnit 3 test, then make module succeeds and mops test --no-build passes. Without the fix it fails at make with "no output location".

Merge Danger

Blast Radius: small. Only descriptors of newly created solutions change.

Fixes #199

A solution created with the text, java, java-tests or java-mps-plugin
preset had no output root, so MPS saved generatorOutputPath="" and
could not generate its models. Set the output root to
${module}/source_gen, as for languages; MPS then omits the attribute.

Fixes #199
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.

create solution: generated presets write generatorOutputPath="", so the module cannot be generated

1 participant