Unable to build standalone IDE due to unknown circular dependency

Vladimir SitnikovToday at 00:46

I try to build a standalone IDE, and it fails.
Initially I had a circular references between concepts of my language. Then I fixed it, so "analyze module dependencies" shows no problems.

Build script fails with "you have circular dependencies". That happens even when "mps group" includes just one language.

Is there a way to debug that?




Code: https://github.com/vlsi/ide61131

6 comments

Build script@0 contains some strange ?language?: 

0

?language? were caused by missing "com.mbeddr.mpsutil" dependency in idea plugin group.

After I added it, st61131@0 looks as follows (no red parts), yet the same "circular dependency" error while rebuilding "build" solution:

 

build st61131 generates build.xml

base directory: ../../

use plugins:
java
mps

macros:
var date = date yyyyMMdd
var build.number = st61131-143.SNAPSHOT
folder mps_home = <no defaultPath>
folder mbeddr.github.core.home = <no defaultPath>

dependencies:
mpsStandalone (artifacts location $mps_home)
mpsMakePlugin (artifacts location $mps_home/plugins)
mps (artifacts location $mps_home)
mps-sl-all
com.mbeddr.platform

project structure:
idea plugin st61131
name st61131
short (folder) name st61131
description <no description>
version 1.0
<< no vendor >>
content:
st61131
dependencies:
jetbrains.mps.core
jetbrains.mps.execution.configurations
jetbrains.mps.debugger.api
jetbrains.mps.debugger.java
com.mbeddr.mpsutil
<< ... >>

mps group st61131
language com.github.vlsi.iec61131.types (4d1c59f7-8f87-4192-a752-a98136f0b57c)
load from ./languages/com.github.vlsi.iec61131.types/com.github.vlsi.iec61131.types.mpl
content:
model root ./languages/com.github.vlsi.iec61131.types/models
folder ./languages/com.github.vlsi.iec61131.types/source_gen (generated)
dependencies:
jetbrains.mps.baseLanguage.regexp
jetbrains.mps.kernel
extends jetbrains.mps.lang.core
extends jetbrains.mps.baseLanguage
JDK
use com.github.vlsi.iec61131.types
use com.mbeddr.mpsutil.grammarcells
use com.mbeddr.mpsutil.grammarcells.runtimelang
use com.mbeddr.mpsutil.iconchar
use jetbrains.mps.baseLanguage
use jetbrains.mps.baseLanguage.blTypes
use jetbrains.mps.baseLanguage.classifiers
use jetbrains.mps.baseLanguage.closures
use jetbrains.mps.baseLanguage.collections
use jetbrains.mps.baseLanguage.javadoc
use jetbrains.mps.baseLanguage.logging
use jetbrains.mps.baseLanguage.regexp
use jetbrains.mps.baseLanguage.tuples
use jetbrains.mps.lang.actions
use jetbrains.mps.lang.behavior
use jetbrains.mps.lang.constraints
use jetbrains.mps.lang.core
use jetbrains.mps.lang.editor
use jetbrains.mps.lang.quotation
use jetbrains.mps.lang.scopes
use jetbrains.mps.lang.sharedConcepts
use jetbrains.mps.lang.smodel
use jetbrains.mps.lang.structure
use jetbrains.mps.lang.textGen
use jetbrains.mps.lang.traceable
use jetbrains.mps.lang.typesystem
jetbrains.mps.devkit.language-design
use jetbrains.mps.lang.descriptor
runtime:
<no runtime>

generator com.github.vlsi.iec61131.types#5202852658697191353 (87a2bdd6-02f8-4646-b39b-c77ff58ad5b1)
source language com.github.vlsi.iec61131.types
content:
model root ./languages/com.github.vlsi.iec61131.types/generator/template
folder ./languages/com.github.vlsi.iec61131.types/generator/source_gen (generated)
dependencies:
com.github.vlsi.iec61131.types
use com.github.vlsi.iec61131.types
use jetbrains.mps.baseLanguage
use jetbrains.mps.baseLanguage.blTypes
use jetbrains.mps.baseLanguage.closures
use jetbrains.mps.baseLanguage.collections
use jetbrains.mps.baseLanguage.javadoc
use jetbrains.mps.baseLanguage.logging
use jetbrains.mps.baseLanguage.tuples
use jetbrains.mps.lang.core
use jetbrains.mps.lang.generator
use jetbrains.mps.lang.generator.generationContext
use jetbrains.mps.lang.quotation
use jetbrains.mps.lang.smodel
use jetbrains.mps.lang.traceable
jetbrains.mps.devkit.general-purpose


default layout:
import //languages
import //license
folder bin
import files from //bin
include log.xml
include log4j.dtd
file $mps_home/bin/idea.properties
replace regex "\.MPS(\w+)" /g -> \.${build.number}

