-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Myself and several others have used the "vendoring" style where a sub-directory is used as the Atlas workspace. This is a very common pattern for many language package managers like Npm or Elixir's mix and each project can have it's own versions checked out. Golang also uses a vendor directory for project specific deps pinning in addition to it's global GOPATH
workspace.
For many projects it's convenient to setup the main parent repo as a Nim project that also contains the configs to install dependencies for that project rather than needing to create an explicit workspace. Often this is most useful for folks who want to clone a repo, install the deps locally and try out a project. This is pretty big for people who see a Nim project and just want to "try it out". Though this can be handy for a user who has a workspace but doesn't want to pollute it with some project's dependencies before they check it out. Lastly, it also enables a smooth transition path for Status project which use the nimbus-build-system that uses git submodules in a vendor
folder.
The previous implementation of this in Atlas was very hacky and searched directy subdirectories in the current folder for workspaces in normal workspaces weren't found. That's problematic for lots of reasons and caused issues with normal atlas workspaces containing other workspaces. However, there should be a couple of solutions to enabling a vendoring style setup with Atlas properly.
Here's a couple of feature goals:
- make the vendored workspace location explicitly configured
- possibly a standard predefined location like Go's
./vendor
folder
- possibly a standard predefined location like Go's
- make it easy for folks to use projects with a vendored workspace with a standard workspace locally without changing the repo's configs
- possibly always make vendored workspaces "secondary", as if a parent workspace is detected always prefer it
Here's a few approaches that have come up in a previous PR and I've thought of trying:
- an
atlas.config
project config file which could specify a default vendored workspace subdirectory in addition to other per-project configs - explicit
atlas.vendor
file that just contains the path to a vendor folder (similar to some of git's setups) - an option in a
atlas.workspace
configuration that specifies a vendored workspace - just train users to use
atlas --workspace=./vendor xyz
- modification of previous where a flag like
-l
uses a pre-defined folder likevendor
as the workspace, similar to theatlas -g
support for global
I'm partial towards either option 1 or option 5 of having an atlas.config
or a -l
local option, respectively. They're both explicit.
Having a workspace config in the current project seems sort of confusing with Atlas's standard usage. The atlas.vendor
link file are sort of annoying in Nimble and Git.