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

LMS unable to move headers to correct directory (C codegen) #126

Open
reikdas opened this issue Oct 17, 2022 · 0 comments
Open

LMS unable to move headers to correct directory (C codegen) #126

reikdas opened this issue Oct 17, 2022 · 0 comments

Comments

@reikdas
Copy link

reikdas commented Oct 17, 2022

If I use the C backend in a project that inherits lms-clean, and use sbt from the command line to execute my code, I get the error -

[info] running Main 
[error] java.nio.file.NoSuchFileException: file:/home/reikdas/lmshdfs/target/bg-jobs/sbt_97ef2bde/target/4b87683e/5ecc7a79/lms-clean_2.12-0.0.1-SNAPSHOT.jar!/headers
[error] 	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
[error] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[error] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[error] 	at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
[error] 	at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
[error] 	at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
[error] 	at java.nio.file.Files.readAttributes(Files.java:1737)
[error] 	at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
[error] 	at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
[error] 	at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
[error] 	at java.nio.file.FileTreeIterator.<init>(FileTreeIterator.java:72)
[error] 	at java.nio.file.Files.walk(Files.java:3574)
[error] 	at java.nio.file.Files.walk(Files.java:3625)
[error] 	at lms.core.ExtendedCCodeGen.prepareHeaders(c_codegen.scala:259)
[error] 	at lms.core.ExtendedCCodeGen.emitAll(c_codegen.scala:656)
[error] 	at lms.core.stub.Adapter$.$anonfun$emitCommon$4(stub.scala:85)
[error] 	at lms.core.utils$.time(utils.scala:20)
[error] 	at lms.core.stub.Adapter$.emitCommon(stub.scala:78)
[error] 	at lms.core.stub.Adapter$.emitCommon1(stub.scala:50)
[error] 	at lms.core.stub.DslGenC.emitSource(stub.scala:1442)
[error] 	at lms.core.stub.DslGenC.emitSource$(stub.scala:1441)
[error] 	at Main$$anon$1$$anon$2.emitSource(Main.scala:11)

But I do not face the same error when executing my code from an IDE such as Intellij Idea.

This seems like a common issue - https://stackoverflow.com/questions/53543460/scala-issue-with-reading-file-from-resources-directory

Since I don't need the headers for now, a simple work around that I am using is to comment out the prepareHeaders() invocation here - https://github.com/TiarkRompf/lms-clean/blob/master/src/main/scala/lms/core/codegen/c_codegen.scala#L656

cc: @Kraks

reikdas added a commit to reikdas/lms-clean that referenced this issue Jan 22, 2023
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

1 participant