folder lib
import files from //lib
exclude MPS-src.zip
exclude branding.jar
file ./lib/parser-1.0.0-SNAPSHOT-complete.jar
jar branding.jar
folder idea
xml file IdeaApplicationInfo.xml
<component>
<version codename="st61131" major="1" minor="0" eap="false"/>
<build number="${build.number}" date="${date}"/>
<logo url="/splash.png" textcolor="002387"/>
<about url="/about.png"/>
<icon size32="/MPS32.png" size16="/MPS16.png" size32opaque="/MPS32.png"/>
<dialogs-image url="/dialogImage.png"/>
<package code="code"/>
<names product="st61131" fullname="st61131"/>

<welcome-screen logo-url="/logo.png"/>



</component>

file ./icons/MPS16.png
file ./icons/MPS32.png
file ./icons/logo.png
file ./icons/splash.png
file ./icons/about.png
file ./icons/dialogImage.png

folder plugins
import //plugins/svn4idea
import //plugins/cvsIntegration
import //plugins/git4idea
import //mps-core
import //mps-execution-configurations
import //mps-execution-languages
folder st61131
folder META-INF
xml file plugin.xml
<idea-plugin version="2" xmlns:xi="http://www.w3.org/2001/XInclude">
<id>st61131</id>
<name>st61131</name>
<version>1.0</version>
<depends>jetbrains.mps.core</depends>
<depends>jetbrains.mps.execution.configurations</depends>
<depends>jetbrains.mps.debugger.api</depends>
<depends>jetbrains.mps.debugger.java</depends>
<depends>com.mbeddr.mpsutil</depends>

<extensions defaultExtensionNs="com.intellij">
<mps.LanguageLibrary dir="/languages"/>
</extensions>
</idea-plugin>

folder languages
folder st61131
jar com.github.vlsi.iec61131.types.jar
folder META-INF
module descriptor of com.github.vlsi.iec61131.types

compile output of com.github.vlsi.iec61131.types
files from ./languages/com.github.vlsi.iec61131.types
includes icons/**, resources/**
files from ./languages/com.github.vlsi.iec61131.types/source_gen
includes **/trace.info, **/exports

jar com.github.vlsi.iec61131.types-generator.jar
compile output of com.github.vlsi.iec61131.types#5202852658697191353

jar com.github.vlsi.iec61131.types-src.jar
folder module
sources of com.github.vlsi.iec61131.types (models only)

files from ./languages/com.github.vlsi.iec61131.types/generator/source_gen
exclude **/trace.info
exclude **/exports
files from ./languages/com.github.vlsi.iec61131.types/source_gen
exclude **/trace.info
exclude **/exports

properties file build.number
build.number = ${build.number}
date = ${date}
version = 1.0


workflow
task part for fetchDependencies
subtask fetch
ant
<mkdir dir="${build.tmp}/deps/mps-sl-all/mps-sl-all.zip"/>
ant
<unzip src="${artifacts.mps-sl-all}/mps-sl-all.zip" dest="${build.tmp}/deps/mps-sl-all/mps-sl-all.zip"/>
ant
<mkdir dir="${build.tmp}/deps/com.mbeddr.platform/com.mbeddr.mpsutil.zip"/>
ant
<unzip src="${artifacts.com.mbeddr.platform}/com.mbeddr.mpsutil.zip" dest="${build.tmp}/deps/com.mbeddr.platform/com.mbeddr.mpsutil.zip"/>


<not available>

0

Finally, I removed all languages/solutions but "very dummy solution" from the build scripts. That ensures build script work (at least, they produce executable binaries for OSX)

So the question is how to debug build script translator ("generator" in mps)?
It looks like I can set a break point there, however it does not stop there.

0

1. Have you udpated your build scripts after removing dependency cycle (Reload modules from disk)?

2. To debug MPS (e.g. generator) from MPS you need two separate MPSs. It can be done with "MPS Instance" run configuration. But I think this will be rather slow in your case.

3. You can also debug MPS from any java debugger, e.g. Intellij IDEA. For this you should enable debugger port before starting MPS, then connect debugger to MPS instance using this port and set breakpoints in generated java code.

 

0

1) Of course I did.

Then I remembered "death by using quotations" and converted all the quotations to light quotations ("find concept instances" shows zero entries for Quotation). Then I rebuilt ".types" language just in case. 

TL;DR: removing quotations did not help :(

2) Will see if I could get that working.

3) It means breakpoint should be set from within IDEA, right? Or it even supports setting breakpoints from MPS?

0

I've scanned through com.mbeddr.platform build script once again, and it turns out it uses bootstrap=true.

I think it might mean there's some cyclic dependency hidden in there.

0

Please sign in to leave a comment.