Git Product home page Git Product logo

Comments (10)

HugoGranstrom avatar HugoGranstrom commented on June 8, 2024 3

I will try to fix this in the coming week. What I've found is that it's as easy as passing --nimcache:path to change the nimcache folder. And we can get the current nimcache folder using this code from forum thread:

import std/compilesettings
const nimcache = querySetting(SingleValueSetting.nimcacheDir)

So we just have to combine this nimcache with the relative path of the current document to get the desired results.

from nimibook.

HugoGranstrom avatar HugoGranstrom commented on June 8, 2024 1

Yes that sounds like it could work. And we would get the benefit of all the cache being intact 👍

from nimibook.

pietroppeter avatar pietroppeter commented on June 8, 2024 1

ah but you have also stuff like /home/runner/.cache/nim/index_d/@mindex.nim.c.o so that might create a conflict anyway

from nimibook.

HugoGranstrom avatar HugoGranstrom commented on June 8, 2024 1

ah but you have also stuff like /home/runner/.cache/nim/index_d/@mindex.nim.c.o so that might create a conflict anyway

Yes exactly, it's those that are the problem I think because it was the C compiler that complained about not finding references. Which would be because we have overridden some file before it was finished compiling or something like that

from nimibook.

pietroppeter avatar pietroppeter commented on June 8, 2024

Isn't there some compiler option that allows to override the name of file in cache? If so we could just add the index of the file in the list of file to build or something else to disambiguate

from nimibook.

HugoGranstrom avatar HugoGranstrom commented on June 8, 2024

I would say it depends on what -o:outputname does when using nim r as there is no non-temporary binary to save. Hopefully it uses that name as well in the cache but I'm not holding my hopes up 😬 will investigate it further tomorrow, I hope I'm wrong though.

from nimibook.

pietroppeter avatar pietroppeter commented on June 8, 2024

another option would be to override the Nim cache folder and replicate the folder structure of source files (+ a base folder that could be the default one)

from nimibook.

HugoGranstrom avatar HugoGranstrom commented on June 8, 2024

I have tried setting -o:another_name and it doesn't work sadly :/.

another option would be to override the Nim cache folder and replicate the folder structure of source files (+ a base folder that could be the default one)

I'm not really following here, what is is we should replicate?
Should we create a unique nimcache folder for each file?

from nimibook.

pietroppeter avatar pietroppeter commented on June 8, 2024

well if I understand correctly we have issues with a structure like this:

index.nim
section1/index.nim

because when processed concurrently nim creates c files with the same name in nimcache folder (calling it $nimcache here), like $nimcache/index.c. If instead we ask for the second index file to use as nimcache $nimcache/section1 (so that the c file is $nimcache/section1/index.c this should solve the issue, right?

from nimibook.

pietroppeter avatar pietroppeter commented on June 8, 2024

still, I had a brief look at the log and not entirely sure the issue is conflict of filenames:
I see a name like /home/runner/.cache/nim/index_d/index_48315C86F820572F8ADD5336011EE02A9F1B2C7F and it looks like filenames are mangled? maybe it is an issue when filenames have same name and same content?

and to be honest I have only a limited knowledge of nimcache logic...

from nimibook.

Related Issues (20)

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.