status-im / nim-toml-serialization

Flexible TOML serialization [not] relying on run-time type information.
Apache License 2.0
37 stars 7 forks source link

`nimble install` doesn't install `faststreams` #65

Closed kaushalmodi closed 1 year ago

kaushalmodi commented 1 year ago

Hello,

I am trying out this package to convert TOML files to Nim objects and I was successful after fixing a minor installation glitch.

In order to run Toml.decode, I need to do

nimble install faststreams
nimble install toml_serialization

If I don't install faststreams, I get this error:

/home/kmodi/.nimble/pkgs2/serialization-0.1.0-d94373efee43cbd15b1cc73185c0e49528598b37/serialization.nim(3, 33) Error: cannot open file: faststreams/inputs
make[1]: *** [nim] Error 1

Nim version is installed from devel:

Nim Compiler Version 1.9.3 [Linux: amd64]
Compiled at 2023-04-10
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 4d683fc689e124cfb0ba3ddd6e68d3e3e9b9b343
active boot switches: -d:release

Suggested fix

Can nimble install toml_serialization install faststreams as a dependency?

jangko commented 1 year ago

hmm, faststreams already a dependancy installed by serialization package. it also in nimble.lock file. Also there is no where in the CI faststreams must be installed manually, I'm curious to what really happened here.

kaushalmodi commented 1 year ago

I'm curious to what really happened here.

I'm using nimble to install packages. Does the CI use that, or something else?

jangko commented 1 year ago

snippet from CI

          nimble install -y --depsOnly
          nimble install -y stint
          nimble install -y unittest2
          rm -f nimble.lock

both stint and unittest2 are test only deps, but rm -f nimble.lock might contribute to this discrepancy.

ITwrx commented 1 year ago

when trying to compile my test program, with import toml_serialization specified, i got:

/home/itwrx/.nimble/pkgs/toml_serialization-#master/toml_serialization.nim(15, 21) Error: undeclared identifier: 'Toml'

using master right this second, but 0.2.4 also had the same issue.

then, after reinstalling faststreams (and likely nim-toml-serialization), i was getting:

/home/itwrx/.nimble/pkgs/faststreams-0.3.0/faststreams/inputs.nim(484, 33) Error: undeclared identifier: 'baseAddr'

reinstalled faststreams again. this time I noticed that chronos and unittest2 were not already installed, so i re/installed those. upon trying to compile my program i got:

/home/itwrx/.nimble/pkgs/toml_serialization-#master/toml_serialization.nim(15, 21) Error: undeclared identifier: 'Toml'

realizing it's clearly some issue with deps not being installed properly, or something, i looked at the nimble file for this package and reinstalled serialization. it was already installed, but i overwrote it anyways. now, i don't get any compile errors due to toml_serialization deps.

something is going on with nimble and dependencies.

jangko commented 1 year ago

you should remember one thing when using status libraries, we seldom update the version number, we often rely on commit hash. on the other hand, nimble only install libraries with newer version or tag number, which will lead to confusion and newer deps not downloaded.

ITwrx commented 1 year ago

you should remember one thing when using status libraries, we seldom update the version number, we often rely on commit hash.

I noticed that (in a few different status repos), and i don't understand why, nor what to do about it. What are potential down stream project devs, and/or official lang package manager software, supposed to understand from this state?

on the other hand, nimble only install libraries with newer version or tag number, which will lead to confusion and newer deps not downloaded.

I wondered about that too, but this project's readme says i can just use nimble...

jangko commented 1 year ago

this should already fixed by removing the nimble.lock file.