debuerreotype / debuerreotype

reproducible, snapshot-based Debian rootfs builder
MIT License
339 stars 58 forks source link

gcc 12 missing ? #165

Open 10000TB opened 5 months ago

10000TB commented 5 months ago

gcc-12-aarch64-linux-gnu, g++-12-aarch64-linux-gnu and gcc-12 seems unable to install. any idea how to add them ?

+ debuerreotype/scripts/debuerreotype-apt-get rootfs -o Acquire::Check-Valid-Until=true install -yqq --no-install-recommends acpica-tools autoconf automake bc binutils-multiarch bison build-essential ccache chrpath clang cpio clang-format clang-format-13 clang-tidy-13 default-jre device-tree-compiler dkms flex gawk gcc-aarch64-linux-gnu gcc-10-multilib gcc-12 gcc-12-aarch64-linux-gnu g++-12 g++-12-aarch64-linux-gnu gdisk gperf git lcov libbsd-dev libc6 libc6-dev-arm64-cross libc6-i386 libelf-dev libfdt-dev libglib2.0-dev libjson-c-dev libpcre3-dev libparted-dev libssl-dev libtool libtool-bin libxml-simple-perl lld lldb llvm mono-devel nasm ninja-build pkg-config protobuf-compiler python3 python3-colorama python3-crcmod python3-dev python3-distutils-extra python3-intelhex python3-lz4 python3-natsort python3-packaging python3-pip python3-ply python3-protobuf python3-psutil python3-pycodestyle python3-pykwalify python3-pyelftools python3-rich python3-rsa python3-setuptools python3-six python3-yaml python-is-python3 squashfs-tools srecord uuid-dev virtualenv xz-utils zlib1g-dev
E: Unable to locate package gcc-12
E: Package 'gcc-12-aarch64-linux-gnu' has no installation candidate
E: Unable to locate package g++-12-aarch64-linux-gnu
E: Couldn't find any package by regex 'g++-12-aarch64-linux-gnu'

debuerreotype version 0.15 commit 13a5a14

tianon commented 5 months ago

I'm not sure how you've built your rootfs (nor why you're using debuerreotype raw instead of something like a Dockerfile that's just FROM debian:xxx), but I'm not able to reproduce a failure :sweat_smile:

10000TB commented 5 months ago

good question -- I am just looking at someone else's code, and trying to add a few new dependencies into rootfs file. Not sure why they originally did not use docker.

debuerreotype-apt-get rootfs  -o Acquire::Check-Valid-Until=true install -yqq --no-install-recommends \
     ...
     gcc-aarch64-linux-gnu \
    gcc-10-multilib \
    gcc-12 \
    gcc-12-aarch64-linux-gnu \
    ...

Are you saying, if I run this same command within a container built from debuerreotype/Dockerfile, it should install ok ?

tianon commented 5 months ago

No, I'm saying I need more information about what the code is doing (and why!) in order to help diagnose why it isn't working (or give better suggestions for how to rewrite it to accomplish your goals more effectively).

10000TB commented 5 months ago

Hey! srry -- here is the script https://github.com/google/platforms-bios-buildenv/blob/main/build.sh

and the repo is the setup. Basically, what I do is

run sudo ./build.sh to generate rootfs tarball.

I am hoping to install gcc-12 g++-12 g++-12-aarch64-linux-gnu gcc-12-aarch64-linux-gnu into rootfs, which is giving me issues

So basically, i added gcc-12 g++-12 g++-12-aarch64-linux-gnu gcc-12-aarch64-linux-gnu in here https://github.com/google/platforms-bios-buildenv/blob/main/build.sh#L66, and the got the issue reported.

If I run same install on my current ubuntu, it installs fine, e.g.

$ sudo apt-get install -y gcc-12 g++-12 virtualenv g++-12-aarch64-linux-gnu gcc-12-aarch64-linux-gnu
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gcc-12 is already the newest version (12.3.0-13).
gcc-12 set to manually installed.
g++-12 is already the newest version (12.3.0-13).
g++-12 set to manually installed.
virtualenv is already the newest version (20.25.0+ds-2).
g++-12-aarch64-linux-gnu is already the newest version (12.3.0-11cross1).
gcc-12-aarch64-linux-gnu is already the newest version (12.3.0-11cross1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tianon commented 5 months ago

I didn't look at all the details of that script yet, but https://github.com/google/platforms-bios-buildenv/blob/c6507eb1a6887611b4fb436b2d2cc96fb7a06935/build.sh#L33 is definitely the smoking gun; buster doesn't have gcc 12, and certainly not back in 2019 🙈

tianon commented 5 months ago

Looking more at the script, I'm not sure "fully reproducible" is strictly necessary for what it's building? Regardless, I think refactoring it to use Docker and a Dockerfile is definitely gonna be easier to maintain over time IMO 😅

(and have the benefit of being a lot easier to test and use 👀)

tianon commented 5 months ago

https://hub.docker.com/_/golang/tags?name=1.15.10-buster is honestly really close; that plus some package pinning / snapshot would probably do the trick