metaborg / nabl

Spoofax' Name Binding Language
Apache License 2.0
7 stars 12 forks source link

Remove `signatures/-` import in `renaming.str`. #101

Closed Gohla closed 2 years ago

Gohla commented 2 years ago

statix.runtime/trans/statix/runtime/renaming.str imports signatures/-, but this import can fail when statix.runtime is used through a source dependency, because only signatures/statix/**/*.str is exported from src-gen. If the language itself then does not have any generated signatures in the signatures directory, the import will fail. This is observed in Spoofax 3 through https://github.com/metaborg/spoofax-pie/issues/112.

I think the export is correct and renaming.str should not import signatures/-, which seems to not be needed anyway, and that is what this PR changes.

AZWN commented 2 years ago

Indeed pretty inconsistent. Would such illicit imports be verifyable (in Spoofax 3)?

Gohla commented 2 years ago

Indeed pretty inconsistent. Would such illicit imports be verifyable (in Spoofax 3)?

Right now this is not checked. Meta-languages in Spoofax 3 could add checks for this by accepting a list of exported directories and ensuring that all imports are visible through the exported directories.

Also, statix.runtime should probably be a new-style Stratego 2 library, such that we do not need export the sources anymore, and instead export the compiled code, which would also fix this issue.

AZWN commented 2 years ago

We currently have both Stratego 1 and 2 to for backwards compatibility with languages using Statix together with Stratego 1. But it is good to hear that this is on the backlog for Spoofax 3 meta-languages, and that Stratego 2 apparently does not suffer from this problem.