Skip to content

Gentoo's emerge fails to install packages after replacing GNU coreutils #8837

Description

@Alxhr0

uutils-coreutils: 0.2.2
OS: Gentoo

When trying to emerge any package or even uutils-coreutils again when uutils-coreutils are used instead of the GNU Coreutils, emerge can't install any package with "cryptic" errors

Last thing I tried was to disable the quiet output in the makefile and this is what it tried to run

    Finished `release` profile [optimized] target(s) in 2m 22s
if [ -d "/var/tmp/portage/sys-apps/uutils-coreutils-system-0.2.2/work/coreutils-0.2.2/src/uucore/locales" ]; then \
        mkdir -p "/var/tmp/portage/sys-apps/uutils-coreutils-system-0.2.2/work/coreutils-0.2.2/target/release/locales/uucore"; \
        for locale_file in "/var/tmp/portage/sys-apps/uutils-coreutils-system-0.2.2/work/coreutils-0.2.2"/src/uucore/locales/*.ftl; do \
                install -v "$locale_file" "/var/tmp/portage/sys-apps/uutils-coreutils-system-0.2.2/work/coreutils-0.2.2/target/release/locales/uucore/"; \
        done; \
fi;
# Copy utility-specific locales
-v: function/utility not found
-v: function/utility not found
make: *** [GNUmakefile:425: locales] Error 1
>>> Source compiled

I suspect emerge tries to use install, but only the argument gets parsed in this case -v and that throws the error

I tried to disable the quiet output in the GNUmakefile, but install shows fine as a command

I tried to emerge the zen-browser later and it failed with the same error just with the -b being parsed to something

Activity

  1. naoNao89 commented on Oct 7, 2025

    @naoNao89
    Contributor

    I can reproduce this:

    $ INSTALL=""
    $ $INSTALL -v file.txt /tmp/
    zsh: command not found: -v

    a bootstrap issue: the Makefile needs install to build/install uutils, but if uutils has already replaced system coreutils and install isn't working, the build fails.

    Fix

    Use the just-built install instead of the system one. Modify GNUmakefile#L9:

    INSTALL ?= install

    ifneq ($(wildcard $(BUILDDIR)/coreutils),)
      INSTALL = $(BUILDDIR)/coreutils install
    else
      INSTALL = install
    endif

    This prevents the bootstrap problem when uutils replaces system coreutils.

    Tested on macOS.

  2. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    Hm will try that

  3. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    Although shouldn't other packages work when the install command from uutils-coreutils was already present on the system?

  4. added a commit that references this issue on Oct 8, 2025
    979d36e
  5. naoNao89 commented on Oct 8, 2025

    @naoNao89
    Contributor

    I've created PR #8847 to fix this bootstrap issue. The solution moves the INSTALL variable definition to after BUILDDIR is set, allowing it to conditionally use the just-built coreutils install command. This prevents the chicken-and-egg problem where emerge can't build uutils because it depends on uutils being functional.

    The fix:

    • Uses the built coreutils/install binary if available
    • Falls back to system install for first-time builds
    • Works for both multicall and standalone build modes
    • Tested on macOS with both debug and release profiles

    @Alxhr0 Could you test this on your Gentoo system when you get a chance?

  6. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    Sure

  7. oech3 commented on Oct 8, 2025

    @oech3
    Contributor

    Is believing install we built instead of uutils/install which is already installed making a sense?

  8. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    I'm not sure I understand?

  9. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    Oh I see now

  10. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    @naoNao89 So far there is no difference

    zen fails like this

    >>> Emerging (1 of 1) www-client/zen-bin-1.16b::guru
     * zen-bin-1.16b.tar.xz BLAKE2B SHA512 size ;-) ...                                                            [ ok ]
    >>> Unpacking source...
    >>> Unpacking zen-bin-1.16b.tar.xz to /var/tmp/portage/www-client/zen-bin-1.16b/work
    >>> Source unpacked in /var/tmp/portage/www-client/zen-bin-1.16b/work
    >>> Preparing source in /var/tmp/portage/www-client/zen-bin-1.16b/work/zen ...
    >>> Source prepared.
    >>> Configuring source in /var/tmp/portage/www-client/zen-bin-1.16b/work/zen ...
    >>> Source configured.
    >>> Compiling source in /var/tmp/portage/www-client/zen-bin-1.16b/work/zen ...
    >>> Source compiled.
    >>> Test phase [not enabled]: www-client/zen-bin-1.16b
    
    >>> Install www-client/zen-bin-1.16b into /var/tmp/portage/www-client/zen-bin-1.16b/image
    -d: function/utility not found
     * ERROR: www-client/zen-bin-1.16b::guru failed (install phase):
     *   insinto failed
     *
     * Call stack:
     *               ebuild.sh, line 136:  Called src_install
     *             environment, line 588:  Called insinto '/opt/zen'
     *        phase-helpers.sh, line  64:  Called __helpers_die 'insinto failed'
     *   isolated-functions.sh, line 121:  Called die
     * The specific snippet of code:
     *              die "$@"
     *
     * If you need support, post the output of `emerge --info '=www-client/zen-bin-1.16b::guru'`,
     * the complete build log and the output of `emerge -pqv '=www-client/zen-bin-1.16b::guru'`.
     * The complete build log is located at '/var/tmp/portage/www-client/zen-bin-1.16b/temp/build.log'.
     * The ebuild environment file is located at '/var/tmp/portage/www-client/zen-bin-1.16b/temp/environment'.
     * Working directory: '/var/tmp/portage/www-client/zen-bin-1.16b/work/zen'
     * S: '/var/tmp/portage/www-client/zen-bin-1.16b/work/zen
    
  11. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    I'm currently building uutils-coreutils

  12. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    So that fix does work for uutils-coreutils, but other packages still fail, which isn't the best

  13. oech3 commented on Oct 8, 2025

    @oech3
    Contributor

    You can try to manually replace system coreutils binaries by GNU's one e.g. install what you doubt.

  14. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    I mean sure I could use install from GNU, but It's not really a good solution when someone would like to use uutils-coreutils as the only coreutils, but they can't because no package can be installed

  15. oech3 commented on Oct 8, 2025

    @oech3
    Contributor

    This suggestion just inverstigation for this bug.

    By the way, this is strange... I'm using mmain branch as system coreutils on Arch. So is this something ebuild specific?

  16. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    I mean I have one idea that could perhaps, be the issue but I'm not exactly sure yet

  17. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    But I need to figure out if I can build uutils-coreutils as separate binaries so like ls,cat etc, but without them being a symlink to the main multicall binary

  18. oech3 commented on Oct 8, 2025

    @oech3
    Contributor

    For accuracy, is both of uutils/coreutils on your system and you tried to build 0.2.2?

  19. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    yup

  20. oech3 commented on Oct 8, 2025

    @oech3
    Contributor

    Would you extract install from https://archlinux.org/packages/core/x86_64/coreutils/download/ on $HOME/bin, export PATH+=:$HOME/bin and emerge?

  21. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    I fixed it!

  22. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    The issue is when ls,install,cat etc are symlinks, Emerge instead of running ls,install or cat passes the flags directly to the coreutils binary

  23. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    I just made my ebuild build uutils-coreutils exactly how Gentoo builds GNU Coreutils, without the multicall binary

  24. Alxhr0 commented on Oct 8, 2025

    @Alxhr0
    Author

    Hmm I think I can close it, since I did find a solution :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions