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

Rebuilding project doesn't recreate the structure of the build directory #44

Closed
kponichtera opened this issue Sep 11, 2021 · 1 comment
Labels
C-Bug Category: bug. Not working as expected S-Inactive Status: author did not respond

Comments

@kponichtera
Copy link

Summary

After cleaning and rebuilding the language project, there are errors about the missing files in the build directory.

Stacktrace from the error:

Printing with context:
  currentDir: ./ = /week1prolog/
mb.pie.api.ExecException: Executing task 'mb.pie.task.archive.UnarchiveFromJar(Input{inputJarFile=java##file:/home/homedir/bin/spoofax3/plugins/libspoofax2.eclipse_0.11.7.jar, o...)' failed unexpectedly
  at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:123)
  at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:81)
  at mb.pie.runtime.exec.TopDownRunner.exec(TopDownRunner.java:195)
  at mb.pie.runtime.exec.TopDownRunner.executeOrGetExisting(TopDownRunner.java:140)
  at mb.pie.runtime.exec.TopDownRunner.require(TopDownRunner.java:80)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:95)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:114)
  at mb.pie.api.STask.get(STask.java:61)
  at mb.pie.api.MappedSupplier.get(MappedSupplier.java:17)
  at mb.pie.api.MappedSupplier.get(MappedSupplier.java:17)
  at mb.pie.api.MappedSupplier.get(MappedSupplier.java:17)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:124)
  at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
  at mb.common.util.BaseCollectionView.forEach(BaseCollectionView.java:88)
  at mb.esv.task.spoofax.EsvParseWrapper.lambda$exec$0(EsvParseWrapper.java:38)
  at mb.common.option.Option.ifSome(Option.java:66)
  at mb.esv.task.spoofax.EsvParseWrapper.lambda$exec$1(EsvParseWrapper.java:38)
  at mb.common.option.Option.ifSome(Option.java:66)
  at mb.common.result.Result.ifOk(Result.java:88)
  at mb.esv.task.spoofax.EsvParseWrapper.lambda$exec$2(EsvParseWrapper.java:38)
  at java.base/java.util.Optional.ifPresent(Optional.java:183)
  at mb.esv.task.spoofax.EsvParseWrapper.exec(EsvParseWrapper.java:38)
  at mb.esv.task.spoofax.EsvParseWrapper.exec(EsvParseWrapper.java:16)
  at mb.pie.api.Task.exec(Task.java:56)
  at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:110)
  at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:81)
  at mb.pie.runtime.exec.TopDownRunner.exec(TopDownRunner.java:195)
  at mb.pie.runtime.exec.TopDownRunner.executeOrGetExisting(TopDownRunner.java:140)
  at mb.pie.runtime.exec.TopDownRunner.require(TopDownRunner.java:80)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:95)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:78)
  at mb.esv.util.EsvVisitor.parse(EsvVisitor.java:131)
  at mb.esv.util.EsvVisitor.visitMainFile(EsvVisitor.java:62)
  at mb.esv.task.EsvCheck.exec(EsvCheck.java:74)
  at mb.esv.task.EsvCheck.exec(EsvCheck.java:23)
  at mb.pie.api.Task.exec(Task.java:56)
  at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:110)
  at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:81)
  at mb.pie.runtime.exec.TopDownRunner.exec(TopDownRunner.java:195)
  at mb.pie.runtime.exec.TopDownRunner.executeOrGetExisting(TopDownRunner.java:140)
  at mb.pie.runtime.exec.TopDownRunner.require(TopDownRunner.java:80)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:95)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:78)
  at mb.spoofax.lwb.compiler.esv.CheckEsv.lambda$exec$0(CheckEsv.java:33)
  at mb.common.option.Option.mapOrElse(Option.java:126)
  at mb.spoofax.lwb.compiler.esv.CheckEsv.lambda$exec$1(CheckEsv.java:32)
  at mb.common.option.Option.mapOrElse(Option.java:126)
  at mb.common.result.Result.mapOrElse(Result.java:271)
  at mb.spoofax.lwb.compiler.esv.CheckEsv.exec(CheckEsv.java:31)
  at mb.spoofax.lwb.compiler.esv.CheckEsv.exec(CheckEsv.java:13)
  at mb.pie.api.Task.exec(Task.java:56)
  at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:110)
  at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:81)
  at mb.pie.runtime.exec.TopDownRunner.exec(TopDownRunner.java:195)
  at mb.pie.runtime.exec.TopDownRunner.executeOrGetExisting(TopDownRunner.java:140)
  at mb.pie.runtime.exec.TopDownRunner.require(TopDownRunner.java:80)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:95)
  at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:78)
  at mb.spoofax.lwb.compiler.CheckLanguageSpecification.exec(CheckLanguageSpecification.java:55)
  at mb.spoofax.lwb.compiler.CheckLanguageSpecification.exec(CheckLanguageSpecification.java:24)
  at mb.pie.api.Task.exec(Task.java:56)
  at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:110)
  at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:81)
  at mb.pie.runtime.exec.TopDownRunner.exec(TopDownRunner.java:195)
  at mb.pie.runtime.exec.TopDownRunner.executeOrGetExisting(TopDownRunner.java:140)
  at mb.pie.runtime.exec.TopDownRunner.require(TopDownRunner.java:80)
  at mb.pie.runtime.exec.TopDownRunner.requireInitial(TopDownRunner.java:59)
  at mb.pie.runtime.MixedSessionImpl.lambda$require$1(MixedSessionImpl.java:86)
  at mb.pie.runtime.SessionImpl.handleException(SessionImpl.java:149)
  at mb.pie.runtime.MixedSessionImpl.require(MixedSessionImpl.java:86)
  at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilder.topDownBuild(SpoofaxLwbBuilder.java:145)
  at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilder.fullBuild(SpoofaxLwbBuilder.java:114)
  at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilder.access$000(SpoofaxLwbBuilder.java:58)
  at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilder$1.run(SpoofaxLwbBuilder.java:81)
  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
  at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilder.build(SpoofaxLwbBuilder.java:96)
  at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:846)
  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:229)
  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:277)
  at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:330)
  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:333)
  at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:385)
  at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:406)
  at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:515)
  at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:405)
  at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:180)
  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.io.IOException: Creating a new output stream for resource 'L./build/unarchive/libspoofax2/libspoofax2.eclipse_0.11.7.jar/mb/libspoofax2/editor/libspoofax/color/default.esv' failed unexpectedly
  at mb.spoofax.eclipse.resource.EclipseResource.openWrite(EclipseResource.java:226)
  at mb.resource.WritableResource.openWriteBuffered(WritableResource.java:56)
  at mb.pie.task.archive.UnarchiveCommon.unarchive(UnarchiveCommon.java:185)
  at mb.pie.task.archive.UnarchiveCommon.unarchiveJar(UnarchiveCommon.java:130)
  at mb.pie.task.archive.UnarchiveCommon.unarchiveJar(UnarchiveCommon.java:88)
  at mb.pie.task.archive.UnarchiveFromJar.exec(UnarchiveFromJar.java:102)
  at mb.pie.task.archive.UnarchiveFromJar.exec(UnarchiveFromJar.java:15)
  at mb.pie.api.Task.exec(Task.java:56)
  at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:110)
  ... 88 more in common with parent stacktrace
Caused by: org.eclipse.core.runtime.CoreException: Could not write file: /home/homedir/spoofax-workspace./build/unarchive/libspoofax2/libspoofax2.eclipse_0.11.7.jar/mb/libspoofax2/editor/libspoofax/color/default.esv.
  at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:48)
  at org.eclipse.core.internal.filesystem.local.LocalFile.openOutputStream(LocalFile.java:434)
  at mb.spoofax.eclipse.resource.EclipseResource.openWrite(EclipseResource.java:224)
  ... 96 more in common with parent stacktrace
Caused by: java.io.FileNotFoundException: /home/homedir/spoofax-workspace./build/unarchive/libspoofax2/libspoofax2.eclipse_0.11.7.jar/mb/libspoofax2/editor/libspoofax/color/default.esv (No such file or directory)
  at java.base/java.io.FileOutputStream.open0(Native Method)
  at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
  at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
  at org.eclipse.core.internal.filesystem.local.LocalFile.openOutputStream(LocalFile.java:424)
  ... 97 more in common with parent stacktrace

What you did

Tried restarting Eclipse, cleaning the cache (.metadata/.plugins/spoofax.lwb.eclipse/pieStore file in the Eclipse workspace) and repeatedly cleaning and rebuilding the project.

What you expected to happen

Since the build directory is part of the .gitignore file, it should be recreated deterministically every time it's removed and the build action is invoked in Eclipse.

What actually happened

Upon removal of the build directory, its structure is not rebuilt properly and it's impossible to continue working with the project in the IDE.

Context

  • Spoofax version: 0.11.7
  • Operating system & version: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
  • Java version (if applicable): 11.0.11 (AdoptOpenJDK)
  • Eclipse version (if applicable): Version: 2021-03 (4.19.0), Build id: 20210312-0638
  • Gradle version (if applicable): N/A

Additional information

The build directory contains only one eclipseclasses folder:

Screenshot from 2021-09-11 17-11-30

@kponichtera kponichtera added the C-Bug Category: bug. Not working as expected label Sep 11, 2021
@Gohla
Copy link
Member

Gohla commented Sep 13, 2021

Can you provide your language project? If you're doing the compiler construction course, I have access to your repository, so just link me to the commit in your repository where this occurs.

@Gohla Gohla added S-Waiting-On-Author Status: awaiting some action (such as code changes or more information) from the author S-Inactive Status: author did not respond and removed S-Waiting-On-Author Status: awaiting some action (such as code changes or more information) from the author labels Sep 15, 2021
@Gohla Gohla closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: bug. Not working as expected S-Inactive Status: author did not respond
Projects
None yet
Development

No branches or pull requests

2 participants