Skip to content

Inconsistencies with dnf/apt install gcc #8423

Closed

Description

@PhilipDeegan

Hi

I've been testing out pkgx recently to see if I can use it to replace usage of dnf or apt across different linux distros.

I've run into two separate issues when trying to use gcc on fedora and ubuntu.
Such that, compilation works when I dnf or apt install gcc, and does not when I pkgx install gcc

Is this something that I should report here or elsewhere?

Thanks

Activity

  1. jhheider commented on Oct 11, 2024

    @jhheider
    Contributor

    It depends on what problem you're having. If it's a problem with the environment construction, then this is the correct repo. If it's a problem with the gnu.org/gcc formula, then pkgxdev/pantry.

    It might specifically be an issue with the pkgx install scripts. If you instead use pkgx +gcc^{version} ... as your command line instead of using install, do you experience the same issues? That would point to a problem with the install methodology.

    You could try running your makefile (or whatever) with CC='pkgx +gnu.org/gcc^14 gcc' or pkgx +gcc^14 +make make, as an example, to use pkgx to manage the full environment.

  2. PhilipDeegan commented on Oct 11, 2024

    @PhilipDeegan
    Author

    The errors, were during compilation of python package during a pip install.

    I think the ubuntu issue was, the build system couldn't find x86_64-linux-gnu-gcc

    and the fedora issue was a missing standard header

     fatal error: stdlib.h: No such file or directory
    

    it's possible what you suggest might work, but I'm not sure compilation during pip install uses CC or CXX

  3. mxcl commented on Oct 11, 2024

    @mxcl
    Contributor

    This is probably a deeper problem with how we add the gcc headers to the env.

  4. jhheider commented on Oct 11, 2024

    @jhheider
    Contributor

    the build system couldn't find x86_64-linux-gnu-gcc

    yes, we don't add the system-target binaries to the provides: key for gnu.org/gcc. this would be solved using pkgx +gnu.org/gcc, but because they aren't listed as a provided binary, no installation shim exists.

  5. PhilipDeegan commented on Oct 12, 2024

    @PhilipDeegan
    Author

    you can see the fedora error here

    the ubuntu issue was happening locally for me during a docker build (but still during pip install internally)

    you should be able to reproduce this via

    comment out this line

    and add if_install gcc -v here

  6. transferred this issue frompkgxdev/pkgxon Jan 15, 2025
  7. tannevaled commented on May 29, 2026

    @tannevaled
    Contributor

    Took a look — split the issue into two:

    (1) `x86_64-linux-gnu-gcc` not found on Ubuntu — root cause confirmed. The `gnu.org/gcc` recipe doesn't install the Debian-style multi-arch triplet symlinks that autoconf / distutils / pip build backends probe for. PR #pending adds them.

    (2) `stdlib.h: No such file or directory` on Fedora — separate problem: pkgx gcc relies on system glibc-devel for `/usr/include/stdlib.h`. On a minimal Fedora docker base without glibc-devel, that header isn't there, and pkgx doesn't currently ship a glibc bottle that would substitute.

    Fixing (2) properly needs a `gnu.org/glibc` bottle in pantry + the gcc recipe wired to use its headers via `--sysroot` or `CPATH`. This is non-trivial (see #12968 — the glibc bottle work — and brewkit#348 / the `bklibcvenv` pattern), but it's the right path for a fully-isolated pkgx-only toolchain.

    Workaround until that lands: install your distro's `glibc-devel` / `libc6-dev` package on the host (`dnf install glibc-devel` / `apt install libc6-dev`). Then pkgx gcc picks them up from `/usr/include`.

  8. jhheider commented on Oct 19, 2026

    @jhheider
    Contributor

    Triplet symlinks landed in #13083. The Fedora header error needs system glibc-devel.

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