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 srcs path changes resulting in unfindable modules #2065

Open
leegbestand opened this issue Oct 29, 2024 · 0 comments
Open

Rascal srcs path changes resulting in unfindable modules #2065

leegbestand opened this issue Oct 29, 2024 · 0 comments
Labels

Comments

@leegbestand
Copy link
Contributor

Describe the bug

In some cases, the |srcs| component in the pathConfig of a project/REPL changes to just src/ instead of src/main/rascal, which is the |srcs| value when a new Rascal project is created with createNewRascalProject.
As a result of this change, loading the REPL and importing a module results in an error that it could not find the module in the search path. This has been the only change I have found between the two projects so far.

Note that the |project://| location doesn't seem to have changed, since I can still access my current project using that location.

There is probably some inconsistency caused somehow, but I am unable to figure out why. I also haven't found a similar issue/thread somewhere.

To Reproduce
I have not yet identified what causes this, so I have no way to reproduce this.

Expected behavior
Modules should be found.

Stack traces

pathConfig(
  ignores=[],
  javaCompilerPath=[
    |file:///home/df/.vscode/extensions/usethesource.rascalmpl-0.11.2/assets/jars/rascal-lsp.jar|,
    |file:///home/df/.vscode/extensions/usethesource.rascalmpl-0.11.2/assets/jars/rascal.jar|
  ],
  bin=|target:///|,
  classloaders=[
    |target:///|,
    |system:///|
  ],
  libs=[|lib://rascal|],
  srcs=[|file:///home/df/Projects/Teaching/SoftwareEvolution/rascal-intro/src|])INFO: resolved |lib://rascal| at |jar+file:///home/df/.vscode/extensions/usethesource.rascalmpl-0.11.2/assets/jars/rascal.jar!/|
rascal>import Main;
|prompt:///|(0,12,<1,0>,<1,12>):Could not load Main due to: Could not import module Main: can not find in search path
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/ModuleImport| at |prompt:///|(0,12,<1,0>,<1,12>)

Desktop (please complete the following information):

  • Context: VScode plugin
  • Rascal Version 0.34.2 with vscode-plugin 2.20.2

Additional context
It seems defining new modules also causes an error inside vscode with the message module name is not consistent with its file location Moving the module up into the src/ directory and not src/rascal/main fixes the issue.

The RASCAL.MF file is as follows:

Manifest-Version: 0.0.1
Project-Name: rascal-intro
Source: src/main/rascal
Require-Libraries:

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

No branches or pull requests

1 participant