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

Trying to run the build_all.sh script with a nimble package install throws error #18840

Closed
jyapayne opened this issue Sep 12, 2021 · 2 comments · Fixed by #20168
Closed

Trying to run the build_all.sh script with a nimble package install throws error #18840

jyapayne opened this issue Sep 12, 2021 · 2 comments · Fixed by #20168

Comments

@jyapayne
Copy link
Contributor

When trying to build the latest Nim devel with the "new-style" nimble package names, this error occurs:

> sh build_all.sh
bin/nim_csources_9a7f751d23c49c75a0b6f63a234c575dc0df7231 exists.

cmd: rm -f bin/nim

cmd: cp bin/nim_csources_9a7f751d23c49c75a0b6f63a234c575dc0df7231 bin/nim

cmd: bin/nim_csources_9a7f751d23c49c75a0b6f63a234c575dc0df7231 -v
Nim Compiler Version 1.0.11 [MacOSX: arm64]
Compiled at 2020-12-21
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 19440baa807bbda58290ac9d491c9aa8a2bea2fa
active boot switches: -d:release -d:danger

cmd: bin/nim c --skipUserCfg --skipParentCfg --hints:off koch
/Users/joey/Nim/config/nim.cfg(51, 1) Error: invalid package name: /Users/joey/.nimble/pkgs/nake-1.9.4-c05485d3fe838ad2a5baee52bdb56cbcda22364e

Expected Output

Should run the build script without errors.

Additional information

This causes the Nim compiler to be overwritten with the csources version.

Workaround

Rename the .nimble directory and rerun the build script.

$> nim -version
Nim Compiler Version 1.5.1 [MacOSX: arm64]
Compiled at 2021-09-12
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 5d1608c9764416e74b36f6a772f16a66d58ddc28
active boot switches: -d:release
$> nimble --version
nimble v0.13.1 compiled at 2021-09-12 15:53:20
git hash: 795704833ddfd0cdaefb45c60551d3ea205279ef
@kaushalmodi
Copy link
Contributor

kaushalmodi commented Sep 13, 2021

Recently after an update on nim devel, I was forced to delete my ~/.nimble and I had to reinstall all the nimble packages. This time, I noticed that all the package dirs in .nimble got suffixed with some sort of hash.

But now future builds of nim are failing with the same error reported above.

Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-09-09
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: a896f9f19eec221b8651849297bdbc8be72b00af
active boot switches: -d:release

Error:

cmd: rm -f bin/nim

cmd: cp bin/nim_csources_9a7f751d23c49c75a0b6f63a234c575dc0df7231 bin/nim

cmd: bin/nim_csources_9a7f751d23c49c75a0b6f63a234c575dc0df7231 -v
Nim Compiler Version 1.0.11 [Linux: amd64]
Compiled at 2020-12-21
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 19440baa807bbda58290ac9d491c9aa8a2bea2fa
active boot switches: -d:release -d:danger

cmd: bin/nim c --skipUserCfg --skipParentCfg --hints:off koch
/home/kmodi/downloads/git/Nim/config/nim.cfg(51, 1) Error: invalid package name: /home/kmodi/.nimble/pkgs/cligen-1.5.18-eeb4c230d76e328c00f1687f7da1f577cb485469

Workaround

Temporarily moving out the ~/.nimble seems to work. Below is an excerpt from my nim build script:

    # Workaround for https://github.com/nim-lang/Nim/issues/18840 .. move out the ~/.nimble
    # when running build_all.sh and then move it back.
    if [[ -d "${HOME}/.nimble" ]]
    then
        mv "${HOME}/.nimble" "${HOME}/.nimble.bkp"
    fi
    sh build_all.sh # https://github.com/nim-lang/Nim/issues/17907#issuecomment-831654235
    if [[ -d "${HOME}/.nimble.bkp" ]]
    then
        mv "${HOME}/.nimble.bkp" "${HOME}/.nimble"
    fi

@kaushalmodi
Copy link
Contributor

Ref #18810 @narimiran

