Giter Site home page Giter Site logo

Comments (7)

holly-cummins avatar holly-cummins commented on July 19, 2024 1

Thanks for the follow-up, @Pante.

I'm using Java 17, Elementary 2.0.1, and MacOS.

I've created a simple reproducer which shows the problem at https://github.com/holly-cummins/elementary-315-reproducer/commits/main/. The first commit reproduces the error. Checking it out and doing mvn clean install should give

[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   ExtensionAnnotationProcessorTest.shouldProcessClassWithBuildStepWithoutErrors:28->assertNoErrrors:32 Errors were: [error: Resource path URI is invalid: mem:///SOURCE_OUTPUT/ignore.tmp
  Root error is java.nio.file.FileSystemNotFoundException: Provider "mem" not installed] ==> expected: <0> but was: <1>
[INFO] 
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

The second commit has a simple file provider to get the tests passing.

from elementary.

holly-cummins avatar holly-cummins commented on July 19, 2024 1

Thanks @Pante, that's worked! I had to change my tests to read Results.generatedSources rather than Results.sources, but it's quite likely the test was doing it wrong and passing for the wrong reason when it was using Results.sources.

from elementary.

Pante avatar Pante commented on July 19, 2024

Thanks for reporting this bug!

I tried replicating the issue, but it seems to be working fine on my machine (Java 17, Windows), https://github.com/Pante/elementary/blob/fix/issue/315/elementary/src/test/java/com/test/Issue315Test.java. I assume the code snippet you provided was part of an annotation processor under test using the JavacExtension.

image

Could you provide which Java version, Elementary version & OS you were using?

from elementary.

Pante avatar Pante commented on July 19, 2024

@holly-cummins bump!

from elementary.

Pante avatar Pante commented on July 19, 2024

Thanks for taking the time & effort to provide a reproducer. I took a look it and it and I can replicate the issue across both my Windows and MacOS machines.

The problem now lies in how to fix it. I'm a little hesitant to continue down the in-memory file representation path as it seems like significant effort to get it working without subtle bugs, even libraries like https://github.com/google/jimfs and https://github.com/marschall/memoryfilesystem seem to contain a long list of caveats. I think this issue even existing is proof of that.

I've been thinking and perhaps it might make more sense to lean into temporary directories instead, maybe something similar to https://junit.org/junit5/docs/5.9.1/api/org.junit.jupiter.api/org/junit/jupiter/api/io/TempDir.html? It should be simpler to maintain and also has the upside of allowing people to debug the generated files.

from elementary.

Pante avatar Pante commented on July 19, 2024

@holly-cummins I've released Elementary 3 that generates files in temporary directories instead of in-memory. It should fix the split-brain and file system issues. Please do re-open this issue if the bug persists.

from elementary.

Pante avatar Pante commented on July 19, 2024

While moving Elementary away from in-memory files, I remember fixing an issue with Results.sources sometimes returning sources that it shouldn't have. It was an unintended side-effect of the in-memory representation. The changes you've observed is probably a result of that.

from elementary.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.