When I try to install app-misc/anki, I got: ``` [blocks B ] sys-apps/yarn ("sys-apps/yarn" is soft blocking net-libs/nodejs-22.10.0) ``` According to https://yarnpkg.com/corepack, `corepack enable` is the recommend way to install yarn now. I tried remove yarn from anki's ebuild, and setup yarn with corepack for portage user, it's does work. But that requires manual setup and read/write outside sandbox, it's just a workaround, not a real solution. Is that a better way to handle this?
Created attachment 912206 [details, diff] Tentative patch that multiple packages to provide /usr/bin/yarn Thanks for the report! Can you confirm or deny that you've got net-libs/nodejs[corepack] installed on your system? What manual setup was needed to succeed in installing the package? > I tried remove yarn from anki's ebuild, and setup yarn with corepack for portage user, it's does work. [...] > Is that a better way to handle this? Yes, Anki shouldn't care if net-libs/nodejs[corepack] or sys-apps/yarn provides /usr/bin/yarn. I can provide a definitive patch by tomorrow evening. In the meantime, anyone with this issue could try to either: - install >=net-libs/nodejs-20.12.1[-corepack] or - apply the attached patch and then try to build Anki.
(In reply to Lucio Sauer from comment #1) > Thanks for the report! Can you confirm or deny that you've got > net-libs/nodejs[corepack] installed on your system? What manual setup was > needed to succeed in installing the package? I do have net-libs/nodejs[corepack] installed: ``` $ equery u net-libs/nodejs [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for net-libs/nodejs-22.4.1-r1: U I + + corepack : Enable the experimental corepack package management tool <...> + + npm : Enable NPM package manager <...> ``` Corepack seems will install yarn inside user home, I do got a `/user/bin/yarn` executable file after install nodejs w/ corepack use flag enabled, but it is just a wrapper, so I setup yarn with this command: ``` sudo -u portage corepack prepare yarn@stable --activate ``` After that command, I got this on portage user's home directory: ``` $ tree --dirsfirst /var/lib/portage/home/.cache /var/lib/portage/home/.cache └── node └── corepack ├── v1 │ └── yarn │ └── 4.5.3 │ └── yarn.js └── lastKnownGood.json 6 directories, 2 files ``` And then try build anki with `ebuild /var/db/repos/gentoo/app-misc/anki/anki-24.06.3-r2.ebuild compile`, it's works.
> - apply the attached patch Hmm, so this doesn't resolve the issue as I had hoped. I have yet to find a way to activate the Yarn wrapper provided by nodejs[corepack], without it accessing the network to download the required tarball. While I could provide it in SRC_URI, that would pin Yarn to a specific version for no reason. More generally, the setup for offline workflows as described in https://github.com/nodejs/corepack/tree/main?tab=readme-ov-file#offline-workflow should rather be adopted into an eclass[1] to avoid code duplication, because modern Yarn (>1) is apparently supposed to be installed per-package rather than globally. IMO, it's unfortunate that net-libs/nodejs[corepack] installs the Yarn wrapper globally and thus blocks sys-apps/yarn, when the former isn't really offline-only compatible at the moment. [1]: See also https://github.com/gentoo/gentoo/pull/33426