narimiran added a commit to narimiran/Nim that referenced this issue Sep 20, 2021
narimiran added a commit that referenced this issue Sep 20, 2021
yyoncho added a commit to yyoncho/Nim that referenced this issue Aug 6, 2022
- at this point using pkgs2 results in nim-lang#940 or nim-lang#18840
yyoncho added a commit to yyoncho/Nim that referenced this issue Aug 6, 2022
yyoncho added a commit to yyoncho/Nim that referenced this issue Aug 6, 2022
Varriount pushed a commit that referenced this issue Aug 9, 2022
metagn pushed a commit to metagn/Nim that referenced this issue Aug 12, 2022
ringabout added a commit that referenced this issue Aug 15, 2022
* Improve error message for `strutils.addf` (#20157)

Co-authored-by: ringabout <[email protected]>

* fixes #20153; do not escape `_` for mysql [backport] (#20164)

* fixes #20153; do not escape `_` for mysql

* add a test

* Update db_mysql.nim

* Update tdb_mysql.nim

Co-authored-by: Clay Sweetser <[email protected]>

* [minor] don't find `"Hint: gc"` for action (#20170)

* fixes links in the readme (#20167)

* update the docs of arc following up #19749 (#19752)

Co-authored-by: flywind <[email protected]>

* fixes broken ssl tests (#20181)

* bootstrap the compiler with nimPreviewSlimSystem (#20176)

* bootstrap the compiler with nimPreviewSlimSystem

* threads

* docs: fix some spelling errors (#19816)

* docs: fix some spelling errors

* contributing: fix spelling error

Co-authored-by: konsumlamm <[email protected]>

* Update contributing.md

* Update intern.md

* Update manual.md

* Update manual_experimental_strictnotnil.md

* Update nimgrep_cmdline.txt

* Update pegdocs.txt

* Update testament.md

* Update tut1.md

Co-authored-by: konsumlamm <[email protected]>
Co-authored-by: Clay Sweetser <[email protected]>

* Build compiler with --noNimblePath (#20168)

- Fixes #18840

* help our poor CI; don't run CI on other branches for push (#20184)

* fix broken runnableExamples for getWeeksInIsoYear (#20193)

Based on what I understand from [Wikipedia](https://en.wikipedia.org/wiki/ISO_week_date#Weeks_per_year), 2001 does not have 53 weeks, but 2004, 2009, 2015, 2020 do. The years 2000 and 2001 seem to be copy pasted from the `getDaysInYear` example above. The result of `getWeeksInIsoYear` also seem to match up with Wikipedia.

That means these runnableExamples were never tested. Why is this the case? I only discovered this in #20091.

* improve deprecation error messages (#20197)

* Show beatutiful html instead of ugly markdown preview (#20196)

* closes #6559; add testcase (#20200)

* CI upgrade to ubuntu-20.04 (#20182)

* CI upgrade to ubuntu-20.04 

The ubuntu-18.04 environment is deprecated, consider switching to ubuntu-20.04(ubuntu-latest), or ubuntu-22.04 instead. For more details see actions/runner-images#6002

* Update azure-pipelines.yml

* Markdown code blocks part 4 (#20189)

No logic was added, just 8 more files have been migrated.

* closes #15316; add testcase (#20213)

* add version-1-6 and version-1-2 to triggered branches (#20214)

* add version-1-6 and version-1-2 to triggered branches

* Update .github/workflows/ci_packages.yml

* use quote

* closes #12955; add testcase (#20223)

* add more

Co-authored-by: konsumlamm <[email protected]>
Co-authored-by: Clay Sweetser <[email protected]>
Co-authored-by: flywind <[email protected]>
Co-authored-by: ee7 <[email protected]>
Co-authored-by: Ivan Yonchovski <[email protected]>
Co-authored-by: metagn <[email protected]>
Co-authored-by: Andrey Makarov <[email protected]>
narimiran pushed a commit that referenced this issue Aug 23, 2022
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
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

Successfully merging a pull request may close this issue.

2 participants