Giter Club home page Giter Club logo

Comments (12)

vtfanta avatar vtfanta commented on June 10, 2024

I also had this error and posted on the Discourse.

I tried tinkering around for a bit and found the following:

  • The USER_INVENTORY contains the path C:\\Users\USERNAME\\AppData\\Local\\cache\\julia\\DataToolkit\\cache\\Inventory.toml.
  • When dirname(path) is called, the result is C:\\Users\\USERNAME\\AppData\\Local\\cache\\julia\\DataToolkit\\cache.
  • Finally, the mkpath(dirname(path)) treats the cache at the end as a file name and so it creates a file called cache in the ...\\DataToolkit\\ folder.

Temporary solution
Just create the C:\\Users\\USERNAME\\AppData\\Local\\cache\\julia\\DataToolkit\\cache\\ folder yourself (you can leave it empty). This worked for me; the compilation proceeded without problems and the Inventory.toml file was created in the manually created ...\\cache folder.

from datatoolkitcommon.jl.

tecosaur avatar tecosaur commented on June 10, 2024

Thanks for looking into this!

That behaviour is interesting, I thought mkpath always created a directory, not a file 😕.

from datatoolkitcommon.jl.

chris-b1 avatar chris-b1 commented on June 10, 2024

I don't think it's this mkpath itself that's the issue. If I run the steps @vtfanta outlined above, with an empty C:\Users\USERNAME\AppData\Local\cache\julia\DataToolkit then cache gets created as a folder as expected. So presumably something earlier in the precompilation process is touching that dir?

from datatoolkitcommon.jl.

vtfanta avatar vtfanta commented on June 10, 2024

Heh, not for me unfortunately:( With the empty DataToolkit I, again, get the chache 'file' and the error.

from datatoolkitcommon.jl.

chris-b1 avatar chris-b1 commented on June 10, 2024

Hmm, interesting. I should have noted originally, I do get the same precompilation error, but if I manually run those steps mkpath makes a path, not a file.

from datatoolkitcommon.jl.

vtfanta avatar vtfanta commented on June 10, 2024

So presumably something earlier in the precompilation process is touching that dir?

I think you are correct. When I commented out the initially suspicious lines 232-240 in inventory.jl the cache file still got created. Now after commenting out the BaseDirs.User.cache(BaseDirs.Project("DataToolkit"), create=true) in Store.jl it no longer happens, so I think that nails it down to this line.

from datatoolkitcommon.jl.

tecosaur avatar tecosaur commented on June 10, 2024

Thanks for narrowing it down guys! The BaseDirs code may be slightly hard to navigate at a glance, the relevant bit is this: https://github.com/tecosaur/BaseDirs.jl/blob/d6c8e0d9bd5910395890d8a18b4fb1242d91aebe/src/internals.jl#L50-L67

So in order to create a directory, BaseDirs.projectpath(BaseDirs.Project("DataToolkit")) needs to end with a /.

On my Linux machine, I see this:

julia> BaseDirs.projectpath(BaseDirs.Project("DataToolkit"))
"julia/datatoolkit/"

The code for Windows implementation of projectpath is here: https://github.com/tecosaur/BaseDirs.jl/blob/d6c8e0d9bd5910395890d8a18b4fb1242d91aebe/src/nt.jl#L277-L289

So from that, it looks like the fix would be adjusting how BaseDirs behaves on Windows appropriately.

from datatoolkitcommon.jl.

tecosaur avatar tecosaur commented on June 10, 2024

The use of a hardcoded / instead of something platform-adaptive is so that it can be used in strings and be consistent across all platforms, e.g. BaseDirs.User.cache(BaseDirs.Project("DataToolkit"), "subfolder/", create=true).

I think what needs to be changed here might just be the behaviour when only a project is provided.

from datatoolkitcommon.jl.

tecosaur avatar tecosaur commented on June 10, 2024

I've just pushed tecosaur/BaseDirs.jl@729a9e33f23, if you might be able to try using (]add BaseDirs#729a9e33f) and seeing if it works now, that would be much appreciated!

from datatoolkitcommon.jl.

vtfanta avatar vtfanta commented on June 10, 2024

Brilliant! This works on my Win10 :)

from datatoolkitcommon.jl.

tecosaur avatar tecosaur commented on June 10, 2024

I'll see if I've thought of any issues with the approach in the next ~day, and if not tag that as BaseDirs v1.2.2, and close this issue.

Thanks for the help!

from datatoolkitcommon.jl.

tecosaur avatar tecosaur commented on June 10, 2024

v1.2.2 is now being registered (JuliaRegistries/General#100782), so I think I can (finally) close this 🥳

from datatoolkitcommon.jl.

Related Issues (13)

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.