As expected, release frequency and size is winding down as the style settles in - v0.6 is a fairly small release compared to v0.5.
The main highlight must be that takes care of an ugly wart, namely the lonely , appearing on a single line in function calls - the change is easiest to see in the PR that introduced it:
# pre
initSrcGen(
g,
if conf == nil:
newPartialConfigRef()
else:
conf
,
)
#post
initSrcGen(
g,
if conf == nil:
newPartialConfigRef()
else:
conf,
)
Apart from that, the code allows itself to be compiled with any 2.0 release in the hopes of the language grammar not changing from one point release to another - if it were to do so, the potency of the included correctness checker would go down a notch.
There's a few other minor cleanups and fixes for nim-libp2p, the latest of our larger projects to format itself :)
As usual, there's a commit showcasing what the compiler would look like, formatted.
Enjoy the release! - if you're using the vscode plugin, you'll still need to update nph manually.
Thanks! That lonely comma will find some company then :)
Nph is great
nph 0.6.1 is out simplifying installation but otherwise containing no significant changes.
Since the 0.6 release, nimlangserver, and therefore the vscode extension has learned to use nph to format code - if you have nph installed, ctrl-shift-i in vscode has you covered!
On OSX Sonoma v14.7
nph -v v0.6.0-0-g31bdced
nim -v Nim Compiler Version 2.2.0 [MacOSX: amd64] Compiled at 2024-10-02 Copyright (c) 2006-2024 by Andreas Rumpf active boot switches: -d:release
nimble install nph
nimble.nim(304) buildFromDir
Any suggestions?
There's now a handy github action that checks nph formatting in CI:
name: Check `nph` formatting
on:
pull_request:
jobs:
nph:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check `nph` formatting
uses: arnetheduck/nph-action@v1
with:
version: latest
options: "."
fail: true
suggest: trueThanks ... that did the trick.
After upgrading nimble.... for some unknown reason the "nimble install nph" installed a whole new distribution of Nim 2.0.14! to build the package... A bit surprising... Now to cleanup the unwanted leftovers :-).
I wanted to try out nph and i am unable to install it from nimble on mac... what should be the workaround ?
❯ nimble install nph
Downloading https://github.com/arnetheduck/nph using git
Info: Using the 'GITHUB_TOKEN' environment variable for GitHub API Token.
Downloading https://github.com/c-blake/hldiff using git
Info: Ignoring hldiff:1.0.6 because out of range >= 1.0.7 & < 2
Info: Ignoring hldiff:1.0.5 because out of range >= 1.0.7 & < 2
Info: Ignoring hldiff:1.0.4 because out of range >= 1.0.7 & < 2
Downloading https://github.com/c-blake/cligen.git using git
Info: Ignoring cligen:1.9.4 because out of range >= 1.9.5
Info: Ignoring cligen:1.9.3 because out of range >= 1.9.5
Downloading https://github.com/c-blake/adix using git
Info: Ignoring adix:0.7.5 because out of range >= 0.7.6
Info: Ignoring adix:0.7.4 because out of range >= 0.7.6
Downloading https://github.com/haltcase/glob using git
Info: Ignoring glob:0.11.2 because out of range >= 0.11.3 & < 0.12.0
Info: Ignoring glob:0.11.1 because out of range >= 0.11.3 & < 0.12.0
Info: Ignoring glob:0.11.0 because out of range >= 0.11.3 & < 0.12.0
Downloading https://github.com/nitely/nim-regex using git
Downloading https://github.com/nitely/nim-unicodedb using git
Info: Ignoring unicodedb:0.13.1 because out of range >= 0.13.2
Info: Ignoring unicodedb:0.13.0 because out of range >= 0.13.2
Info: Ignoring unicodedb:0.12.0 because out of range >= 0.13.2
Downloading https://github.com/status-im/nim-toml-serialization using git
Info: Ignoring toml_serialization:0.2.16 because out of range >= 0.2.18 & < 0.3.0
Info: Ignoring toml_serialization:0.2.14 because out of range >= 0.2.18 & < 0.3.0
Downloading https://github.com/status-im/nim-faststreams using git
Info: Ignoring faststreams:0.4.1 because out of range >= 0.5.0
Info: Ignoring faststreams:0.4.0 because out of range >= 0.5.0
Info: Ignoring faststreams:0.3.0 because out of range >= 0.5.0
Downloading https://github.com/status-im/nim-stew using git
Downloading https://github.com/arnetheduck/nim-results using git
Downloading https://github.com/status-im/nim-unittest2 using git
Downloading https://github.com/status-im/nim-serialization using git
Downloading https://github.com/status-im/nim-unittest2 using git
Downloading https://github.com/c-blake/cligen.git using git
Downloading https://github.com/c-blake/adix using git
Building adix/util/lfreq using c backend
Info: compiling nim package using /opt/homebrew/Cellar/nim/2.2.6/nim/bin/nim
Nim Output /Users/kraken/.cache/nim/lfreq_r/@[email protected]:9:10: fatal error: 'stdio.h' file not found
... 9 | #include <stdio.h>
... | ^~~~~~~~~
... 1 error generated.
... Error: execution of an external compiler program 'clang -c -w -ferror-limit=3 -fno-strict-aliasing -pthread -O3 -I/opt/homebrew/Cellar/nim/2.2.6/nim/lib -I/Users/kraken/.nimble/pkgcache/githubcom_cblakeadix_0.7.7/util -o /Users/kraken/.cache/nim/lfreq_r/@[email protected] /Users/kraken/.cache/nim/lfreq_r/@[email protected]' failed with exit code: 1
...
... /Users/kraken/.cache/nim/lfreq_r/@pmath.nim.c:9:10: fatal error: 'math.h' file not found
... 9 | #include <math.h>
... | ^~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/lfreq_r/@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/lfreq_r/@pparseutils.nim.c:9:10: fatal error: 'math.h' file not found
... 9 | #include <math.h>
... | ^~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/lfreq_r/@phashes.nim.c:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/lfreq_r/@psystem.nim.c:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... /Users/kraken/.cache/nim/lfreq_r/@pstd@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/lfreq_r/@pstd@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
... 1 error generated.
... /Users/kraken/.cache/nim/lfreq_r/@pstd@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
Downloading https://github.com/arnetheduck/nph using git
Building nph/nph using c backend
Info: compiling nim package using /opt/homebrew/Cellar/nim/2.2.6/nim/bin/nim
Nim Output /Users/kraken/.cache/nim/nph_r/@pstd@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
... Error: execution of an external compiler program 'clang -c -w -ferror-limit=3 -fno-strict-aliasing -pthread -O3 -I/opt/homebrew/Cellar/nim/2.2.6/nim/lib -I'/Users/kraken/.nimble/pkgcache/githubcom_arnetheducknph_#head/src' -o /Users/kraken/.cache/nim/nph_r/@pstd@[email protected] /Users/kraken/.cache/nim/nph_r/@pstd@[email protected]' failed with exit code: 1
...
... /Users/kraken/.cache/nim/nph_r/@psystem.nim.c:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... /Users/kraken/.cache/nim/nph_r/@pstd@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 11 error error generated generated.
... .
... /Users/kraken/.cache/nim/nph_r/@pmath.nim.c:9:10: fatal error: 'math.h' file not found
... 9 | #include <math.h>
... | ^~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/nph_r/@[email protected]:9:10: fatal error: 'fcntl.h' file not found
... 9 | #include <fcntl.h>
... | ^~~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/nph_r/@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/nph_r/@punicode.nim.c:9:10: fatal error: 'math.h' file not found
... 9 | #include <math.h>
... | ^~~~~~~~
... /Users/kraken/.cache/nim/nph_r/@palgorithm.nim.c:9:10: fatal error: 'math.h' file not found
... 9 | #include <math.h>
... | ^~~~~~~~
... 1 error generated.
... 1 error generated.
... /Users/kraken/.cache/nim/nph_r/@[email protected]:9:10: fatal error: 'string.h' file not found
... 9 | #include <string.h>
... | ^~~~~~~~~~
... 1 error generated.
... /Users/kraken/.cache/nim/nph_r/@pparseutils.nim.c:9:10: fatal error: 'math.h' file not found
... 9 | #include <math.h>
... | ^~~~~~~~
... 1 error generated.
Tip: 416 messages have been suppressed, use --verbose to show them.
nimble.nim(419) buildFromDir
Error: Build failed for the package: nph