Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions nimble-guide/docs/folder-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


Nimble stores all installed packages and metadata in `$HOME/.nimble` by default.
Libraries are stored in `$nimbleDir/pkgs2`, and compiled binaries are linked in `$nimbleDir/bin`.
Libraries are stored in `$nimbleDir/pkgs`, and compiled binaries are linked in `$nimbleDir/bin`.
The Nim compiler is aware of Nimble and will automatically find modules so you can `import modulename` and have that working without additional setup.

However, some Nimble packages can provide additional tools or commands.
Expand Down Expand Up @@ -42,24 +42,24 @@ For example, if your Nimble directory is located at `/some/custom/path/nimble`,
this should work:

``
nim c --nimblePath:/some/custom/path/nimble/pkgs2 main.nim
nim c --nimblePath:/some/custom/path/nimble/pkgs main.nim
``

In the case of package local dependencies with `nimbledeps`:

``
nim c --nimblePath:nimbledeps/pkgs2 main.nim
nim c --nimblePath:nimbledeps/pkgs main.nim
``

Some code editors rely on `nim check` to check for errors under the hood (e.g. VScode), and the editor extension may not allow users to pass custom option to `nim check`, which will cause `nim check` to scream `Error: cannot open file:<the_package>`.
In this case, you will have to use the Nim compiler's configuration file capability.
Simply add the following line to the `nim.cfg` located in any directory listed in the [documentation](https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files).

``
nimblePath = "/some/custom/path/nimble/pkgs2"
nimblePath = "/some/custom/path/nimble/pkgs"
``

For project local dependencies:
``
nimblePath = "$project/nimbledeps/pkgs2"
nimblePath = "$project/nimbledeps/pkgs"
``
4 changes: 2 additions & 2 deletions nimble-guide/docs/package-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Here are their specifications and differences.
Library packages are likely the most popular form of Nimble packages.
They are meant to be used by other library or binary packages.

When Nimble installs a library, it will copy all of its files into `$nimbleDir/pkgs2/pkgname-ver-checksum`.
When Nimble installs a library, it will copy all of its files into `$nimbleDir/pkgs/pkgname-ver-checksum`.
It's up to the package creator to make sure that the package directory layout is correct, this is so that users of the package can correctly import the package.

It is suggested that the layout be as follows.
Expand Down Expand Up @@ -60,7 +60,7 @@ bin = @["main"]
```

In this case when `nimble install` is invoked, Nimble will build the `main.nim`
file, copy it into `$nimbleDir/pkgs2/pkgname-ver-checksum/` and subsequently
file, copy it into `$nimbleDir/pkgs/pkgname-ver-checksum/` and subsequently
create a symlink to the binary in `$nimbleDir/bin/`.
On Windows, a stub `.cmd` file is created instead.

Expand Down
4 changes: 2 additions & 2 deletions nimble-guide/docs/use-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,6 @@ Since there can be many versions of the same package installed, this command wil

```sh
$ nimble path itertools
/home/user/.nimble/pkgs2/itertools-0.4.0-5a3514a97e4ff2f6ca4f9fab264b3be765527c7f
/home/user/.nimble/pkgs2/itertools-0.2.0-ab2eac22ebda6512d830568bfd3052928c8fa2b9
/home/user/.nimble/pkgs/itertools-0.4.0-5a3514a97e4ff2f6ca4f9fab264b3be765527c7f
/home/user/.nimble/pkgs/itertools-0.2.0-ab2eac22ebda6512d830568bfd3052928c8fa2b9
```
2 changes: 1 addition & 1 deletion nimble-guide/docs/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Downloading https://github.com/narimiran/itertools using git
Info: "nimble.paths" is updated.
```

If you check the contents of `nimble.paths`, you will notice that the path for `itertools` is no more in `~/.nimble/pkgs2` directory (where the version 0.3.0 is), but it has the following value:
If you check the contents of `nimble.paths`, you will notice that the path for `itertools` is no more in `~/.nimble/pkgs` directory (where the version 0.3.0 is), but it has the following value:

```sh
...
Expand Down
Loading
Loading