nodejs / unofficial-builds

Unofficial binaries for Node.js
https://unofficial-builds.nodejs.org
242 stars 50 forks source link

Add custom yup repo in favor of centos-release-scl-rh #148

Closed mistic closed 1 month ago

mistic commented 2 months ago

This PR is kindly reverting what was done at https://github.com/nodejs/unofficial-builds/pull/85

CentOS7 went EOL last week and this approach is causing errors related with the package mirror . centos-release-scl-rh is also gone from the vault so I think it's a good idea to revert this change for now.

\cc @rvagg @richardlau

LaurentGoderre commented 2 months ago

I think it might be better to migrate off of centos to a new base

mistic commented 2 months ago

Yes definitely. This was just meant to be a quick stop gap as it's not possible to currently build as is

richardlau commented 2 months ago

Have you tested this? I'm sure it's not just centos-release-scl-rh that is gone. I think you should be able to switch over to vault.centos.org (at least for the non-scl repos). Refs: https://stackoverflow.com/a/71078522

richardlau commented 2 months ago

I think you should be able to switch over to vault.centos.org (at least for the non-scl repos). Refs: https://stackoverflow.com/a/71078522

See also https://github.com/adoptium/infrastructure/pull/3643/files from Adoptium which also took scl into account.

sxa commented 2 months ago

+1 to Richard's comment. I've just set up the sclo repo on a CentOS7 container and it looks to work ok (Mostly just replacing the URLs with vault.centos.org.

centos-release-scl-rh is also gone from the vault

Really? I've just tested in a new C7 container ... It's at https://vault.centos.org/centos/7.9.2009/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm and once you fix up the stuff in /etc/yum.repos.d to point to vault.centos.org then yum install centos-release-scl-rh works ok (After which you have to similarly translate the URLs in the new files under /etc/yum.repos.d to point to the vault URL but it does seem to work and as a quick fix would be a preferable solution to using a third party repository IMHO.

For the record here's my modified CentOS-SCLo-scl-rh.repo (txt extension is so that github lets me attach it): CentOS-SCLo-scl-rh.repo.txt - with that in place it finds all of the devtoolset packages.

mistic commented 1 month ago

You're right, I think I've misjudge some steps here. @sxa could you share with me what are the instructions you're running to replace and fix the repos so it can correctly find the centos-release-scl-rh? I tried a couple of different substitutions on my side but still no luck on finding the package.

richardlau commented 1 month ago

https://github.com/nodejs/unofficial-builds/pull/149 looks more in line with what has been done elsewhere.

mistic commented 1 month ago

@richardlau yeah that was along the things I was trying on our use case. I will have to explore something else because we also need to build this for arm64 arch and in that case centos-release-scl-rh is definitely not available. I guess I will have to explore building from source

richardlau commented 1 month ago

@richardlau yeah that was along the things I was trying on our use case. I will have to explore something else because we also need to build this for arm64 arch and in that case centos-release-scl-rh is not definitely available.

Possibly https://github.com/adoptium/infrastructure/pull/3647? It looks like non-x64 architectures are in an altarch directory structure.

mistic commented 1 month ago

@richardlau thanks for the pointer of that alternative vault location. It did work. For the record I ended up doing something like

RUN ulimit -n 1024 \
    && sed -i -e 's!mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-* \
    && sed -i -e 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
    && yum install -y epel-release \
    && yum install -y centos-release-scl-rh \
    && sed -i -e 's!mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo \
    && if [ "$(uname -m)" == "x86_64" ]; then \
        sed -i -e 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo; \
    else \
        sed -i -e 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo; \
    fi \
    && yum upgrade -y \
    ....

As arm64 is not important in the context of this recipe I'm going to close this PR and I think we can move on with https://github.com/nodejs/unofficial-builds/pull/149.

Thanks for the help!