(Last updated on Oct 20, 2021)
You have created a language based on the mbeddr platform, MPS Extensions, or KernelF (or all of the above). Now the time
has come to create a build script for your language to package it for delivery to the users. However, after creating the
build script you get an error message saying
Error: dependency on a module not visible from current build project:
What is going on here?
jetbrains.mps.samples.theSimplestLanguage.sandbox depends on a module1 (here
org.iets3.core.base) but the build script doesn’t have the information required to locate this module.
Even though you can build the project successfully from MPS, the build language is designed to describe your project on a lower level. Rather than depending on libraries or plugins, build scripts depend on other build scripts. Build scripts produce artifacts in a certain layout and the build scripts that depend on them expect to find these artifacts in a certain location in this exact layout.
Is the dependency required?
Before continuing, check (or ask yourself) whether the dependency is indeed intentional and required. You could have added it by accident (it’s very easy to just press Enter in response to a pop-up dialog that MPS shows when importing models). Or perhaps it was required by an intermediate version of the code but is no longer necessary in the final version.
To check, open the properties of the depending module. If the dependency is grayed out, it means it is unused and you can remove it.
Adding missing dependencies
Switch from plugins to project libraries
If you have installed your dependencies from the JetBrains Marketplace as plugins, you will need to switch to using project libraries:
- Download the corresponding distribution from GitHub or itemis Nexus.
- Unpack the distribution into a folder. I recommend using a subdirectory of your MPS project directory, such as
- Add the unpacked distribution as a project library. You can also add the entire
Add the dependency to the build script
- Open the build script of your project and go to the
- Press Enter to add a new entry.
- Import the model containing the build script you want to add. Do it either by using the usual Ctrl/Cmd+R shortcut and typing the build script name or by using Ctrl/Cmd+M and searching for the model containing the build script.
(to have the
(artifacts location .)text appear. Replace the
.with the location of the distribution. Example:
The result should look like this:
After adding the dependency use the Reload modules from disk intention to update the module dependencies and the error should disappear.
Build scripts of popular libraries
Here are the build scripts you need to depend on for some of the popular libraries (as of October 2021). The build script link opens the script in MPS:
|Project||Build Script||Containing Model|
- Kolja Dummann has recorded a Twitch stream on the topic of setting up the build of an MPS project. The video is part of the “Heavy Meta” series of videos about MPS.
This is of course just an artificial dependency added to
theSimplestLanguagesample project for demonstration purposes. ↩︎