-
Notifications
You must be signed in to change notification settings - Fork 78
Fix CentOS 7 recipes (x64-glibc-217 & x64-pointer-compression & x86) #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vitaliylag
wants to merge
16
commits into
nodejs:main
Choose a base branch
from
vitaliylag:fix_centos7
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2e1c665
Fix CentOS 7 recipes
vitaliylag 97e3f35
Update should-build.sh for pointer-compression
vitaliylag dab6687
Update should-build.sh for pointer-compression
vitaliylag 4a7769e
Update should-build.sh for pointer-compression
vitaliylag 9cf9c9c
Update should-build.sh and add comments
vitaliylag 3f940e5
Update should-build.sh and add comments
vitaliylag fb14ffe
Update should-build.sh for pointer-compression
vitaliylag 9082183
Add version test function
vitaliylag 5793b67
Add version test function (patch)
vitaliylag e2dcb25
Update versions
vitaliylag b5427aa
Fix typo
vitaliylag 9776ab2
Update should-build.sh for pointer-compression
vitaliylag 3f53f5c
Update should-build.sh for pointer-compression
vitaliylag 38df85d
Simplify all should-build.sh
vitaliylag b7475f7
Simplify all should-build.sh (patch)
vitaliylag 9e0d608
Merge branch 'main' into fix_centos7
vitaliylag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/bash -eu | ||
|
|
||
| # Copies files from recipes/x64-glibc-217 to: | ||
| # recipes/x64-pointer-compression | ||
| # recipes/x86 | ||
|
|
||
| __dirname="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| recipesDir="$(dirname "$__dirname")/recipes" | ||
| srcRecipeDir="$recipesDir/x64-glibc-217" | ||
|
|
||
|
|
||
|
|
||
| # Copy to x64-pointer-compression | ||
|
|
||
| for dirBase in x64-pointer-compression; do | ||
| destRecipeDir="$recipesDir/$dirBase" | ||
| mkdir -p "$destRecipeDir/files" | ||
|
|
||
| cp -f "$srcRecipeDir/Dockerfile" "$destRecipeDir/" | ||
| cp -f "$srcRecipeDir/run.sh" "$destRecipeDir/" | ||
| # cp -f "$srcRecipeDir/run_other.sh" "$destRecipeDir/" # Recipe specific code | ||
| cp -f "$srcRecipeDir/run_versions.sh" "$destRecipeDir/" | ||
| # cp -f "$srcRecipeDir/should-build.sh" "$destRecipeDir/" # Pointer compression is supported from v13.4 | ||
| cp -rf "$srcRecipeDir/files/"* "$destRecipeDir/files/" | ||
| done | ||
|
|
||
|
|
||
|
|
||
| # Copy to x86 | ||
|
|
||
| if true; then | ||
| destRecipeDir="$recipesDir/x86" | ||
| mkdir -p "$destRecipeDir/files" | ||
|
|
||
| cp -f "$srcRecipeDir/Dockerfile" "$destRecipeDir/" | ||
| cp -f "$srcRecipeDir/run.sh" "$destRecipeDir/" | ||
| # cp -f "$srcRecipeDir/run_other.sh" "$destRecipeDir/" # Recipe specific code | ||
| # cp -f "$srcRecipeDir/run_versions.sh" "$destRecipeDir/" # Different versions of programs are used (because devtoolset-12 is not available) | ||
| # cp -f "$srcRecipeDir/should-build.sh" "$destRecipeDir/" | ||
|
|
||
| # cp -f "$srcRecipeDir/files/"*.repo "$destRecipeDir/files/" # Different versions of programs are used (because devtoolset-12 is not available) | ||
| # cp -f "$srcRecipeDir/files/installPrerequisites" "$destRecipeDir/files/" # Different versions of programs are used (because devtoolset-12 is not available) | ||
| cp -f "$srcRecipeDir/files/installFromSourceCode" "$destRecipeDir/files/" | ||
| cp -f "$srcRecipeDir/files/opt__gcc15__enable" "$destRecipeDir/files/" | ||
|
|
||
| sed -i -e 's/ --platform=linux\/amd64 / --platform=linux\/386 /g' "$destRecipeDir/Dockerfile" | ||
| sed -i -E 's/# RUN (.* binutils )/RUN \1/g' "$destRecipeDir/Dockerfile" | ||
| sed -i -E 's/--build=x86_64-redhat-linux/--build=i686-redhat-linux/g' "$destRecipeDir/Dockerfile" | ||
| # sed -i -e 's/gcc-15.1.0/gcc-12.4.0/g' "$destRecipeDir/Dockerfile" | ||
| # sed -i -e 's/gcc15/gcc12/g' "$destRecipeDir/Dockerfile" "$destRecipeDir/files/opt__gcc12__enable" "$destRecipeDir/files/installFromSourceCode" | ||
| sed -i -e 's/devtoolset-12/devtoolset-9/g' "$destRecipeDir/files/opt__gcc"*'__enable' | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
recipes/x64-glibc-217/files/etc__yum.repos.d__devtoolset.repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [devtoolset-12] | ||
| name=Devtoolset 12 | ||
| baseurl=https://buildlogs.centos.org/c7-devtoolset-12.x86_64/ | ||
| gpgcheck=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/bin/bash -eux | ||
|
|
||
| # Calc vars | ||
|
|
||
| id="$1" | ||
| url="$2" | ||
| configureArgsStr="$3" | ||
|
|
||
| base=$(basename "$url") | ||
| name=${base%.*} | ||
| name=${name%.tar} | ||
| ext=${base:${#name}} | ||
|
|
||
| case "$ext" in | ||
| .tar.xz|.txz) formatOpt=--xz;; | ||
| .tar.gz|.tgz) formatOpt=--gzip;; | ||
| .tar.bz2|.tbz2) formatOpt=--bzip2;; | ||
| *) formatOpt=--auto-compress | ||
| esac | ||
|
|
||
| # Run commands | ||
|
|
||
| curl -fL "$url" | tar --extract --directory=/usr/src "$formatOpt" | ||
|
|
||
| source /opt/gcc15/enable | ||
| export CC='ccache gcc' | ||
| export CXX='ccache g++' | ||
|
|
||
| cd "/usr/src/$name" | ||
| chmod +x ./contrib/download_prerequisites 2>/dev/null && ./contrib/download_prerequisites | ||
| ./configure $configureArgsStr | ||
| make -j $(nproc) | ||
| make install | ||
|
|
||
| hash -r | ||
| ccache -s > "/root/ccacheStat_$name.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/bash -eux | ||
|
|
||
| sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* | ||
| sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* | ||
| yum install -y epel-release # Adds extra repos | ||
| yum upgrade -y | ||
|
|
||
| yum install -y bzip2 # Required to compile gcc | ||
| yum install -y gcc-c++ # Required to compile Node.js v7- | ||
| yum install -y make # Allows compilation | ||
| yum install -y ccache # Allows caching | ||
| yum install -y devtoolset-12 # Includes gcc 12.1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash -eux | ||
|
|
||
| DIR=/opt/gcc15 | ||
|
|
||
| source /opt/rh/devtoolset-12/enable | ||
|
|
||
| export PATH="$DIR/bin${PATH:+:${PATH}}" | ||
| export MANPATH="$DIR/share/man${MANPATH:+:${MANPATH}}" | ||
| export INFOPATH="$DIR/share/info${INFOPATH:+:${INFOPATH}}" | ||
| export LD_LIBRARY_PATH="$DIR/lib64:$DIR/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" | ||
| export PKG_CONFIG_PATH="$DIR/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" | ||
|
|
||
| if [ -f "$DIR/bin/gcc" ]; then | ||
| export LDFLAGS='-static-libstdc++' | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash -eux | ||
|
|
||
| config_flags= | ||
| destCPU=x64 | ||
| arch=x64 | ||
| variation=glibc-217 | ||
|
|
||
| # export CFLAGS='-march=skylake' | ||
| # export CXXFLAGS='-march=skylake' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash -eux | ||
|
|
||
| setPython() { | ||
| if isNodeVersionGE 'v22.3'; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) | ||
| if isNodeVersionGE 'v14.14'; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) | ||
| if isNodeVersionGE 'v4.0'; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) | ||
|
|
||
| # Node.js v16.0 is first version not supporting Python 2.7 but supports Python 3.6 ~ 3.9 so Python 3.9 is chosen | ||
| } | ||
|
|
||
| setGCC() { | ||
| if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) | ||
| if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v22.1 | ||
| # GCC 4.8.5: Node.js v4.0 ~ v10.14 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [devtoolset-12] | ||
| name=Devtoolset 12 | ||
| baseurl=https://buildlogs.centos.org/c7-devtoolset-12.x86_64/ | ||
| gpgcheck=0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version check is not AND-chained with the subsequent lines, so the overall exit code is only based on the final test. Use
&&or enableset -eat the top to combine all conditions.