nim-lang / nimble

Package manager for the Nim programming language.
Other
1.25k stars 174 forks source link

`nimble dump`: Different output between `stable` and `devel` versions #941

Closed CrazyManLabs closed 2 years ago

CrazyManLabs commented 2 years ago

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 see one key difference in generated output between stable and devel versions, which prevents my script from doing its thing:

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):

dom96 commented 2 years ago

@bobeff this looks like a regression

bobeff commented 2 years ago

@CrazyManLabs @dom96 Yes, it was a regression. I fixed it in 9f8304b.