Skip to content

Implement better "vendor" style workspace setup #104

@elcritch

Description

@elcritch

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
  • 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:

  1. an atlas.config project config file which could specify a default vendored workspace subdirectory in addition to other per-project configs
  2. explicit atlas.vendor file that just contains the path to a vendor folder (similar to some of git's setups)
  3. an option in a atlas.workspace configuration that specifies a vendored workspace
  4. just train users to use atlas --workspace=./vendor xyz
  5. modification of previous where a flag like -l uses a pre-defined folder like vendor as the workspace, similar to the atlas -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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions