I'm trying out latest versions of nim and nimble after reading this forum post.
As I'm using choosenim - I'm switching between versions using choosenim stable and choosenim devel commands.
One of my build scripts uses nimble dump command to get information about package without the need to parse/evaluate *.nimble file.
To be exact - I'm trying to detect, if current package will generate dynamic library or executable by checking extension of each entry in bin property, returned from nimble dump (some customizations of *.nimble file are required to make it work; this is not the whole task, which I'm trying to solve, but the basic idea is as described).
I have these customizations in *.nimble file:
# ...
bin = @[projectName()]
import std/os
for name in bin:
namedBin[name] = name.toDll()
# ...
Also here is my config.nims (to make it clear what I'm trying to build):
switch("app", "lib")
# ...
I'm using these constructs, because:
I do not want to change contents of *.nimble file (line with bin = @[...]) itself whenever I rename package (as during development it is hard to name things right from the first attempt :) );
I want to generate correctly-named binary (as I'm building dynamic library and not an executable, but nimble build generates binary with same filename for both cases without this modification).
I see one key difference in generated output between stable and devel versions, which prevents my script from doing its thing:
when using stable version: nimble dump will give information about bin list respecting namedBin overrides:
$ choosenim stable
Switched to Nim 1.4.8
$ nimble dump
name: "<some_package_name>"
# ...
bin: "lib<some_package_name>.so"
# ...
when using devel version: nimble dump will give information about bin list without any adaptations, made by namedBin overrides:
$ choosenim devel
Switched to Nim #devel
$ nimble dump
name: "<some_package_name>"
# ...
bin: "<some_package_name>"
# ...
Is this a regression/bug or is this expected behavior?
If this is expected behavior - is there other way of getting information from namedBin property without parsing/evaluating *.nimble file "by hand"?
Also one more question (not related to the issue, but still ...): is there a way to tell nimble to generate correctly-named binary depending on its type (exe or dll) without such customizations?
Here are some details about used tools:
$ choosenim --version
choosenim v0.7.4 (2020-10-20 17:30:52) [linux/amd64]
$ choosenim stable
Switched to Nim 1.4.8
$ nimble --version
nimble v0.13.1 compiled at 2021-05-25 00:49:34
git hash: couldn't determine git hash
$ choosenim devel
Switched to Nim #devel
$ nimble --version
nimble v0.13.1 compiled at 2021-09-15 00:51:39
git hash: couldn't determine git hash
And here are some details about environment (if this is needed):
KDE Neon 5.22.5 (based on Ubuntu 20.04 (focal))
Linux 5.11.0-34-generic #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021 x86_64 GNU/Linux
I'm trying out latest versions of
nim
andnimble
after reading this forum post. As I'm usingchoosenim
- I'm switching between versions usingchoosenim stable
andchoosenim devel
commands.One of my build scripts uses
nimble dump
command to get information about package without the need to parse/evaluate*.nimble
file. To be exact - I'm trying to detect, if current package will generate dynamic library or executable by checking extension of each entry inbin
property, returned fromnimble dump
(some customizations of*.nimble
file are required to make it work; this is not the whole task, which I'm trying to solve, but the basic idea is as described).I have these customizations in
*.nimble
file:Also here is my
config.nims
(to make it clear what I'm trying to build):I'm using these constructs, because:
*.nimble
file (line withbin = @[...]
) itself whenever I rename package (as during development it is hard to name things right from the first attempt :) );nimble build
generates binary with same filename for both cases without this modification).I see one key difference in generated output between
stable
anddevel
versions, which prevents my script from doing its thing:when using
stable
version:nimble dump
will give information aboutbin
list respectingnamedBin
overrides:when using
devel
version:nimble dump
will give information aboutbin
list without any adaptations, made bynamedBin
overrides:Is this a regression/bug or is this expected behavior? If this is expected behavior - is there other way of getting information from
namedBin
property without parsing/evaluating*.nimble
file "by hand"? Also one more question (not related to the issue, but still ...): is there a way to tellnimble
to generate correctly-named binary depending on its type (exe
ordll
) without such customizations?Here are some details about used tools:
And here are some details about environment (if this is needed):