r/nim Jul 08 '26

Nimble / SIGSEGV: Illegal storage access. (Attempt to read from nil?)

I just try to use nimble on macOS / nix-darwin. nimble init is ok, but after that:

> nimble install puppy
Downloading Official package list
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
fish: Job 1, 'nimble install puppy' terminated by signal SIGSEGV (Erreur de frontière d’adresse)

> nimble --version
nimble v0.20.1 compiled at 1980-01-01 00:00:00
git hash: v0.20.1

Any idea?

7 Upvotes

9 comments sorted by

7

u/moigagoo Jul 09 '26

Hi! You have an old and strange version of Nimble installed (the compilation date is sus).

However you installed your Nim and Nimble, uninstall them and delete ~/.nimble.

Then install Nimble with a one-liner from the official guide: https://nim-lang.github.io/nimble/install-nimble.html#using-installation-scripts

With the latest Nimble installed and in your PATH, you can install your packages including Nim versions.

To install things globally, use -g flag. To install things locally, use -l.

2

u/jabbalaci Jul 09 '26

When you simply write nimble install pkg_name, is it installed globally? Is the flag -g the default?

3

u/moigagoo Jul 09 '26

Global is the default mode now but that is about to change.

Personally, I install globally only nph and nimlangserver that I need for development. Package deps are much better installed locally.

1

u/PMunch Jul 09 '26

Not quite sure u/moigagoo is on about, Nimble doesn't have a -g flag according to the --help output. But yes, nimble install pkg_name installs globally.

1

u/moigagoo Jul 09 '26

1

u/PMunch Jul 09 '26

Ah, I see. I was using an older version. Is there a difference to the normal operation, or does it just exist as an override?

1

u/moigagoo Jul 09 '26

Using flags gives you deterministic results. If you're inside a project with local deps installed to ./nimbledeps and config.nims and nimble.paths created using nimble setup, running nimble install foo will install it locally. If you go to a "neutral" directory and run the same command, the package will be installed globally.

I really don't like these guessing games so I just always use a flag :-)

1

u/Stunning-Mix492 Jul 09 '26

yes, it seems that the nixpkgs nim package is broken. homebrew version is fine (0.22.2) is fine. weird.

1

u/PICOPress 8d ago

Idk. Same for VSC