Trying to build pakku-git with nim-git from the AUR this month is giving this error:
==> Starting build()... NIM: lib/tools Error: cannot open '/usr/lib/nim/lib/system.nim' make: *** [Makefile:115: lib/tools] Error 1
It was working back in January and with -d:nimPreviewSlimSystem yet now it fails right at the start of the build and /usr/lib/nim/lib/system.nim certainly does not exist in the built nim-git package, not sure exactly what is going on there. pakku/lib/tools.nim is only a very short 20 line file which doesn't seem to specify using that file explicitly, and the error is not indicating a particular line there, so it could be something to do with the nim-git AUR packaging, but I don't know, perhaps someone has some suggestion?
This is an issue with nim-git, i added a comment
the packaging instructions were changed in this commit
meaning nim now expects its libraries to be in /usr/nim/lib/nim.
this is a welcome change, imho; it should close some outstanding packaging-related issues, but it will cause some problems until packagers update to the new layout.
for now, i recommend using choosenim.
Thank you! This seems to work in the nim-git PKGBUILD, at least now it builds pakku-git when I just tried, which is as much testing as it has had, which is to say very little!
$ diff -u originalPKGBUILD PKGBUILD
--- originalPKGBUILD 2023-03-17 14:43:22.201997809 +0000
+++ PKGBUILD 2023-03-17 14:55:52.262103318 +0000
@@ -112,9 +112,9 @@
install -Dm 755 bin/{nim,nimgrep} -t "$pkgdir/usr/bin"
cd "${pkgdir}/nim"
- install -dm 755 "${pkgdir}"/{etc/nim,usr/lib/nim}
+ install -dm 755 "${pkgdir}"/{etc/nim,usr/lib/nim/lib}
find lib -mindepth 1 -maxdepth 1 -exec \
- cp -dpr --no-preserve=ownership '{}' -t "$pkgdir/usr/lib/nim" \;
+ cp -dpr --no-preserve=ownership '{}' -t "$pkgdir/usr/lib/nim/lib" \;
find config -mindepth 1 -maxdepth 1 -exec \
cp -dpr --no-preserve=ownership '{}' -t "$pkgdir/etc/nim" \;
cp -dpr --no-preserve=ownership \
that's great work.
and we should maybe talk about this in the aur comments instead of here, but some of the following could be relevant for other packagers.
'docs/*' are put into /usr/share/nim, instead 'docs/nimdoc.c{l,s}s' need to be in /usr/lib/nim/doc
'nim-gdb' needs its associated python scripts
i couldn't build it with pakku on my crappy laptop, because it clones all 4GB of csources into /tmp and i only have 8GB ram. how do you do a sparse checkout in a pkgbuild?
dochack.js: what is supposed to build this? 'build_all.sh' doesn't do it. is it a typo, and 'dochack.nim' is supposed to be in /usr/lib/nim/tools/dochack and nim doc builds it?
the packaging guidelines say to run 'install.sh' but this hasn't been updated so it puts things in the wrong places. whats niminst?
You can set a different build directory with Pakku, it doesn't have to build in /tmp, that is only the default. "man pakku.conf" explains how to use this option. What I do for nim-git myself though, because it is quite time consuming to download and build is this:
$ cd some-new-dir-on-my-ssd-hdd
$ pakku -Sz
$ cd nim-git
$ makepkg -s
$ pakku -U nim-git-xxxx
Then I can later do:
$ cd src/Nim
$ git remote add upstream https://github.com/nim-lang/Nim.git
$ git pull upstream devel
$ cd ../..
$ makepkg -ef
$ pakku -U nim-git-xxxy
I can keep the git repo like this and rebuild faster using the incremental build feature, also pull in newer commits without having to download everything, and checkout different commits and return to head later, while also having the convenience of nim-git being a package I can install or unistall and keep different versions at various commits, also copy them over to other laptops if needed.Hi, I am the one who broke this, sorry about that. If wrote more about why this was necessary here: https://github.com/nim-lang/Nim/pull/21328
dochack.js is built by ./koch tools. I don't know why build_all.sh it does not work for you, it should run that command. niminst is the part of the compiler tools and generates the Linux install scripts (including install.sh). It has not been kept up to date for years and I was too scared to touch it since nothing is documented. I would skip the install script and copy files manually.
I use install.sh and it was working for me last time I tried, don't know how it will be after the directory changes though. When you get a prebuilt package from here:
https://nim-lang.org/install_unix.html
then you can extract it somewhere and run "sudo sh install.sh /opt" then "cd /usr/local/bin" and "sudo ln -s /opt/nim/bin/nim" which will run that version as default, to go back to the OS package then mv the link to another name, also if you mv the nim dir in /opt to a new name you can have several versions of nim.