Repository navigation
fix(daemon): give solutions of generated presets the default output path - #227
Open
sergej-koscejev wants to merge 2 commits into
Open
sergej-koscejev wants to merge 2 commits into
sergej-koscejev wants to merge 2 commits into
Conversation
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
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.
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 nogeneratorOutputPathattribute, so their models generate.Why:
SolutionDescriptorPersistence(checked on MPS 2024.1 and 2026.1) saves anulloutput root asgeneratorOutputPath="", which means "no output path". An output root equal to${module}/source_genis saved as no attribute, which MPS reads back as the default.Sibling paths:
mops create solutionand Code Modeproject.createSolutionboth go throughModuleCreator.createSolution, so both get the fix. Edit batches do not create modules.Left as is:
not-generatedkeepsgeneratorOutputPath=""(see make: a not-generated solution is still generated and fails, sometimes with no message #226).<sourceRoot path="${module}/models" />where MPS writes<sourceRoot location="models" />. MPS loads both. Changing it means replacing theDefaultModelRoot.createDescriptorcall for languages and solutions, so it is not a one-line change and is not in this PR.Evidence
On MPS 2024.1.6 with
_theSimplestLanguage:Before:
mops create solution repro.java --usage-preset javawrites<solution … moduleVersion="0" generatorOutputPath="">;mops make module repro.javaafter adding a class fails withNo output location specified for model repro.java.main.mops teston ajava-testssolution reportsBUILD_FAILED.After: the
.msdhas nogeneratorOutputPathfor all four generated presets;make modulereportssuccessand writessource_gen/…/Example.javaandclasses_gen/…/Example.class;mops teston ajava-testssolution with a JUnit 3 test reportsSUCCESS: 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 ajava-testssolution withmops create solution, adds a model with a JUnit 3 test, thenmake modulesucceeds andmops test --no-buildpasses. Without the fix it fails atmakewith "no output location".Merge Danger
Blast Radius: small. Only descriptors of newly created solutions change.
Fixes #199