Gitea released 1.11 within they need nodejs/npm to build. Reproducible: Always
" To build from source, the following programs must be present on the system: - go 1.11.0 or higher - node 10.0.0 or higher with npm "
I got a error in the "compile"-section of the gitea-1.11.4.ebuild[^1]. It seems to me, npm is used to download sources which is not allowed in compile-phase trough sandboxing (?)! ~~~~ npm ERR! code EAI_AGAIN npm ERR! errno EAI_AGAIN npm ERR! request to https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org npm ERR! A complete log of this run can be found in: npm ERR! /var/tmp/portage/www-apps/gitea-1.11.4/homedir/.npm/_logs/2020-04-23T09_18_34_823Z-debug.log code.gitea.io/gitea/modules/queue make: *** [Makefile:497: node_modules] Error 1 make: *** Waiting for unfinished jobs.... ~~~~ [^1]: https://github.com/nemunaire/gentoo/blob/41b0e43e253871625bbdec748b79805a796f3952/www-apps/gitea/gitea-1.11.4.ebuild
Indeed, I got the same error when I tested the ebuild on another machine with other portage settings. As it is required that the build has to be performed offline, I'm looking for another ebuild using npm this way, as a sample; but can't find any at the moment... That's why I closed the PR meanwhile.
1: There is one ebuild where the maintainer got upstream to package required node modules with their release. That's something you could pursue with gitea perhaps. 2: You may have to, *sigh*, do something similar that go-module ebuilds do, where you just put 500 lines to SRC_URI (I don't know how many node modules gitea actually needs). It's a maintenance hell, but easily automated with scripts. 3: Migrate to -bin packages in ::gentoo, if possible. Any idea how other distros deal with it? Like openSUSE, Fedora and Debian? I think they have pretty strict build-systems too, similar to Gentoo.
Thanks juippis for your response. Sadly, according to https://repology.org/project/gitea/versions, there are only a few distributions that package an up-to-date gitea (Alpine, ArchLinux, FreeBSD, ...). As I can see, most of them don't have our requirements. I think the option 1 seems the most optimal to me. I'll try to get in touch with them about that.
In fact, I see that since 1.11.1, they provide an archive with all nodes modules. Used by the FreeBSD port! https://github.com/go-gitea/gitea/pull/10298 That's weird, they didn't mention it in the release message[1], that's why I missed it... [1]: https://blog.gitea.io/2020/02/gitea-1.11.1-is-released/
Created attachment 635506 [details, diff] ebuild patch for gitea 1.11.4 Upstream avoids the npm buildtime dependency by adding some files to the release tarball, but we need to change the build target for this (to: "backend").
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9127c687a0abd0859fc051909c6b2c96ecd49fae commit 9127c687a0abd0859fc051909c6b2c96ecd49fae Author: Pierre-Olivier Mercier <nemunaire@nemunai.re> AuthorDate: 2020-04-17 09:28:35 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2020-05-13 07:59:43 +0000 www-apps/gitea: bump to 1.11.5 Closes: https://bugs.gentoo.org/710996 Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Pierre-Olivier Mercier <nemunaire@nemunai.re> Closes: https://github.com/gentoo/gentoo/pull/15564 Signed-off-by: Joonas Niilola <juippis@gentoo.org> www-apps/gitea/Manifest | 1 + www-apps/gitea/gitea-1.11.5.ebuild | 141 +++++++++++++++++++++++++++++++++++++ www-apps/gitea/metadata.xml | 1 + 3 files changed, 143 insertions(+)