nim-lang / atlas

The Atlas Package cloner. It manages an isolated workspace that contains projects and dependencies.
MIT License
99 stars 14 forks source link

[request | question] Ability to connect atlas to the root toolchain of the system #64

Closed heysokam closed 1 year ago

heysokam commented 1 year ago

I've tried setting up atlas for a project, but I don't know if I like that there is no way (that I know of) to connect an atlas workspace to the root toolchain folder of the host system (or any other arbitrary folder).

I understand if this is by design, and it does make a lot of sense if this is the case.

What I was thinking is having the option to (explicitly, manually) setup paths where atlas can search for dependencies, so that the same libraries don't end up duplicated 10 times because of having 10 different workspaces.

My idea would be:

1. Setup alternative folder to search for (explicitly)
2. `atlas use mydepend`
2.1 atlas searches for the dependency in the alternative folders, if they are any
---> does not redownload the library, just uses the ones in the other folder
---> choose by prioritizing the last folder found, like nim.cfg does (or first, or whatever other rule)
2.2 no alternatives found. atlas continues with the current behavior where the libraries are duplicated once for each workspace

That would be my feature request if this is not possible. Or just my question if the feature exists and I haven't found it (sorry if that's the case).

Araq commented 1 year ago

I think I understand what you want but then why not edit your nim.cfg manually? Atlas only touches its specific section and the rest of the nim.cfg is all yours.

heysokam commented 1 year ago

Oh, so you mean I could add the system toolkit folder to the nim.cfg file? Didn't think that would work

Would it be possible to do that for the workspace itself, in some way? :thinking: Also, would that stop atlas from duplicating the folders when a dependency is asked for?

Araq commented 1 year ago

Oh, so you mean I could add the system toolkit folder to the nim.cfg file?

Yes, that works.

Would it be possible to do that for the workspace itself, in some way?

Yes, create a nim.cfg in the workspace.

Also, would that stop atlas from duplicating the folders when a dependency is asked for?

Yes, if the dependency is not in your .nimble file.