Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rascal check crashed unexpectedly with: Cannot write TPL file |target://bas2-maintainability-model/rascal/$LoC.tpl|, reason: IO("-1: Cannot mkDirectory on a rascal uri: target://bas2-maintainability-model")at: |lib://rascal-core/lang/rascalcore/check/CheckerCommon.rsc|(9408,2,<243,61>,<243,63>) #548

Open
BasRemmen opened this issue Dec 21, 2024 · 8 comments

Comments

@BasRemmen
Copy link

Not sure what the issue is here.

Exception thrown:

|lib://rascal-core/lang/rascalcore/check/CheckerCommon.rsc|:243,61: "Cannot write TPL file |target://bas2-maintainability-model/rascal/$LoC.tpl|, reason: IO(\"-1: Cannot mkDirectory on a rascal uri: target://bas2-maintainability-model\")"

Stacktrace:

	at removeTModel(|lib://rascal-core/lang/rascalcore/check/CheckerCommon.rsc|(9345,76,<242,25>,<244,9>))
	at removeOldestTModelFromCache(|lib://rascal-core/lang/rascalcore/check/CheckerCommon.rsc|(9638,28,<253,13>,<253,41>))
	at clearTModelCache(|lib://rascal-core/lang/rascalcore/check/CheckerCommon.rsc|(8547,32,<223,13>,<223,45>))
	at rascalTModelForLocs(|lib://rascal-core/lang/rascalcore/check/Checker.rsc|(14411,21,<337,11>,<337,32>))
	at check(|lib://rascal-core/lang/rascalcore/check/Checker.rsc|(19552,64,<475,9>,<475,73>))
	at $shell$(|main://$shell$|)

@DavyLandman
Copy link
Member

@PaulKlint this one was solved right? With the upcoming rascal core release?

@PaulKlint
Copy link
Member

I suspect it is caused by the target scheme that is not yet supported in the main branch.

@DavyLandman
Copy link
Member

The target scheme has been around for a while, I thought this was a duplicate of #529 ?

@PaulKlint
Copy link
Member

It is indeed a duplicate of #529.

One observation: target://bas2-maintainability-model should be target:///bas2-maintainability-model (but this does not solve the problem).
Other observation: isDirectory(|target:///classes|) yields false although it does exist.

My suspicion is still the target scheme.

@DavyLandman
Copy link
Member

Target behaves like the project scheme, so it should have the project name in the authority. Target refers to the target folder in a specific project.

But we could have missed some cases in how the resolver behaves.

@PaulKlint
Copy link
Member

More observations:

rascal>mkDirectory(|target://rascal-core/XX|);
ok
rascal>isDirectory(|target://rascal-core/XX|);
bool: true

BUT

the directory has been created in |target://rascal-core/classes/XX| !!

This explains at least why the .tpl file could not be written.

@PaulKlint
Copy link
Member

@DavyLandman and I have played with scenario's to reproduce this. Here is one:

  • Create a new directory b_b_b with a subdirectory src that contains a single file M.rsc (no pom.xml, no META-INF/RASCAL.MF).
  • import b_b_b in a VSCode workspace.
  • edit and then save M.rsc.

Result:
Screenshot

After further analysis it turns out that -- in the absence of a manifest -- the project name is set to "" and the target folder is set to |target:///|. This starts with getProjectPathConfig in util::Reflective but the error is further downstream and this has to be further explored.

@PaulKlint
Copy link
Member

Further exploration by @sungshik has revealed that this problem is partly solved in the https://github.com/usethesource/rascal/tree/replace-lib-by-mvn-and-others-fix/std-always-from-current2 branch, albeit that in that branch also some NPEs are visible in the logs. Work in progress to deal with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants