Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nim says "invalid package name" #940

Open
retsyo opened this issue Sep 15, 2021 · 5 comments
Open

nim says "invalid package name" #940

retsyo opened this issue Sep 15, 2021 · 5 comments

Comments

@retsyo
Copy link

retsyo commented Sep 15, 2021

I always cloned latest nim source and compiled in MSYS2+MingW64 on windows 10 64 bits. Everything is OK months ago. But now, something weired happened

  1. first, the version of nim.exe and nimble.exe
$ nim --v
Nim Compiler Version 1.5.1 [Windows: amd64]
Compiled at 2021-06-26
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 39fbf3c84bd83613407e22b3de215d9a221b9422
active boot switches: -d:release


$ nimble --v
nimble v0.13.1 compiled at 2021-09-15 06:36:34
git hash: 795704833ddfd0cdaefb45c60551d3ea205279ef
  1. I delete C:\Users\USER\.nimble\ totally

  2. the new nim compiler can compile the following a.nim without problem

# a.nim
echo 1

the processing:

$ nim c -r a
Hint: used config file 'E:\msys64\home\USER\_nim\nim\config\nim.cfg' [Conf]
Hint: used config file 'E:\msys64\home\USER\_nim\nim\config\config.nims' [Conf]
...................
CC: stdlib_digitsutils.nim
CC: stdlib_assertions.nim
CC: stdlib_dollars.nim
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: a.nim
Hint:  [Link]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
26554 lines; 1.454s; 31.953MiB peakmem; proj: a; out: Z:\a.exe [SuccessX]
Hint: Z:\a.exe  [Exec]
1
  1. nimble can install package
$ nimble install listsv
    Prompt: No local packages.json found, download it from internet? [y/N]
y
    Answer: Downloading Official package list
    Success Package list downloaded.
Downloading https://github.com/srwiley/listsv.git using git
   Warning: The package has no tagged releases, downloading HEAD instead.
  Verifying dependencies for [email protected]
 Installing [email protected]
  Success:  listsv installed successfully.

  1. then the strange happens
$ rm a.exe

$ nim c -r a
E:\msys64\home\USER\_nim\nim\config\nim.cfg(51, 1) Error: invalid package name: C:\Users\USER\.nimble\pkgs\listsv-0.1.0-a6dfb9de705011f6d04902493cac04a4f20a0435

I found that the new-installed package is under C:\Users\USER\.nimble\pkgs\listsv-0.1.0-a6dfb9de705011f6d04902493cac04a4f20a0435\ directory. However, I remember it should be listsv-0.1.0. So what happened to nimble?

thanks

@dom96
Copy link
Collaborator

dom96 commented Sep 15, 2021

The cause of this is that your Nimble is too new for your compiler :)

Use Nim devel/1.6 or downgrade Nimble and recreate your .nimble directory.

I think this is something we should consider resolving before releasing the new Nimble CC @Araq @bobeff

@narimiran
Copy link
Member

Related: nim-lang/Nim#18840

@narimiran
Copy link
Member

I think this is something we should consider resolving before releasing the new Nimble CC @Araq @bobeff

Also, we should handle better/differently this error:

Error:  You are working with an old version of Nimble cache repository.
Hint:  Please delete your "/home/username/.nimble" directory.

Maybe nimble should do that automatically? Make a backup of that folder, extract package names, delete the folder, populate a new folder with the packages?

@bobeff
Copy link
Contributor

bobeff commented Sep 15, 2021

Maybe nimble should do that automatically? Make a backup of that folder, extract package names, delete the folder, populate a new folder with the packages?

@narimiran This was my initial plan, but unfortunately, it cannot happen because the checksum of the package is calculated on the entire package content and not only on the installed files.

The cause of this is that your Nimble is too new for your compiler :)

I think this is something we should consider resolving before releasing the new Nimble

@dom96 Unfortunately the new functionality depends on a commit present only in the latest Nim version, in particular on the functionality added to the nimblecmd.nim file for recognizing the new Nimble cache directory names with hash sums in them.

@dom96
Copy link
Collaborator

dom96 commented Sep 17, 2021

I don't think we can release it like this unfortunately. Preventing changing to an older Nim is a showstopper. I'm sure we can resolve this, the question is: how should we do it?

narimiran added a commit to narimiran/Nim that referenced this issue Sep 20, 2021
narimiran added a commit to nim-lang/Nim that referenced this issue Sep 20, 2021
narimiran added a commit to nim-lang/Nim that referenced this issue Sep 20, 2021
yyoncho added a commit to yyoncho/Nim that referenced this issue Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants