non-wildcard imports in *.ts and *.nab files not working when building with mvn
(Hello, I am just starting to work with Spoofax 2.0.0 and it is my first time reporting an issue here. So I hope I give enough info to investigate the issue and am happy if I can help with more details.)
When building a Spoofax 2.0.0-beta1 project with
mvn clean install
I get the following error for all “non-wildcard imports” innab
andts
files (just an example error for a ts file, see below):[INFO] Building 23 sources, 0 includes of language impl. org.metaborg:org.metaborg.meta.lang.ts:2.0.0-beta1 [ERROR] ERROR in file:///home/dlehmann/projectname/trans/analysis/types/varkinds.ts:7 [ERROR] names/analysis/names/iterators [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] Unresolved reference [ERROR] [ERROR] ERROR in file:///home/dlehmann/projectname/trans/analysis/types/varkinds.ts:5 [ERROR] signatures/analysis/types/VarKinds-sig [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] Unresolved reference [ERROR] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------
Example file where the error occurs:
module analysis/types/varkinds imports signatures/- signatures/analysis/types/VarKinds-sig names/analysis/names/iterators type rules VarRef(r) + VarAssign(r) has varKind ik where definition of r has varKind ik or Local() => ik
Workaround with wildcard imports, no error when building:
module analysis/types/varkinds imports signatures/- signatures/analysis/types/- names/analysis/names/- type rules VarRef(r) + VarAssign(r) has varKind ik where definition of r has varKind ik or Local() => ik
src-gen/signatures/analysis/types/VarKinds-sig.str
exists after build and contains (excerpt):module signatures/analysis/types/VarKinds-sig imports signature constructors InArg : VarKind OutArg : VarKind Local : VarKind
and
Submitted by Daniel Lehmann on 23 May 2016 at 19:27src-gen/names/analysis/names/iterators.str
exists also. Do I miss something? I have the same issue/error for non-wildcard imports in nab-files.
Issue Log
NaBL imports of non-NaBL files and TS imports of non-TS files will give errors. Add
NameBindingLanguage
andTypeSystemLanguage
to thepardonedLanguages
list in themetaborg.yaml
configuration file to ignore their errors. See http://spoofax.readthedocs.io/en/latest/source/langdev/manual/config.html for more info about that configuration option.
Thanks, it builds without errors now. Just out of interest two questions:
1. Is it wrong to import non-NaBL files in NaBL? Or put differently: Why is this an error and what is the “correct” way to work around it? (Since silencing the error feels somewhat like a code-smell ;) )
2. Why is this not an error when building the project inside Spoofax/Eclipse?
It’s not wrong, we just don’t have a solution for cross-language imports. This is the workaround.
Eclipse builds don’t check for errors in the build, because they are shown in the editor.
Log in to post comments