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

.github, config, json, nimble: bump Nim from 1.6.12 to 2.0.0 #723

Merged
merged 7 commits into from
Aug 8, 2023

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Jan 12, 2023

See the release blog posts rc1 and rc2 and 2.0, detailed changelog, and changes since 1.6.12.

config.nims changes:

  • Remove strictEffects, which Nim 2.0 enables by default.
  • Disable noisy ProveInit and Uninit warnings for now.
  • Enable strictDefs unconditionally. It was previously conditional to support older versions of Nim that lacked strictDefs.

Update patched stdlib json and parsejson.

In the tests, reflect a Nim 2.0 change to imports. From the changes affecting backward compatibility:

Relative imports will not resolve to searched paths anymore, e.g. import ./tables now reports an error properly.


To-do:

  • Wait for Nim 2.0 release
  • Resolve nimble test errors, e.g.:
    tests/all_tests.nim(2, 11) Error: cannot open file: ./helpers
  • Windows: resolve uuids error (due to nim-lang/Nim@612abda):
    C:\Users\runneradmin\.nimble\pkgs2\uuids-0.1.11-393f5fcefbc8ad3cf167e59760144208ff8f9f76\uuids\urandom.nim(15, 8) Error: undeclared identifier: 'useWinUnicode'
    I've created pragmagic/uuids#9, but that may not be sufficient, and long-term I'd like to do uuid: use best practices for UUID generation #424 instead
  • Update patched json.nim and parsejson.nim
  • Windows: resolve patching error:
C:\Users\runneradmin\nimcache\all_tests_d\all_tests_EC059F07D9BFDE95FE3FAA825662EFD80E11A567.exe [SuccessX]
Hint: C:\Users\runneradmin\nimcache\all_tests_d\all_tests_EC059F07D9BFDE95FE3FAA825662EFD80E11A567.exe [Exec]
Running `nimble --verbose build -d:release`... failure
     Info:  Nimble data file "C:\Users\runneradmin\.nimble\nimbledata2.json" has been loaded.
  Verifying dependencies for configlet@4.0.0
    Reading official package list
   Checking for cligen@#b962cf8bc0be847cbc1b4f77952775de765e9689
     Info:  Dependency on cligen@#b962cf8bc0be847cbc1b4f77952775de765e9689 already satisfied
  Verifying dependencies for cligen@1.5.19
    Reading official package list
   Checking for jsony@#2a2cc4331720b7695c8b66529dbfea6952727e7b
     Info:  Dependency on jsony@#2a2cc4331720b7695c8b66529dbfea6952727e7b already satisfied
  Verifying dependencies for jsony@1.1.3
    Reading official package list
   Checking for parsetoml@#6e5e16179fa2db60f2f37d8b1af4128aaa9c8aaf
     Info:  Dependency on parsetoml@#6e5e16179fa2db60f2f37d8b1af4128aaa9c8aaf already satisfied
  Verifying dependencies for parsetoml@0.7.1
    Reading official package list
   Checking for supersnappy@#e4df8cb5468dd96fc5a4764028e20c8a3942f16a
     Info:  Dependency on supersnappy@#e4df8cb5468dd96fc5a4764028e20c8a3942f16a already satisfied
  Verifying dependencies for supersnappy@2.1.3
 Attempting to execute hook buildBefore in D:\a\configlet\configlet\configlet.nimble
Checking patch cligen/parseopt3.nim...
error: while searching for:
    p.kind = cmdError?
    return?
  if p.pos < p.cmd.len:                 # Take opt arg from next param?
    p.val = p.cmd[p.pos]?
    p.pos += 1?
  elif p.longNoVal.len != 0:?
    p.val = ""?
    p.pos += 1?

error: patch failed: cligen/parseopt3.nim:267
error: cligen/parseopt3.nim: patch does not apply
stack trace: (most recent call last)
C:\Users\RUNNER~1\AppData\Local\Temp\nimblecache-0\nimscriptapi_3135216885.nim(222, 29)
D:\a\configlet\configlet\configlet.nimble(31, 37) buildBefore
D:\a\configlet\configlet\patches\patch.nim(61, 3) ensureThatNimblePackagesArePatched
D:\a\configlet\configlet\patches\patch.nim(53, 8) patchCligen
D:\a\configlet\configlet\patches\patch.nim(46, 25) patch
D:\a\configlet\configlet\patches\patch.nim(12, 5) gorgeCheck
D:\a\configlet\configlet\patches\patch.nim(12, 5) Error: unhandled exception: failed to apply patch [OSError]
nimscriptwrapper.nim(160) execScript

    Error:  Exception raised during nimble script execution
     Info:  Nimble data file "C:\Users\runneradmin\.nimble\nimbledata2.json" has been saved.

D:\a\configlet\configlet\tests\test_binary.nim([1165](https://github.com/exercism/configlet/actions/runs/5785968697/job/15679844551#step:6:1166)) test_binary
D:\a\configlet\configlet\tests\test_binary.nim(1026) main
D:\a\configlet\configlet\src\exec.nim(68) execAndCheck
Error: unhandled exception:  [OSError]
Error: execution of an external program failed: 'C:\Users\runneradmin\nimcache\all_tests_d\all_tests_EC059F07D9BFDE95FE3FAA825662EFD80E11A567.exe'
stack trace: (most recent call last)
C:\Users\RUNNER~1\AppData\Local\Temp\nimblecache-0\nimscriptapi_3135216885.nim(210, 16)
D:\a\configlet\configlet\configlet.nimble(28, 3) testTask
D:\a\configlet\configlet\nimdir\lib\system\nimscript.nim(265, 7) exec
D:\a\configlet\configlet\nimdir\lib\system\nimscript.nim(265, 7) Error: unhandled exception: FAILED: nim r ./tests/all_tests.nim [OSError]
       Tip: 9 messages have been suppressed, use --verbose to show them.
nimscriptwrapper.nim(160) execScript

@ee7 ee7 changed the title .github, nimble: bump Nim from 1.6.10 to 2.0.0 .github, nimble: bump Nim from 1.6.12 to 2.0.0 May 26, 2023
@ee7 ee7 force-pushed the bump-nim-2.0.0 branch 6 times, most recently from a40ee0f to 2ad2d54 Compare August 7, 2023 13:49
@ee7
Copy link
Member Author

ee7 commented Aug 7, 2023

I have no idea why this would cause the parseopt3 patching to fail on Windows.

Edit: maybe something in nim-lang/Nim@f7c203f#diff-8f98e7617bc9dd47ac179ddec678781d48d70e7f7b9f37f76298ef643f82c690

Edit2: maybe the hash function now differs between Linux and Windows?

@ee7 ee7 marked this pull request as ready for review August 8, 2023 11:29
ee7 added 2 commits August 8, 2023 14:00
We had this conditional to support older versions of Nim that lacked
strictDefs.
@ee7 ee7 merged commit fa7d0bb into exercism:main Aug 8, 2023
6 checks passed
@ee7 ee7 deleted the bump-nim-2.0.0 branch August 8, 2023 14:40
@ee7 ee7 changed the title .github, nimble: bump Nim from 1.6.12 to 2.0.0 .github, config, json, nimble: bump Nim from 1.6.12 to 2.0.0 Aug 8, 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 this pull request may close these issues.

2 participants