Nim version:
[xxx]$ nim -v
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 78983f1876726a49c69d65629ab433ea1310ece1
active boot switches: -d:release
Atlas version (bundled with the Nim 2.2.0 download):
[xxx]$ atlas -v
version: 0.8.0 (sha: 5faec3e9a33afe99a7d22377dd1b45a5391f5504)
I don't know which of the following is a bug and which is intended behavior, but with outdated documentation.
My starting point was a workspace directory with a single project directory. The project directory contained only a .nimble file.
test_workspace/
└── test_proj
└── test_proj.nimble
The first step was to run atlas init
[xxx/test_workspace]$ atlas init --deps=_deps
[Info] (/xxx/test_workspace) created atlas.workspace
[Info] (_deps) created deps dir
This created an empty _deps directory and a file atlas.workspace
test_workspace/
├── atlas.workspace
├── _deps
└── test_proj
└── test_proj.nimble
But atlas.workspace had an empty "deps" entry:
{
"deps": "",
"overrides": "",
"plugins": "",
"resolver": "SemVer",
"graph": null
}
My starting point for this was as above after executing atlas init --deps=_deps, but after I manually inserted _deps into atlas.workspace:
{
"deps": "_deps",
"overrides": "",
"plugins": "",
"resolver": "SemVer",
"graph": null
}
Executing atlas use ran successfully:
[xxx/test_workspace/test_proj]$ atlas use sdl2
[Info] (xxx/test_workspace) is the current workspace
Cloning into 'packages'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 16 (delta 1), reused 7 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (16/16), 167.62 KiB | 1.88 MiB/s, done.
Resolving deltas: 100% (1/1), done.
[Info] (xxx/test_workspace/test_workspace.nimble) updated
[Info] (test_workspace) installing dependencies for test_workspace.nimble
[Info] (sdl2) Cloning url: https://github.com/nim-lang/sdl2
Cloning into 'xxx/test_workspace/sdl2'...
remote: Enumerating objects: 1023, done.
remote: Counting objects: 100% (95/95), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 1023 (delta 69), reused 56 (delta 52), pack-reused 928 (from 2)
Receiving objects: 100% (1023/1023), 744.72 KiB | 4.65 MiB/s, done.
Resolving deltas: 100% (503/503), done.
[Info] (sdl2) updated package to 00bc2584ff26e1804ade6fdc63bb7914f1e59bc2
[Info] (xxx/test_workspace/test_proj) created: nim.cfg
but sdl2 was cloned into the workspace directory - not into the _deps subdirectoy in the workspace:
test_workspace/
├── atlas.workspace
├── _deps
├── sdl2
│ ├── examples
│ │ ├── net_server.nim
│ │ ├── sdl_audio_callback.nim
│ │ ├── sdl_mixer_example.nim
│ │ ├── sdl_opengl_example.nim
│ │ └── sdl_skeleton.nim
│ ├── LICENSE
│ ├── sdl2.nimble
│ └── src
│ ├── sdl2
│ │ ├── audio.nim
│ │ ├── gamecontroller.nim
│ │ ├── gfx.nim
│ │ ├── haptic.nim
│ │ ├── image.nim
│ │ ├── joystick.nim
│ │ ├── mixer.nim
│ │ ├── net.nim
│ │ ├── private
│ │ │ └── keycodes.nim
│ │ └── ttf.nim
│ └── sdl2.nim
├── test_proj
│ ├── _deps
│ │ └── packages
│ │ ├── config.nims
│ │ ├── getmergebase.sh
│ │ ├── LICENSE-GPLv3.txt
│ │ ├── LICENSE.txt
│ │ ├── package_scanner.nim
│ │ ├── packages.json
│ │ ├── pretty_json.nim
│ │ └── README.md
│ ├── nim.cfg
│ └── test_proj.nimble
└── test_workspace.nimble
Other unexpected/undocumented behavior:
This has been encountered by at least one other person (see here). Either it is a bug or the required usage of atlas install has changed.
The starting point was the same as for the atlas use test above.
Three versions of test_proj.nimble were tried.
Version 1 - a full nimble file (copied from nimx.nimble in nimx):
# Package
version = "0.2"
author = "Yuriy Glukhov"
description = "GUI framework"
license = "MIT"
# Directory configuration
installDirs = @["nimx", "assets"]
# Dependencies
requires "sdl2"
requires "opengl"
requires "winim"
requires "nimsl >= 0.3"
requires "jnim" # For android target
requires "nake"
requires "closure_compiler >= 0.3.1"
requires "plists"
requires "variant >= 0.2 & < 0.3"
requires "kiwi"
requires "https://github.com/yglukhov/ttf >= 0.2.9 & < 0.3"
requires "https://github.com/yglukhov/async_http_request"
requires "jsbind"
requires "rect_packer"
requires "https://github.com/yglukhov/android"
requires "darwin"
requires "os_files"
requires "https://github.com/tormund/nester"
requires "nimwebp"
requires "https://github.com/yglukhov/clipboard"
Version 2 - a single line specifying a package name:
requires "sdl2"
Version 3 - a single line specifying a package url (I verified that the url points to a valid Nim project on Github):
requires "https://github.com/yglukhov/async_http_request"
Executing atlas install for all three versions gave the same error:
[xxx/test_workspace/test_proj]$ atlas install test_proj.nimble
[Info] (xxx/test_workspace) is the current workspace
Cloning into 'packages'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 16 (delta 1), reused 7 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (16/16), 167.62 KiB | 1.73 MiB/s, done.
Resolving deltas: 100% (1/1), done.
[Info] (test_proj) installing dependencies for test_proj.nimble
pkgurls.nim(41) createUrlSkipPatterns
Error: unhandled exception: Invalid name or URL: [ValueError]
A _deps subdirectory was created in the project directory, the same as for the atlas use test above, but nothing else happened.
I'm sorry, I'm overly busy with Nimony and don't have the time to look into these issues. They would mostly disappear once we implement https://github.com/nim-lang/atlas/issues/133
PRs are welcome.