From 6d9b8f44ffc8c5a8ce6e191fe79e6931bcbb0856 Mon Sep 17 00:00:00 2001 From: chylli-deriv Date: Tue, 19 Mar 2024 11:36:29 +0800 Subject: [PATCH 1/8] update README --- .github/dependabot.yaml | 6 ++++ .github/workflows/build_workflow.yml | 48 ++++++++++++++++++++++++++++ README.md | 23 +++++++------ rebuild.sh | 15 ++++++--- 4 files changed, 79 insertions(+), 13 deletions(-) create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/build_workflow.yml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..8ac6b8c4 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml new file mode 100644 index 00000000..ec0dfea4 --- /dev/null +++ b/.github/workflows/build_workflow.yml @@ -0,0 +1,48 @@ +name: Build workflow +run-name: Build workflow +on: + push: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true +jobs: + build: + runs-on: ubuntu-latest # Maybe here is a blocker + container: + image: debian:bullseye + defaults: + run: + shell: bash -le {0} + env: + BRANCH: ${{ github.ref_name }} + steps: + - name: prepare + + run: | + apt-get update + apt-get -y dist-upgrade + apt-get -y install locales build-essential gettext libpq5 libpq-dev make gcc git openssh-client curl wget sudo lsb-release socat redis-server cmake + echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen + locale-gen + if [[ ! $BRANCH =~ perl-[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "Error: Branch name must be perl-" + exit 1 + fi + VERSION=$(echo $BRANCH | sed -e 's/.*perl-\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/') + + echo "VERSION=$VERSION" | tee -a $GITHUB_ENV + git config --global user.email "cibot@deriv.com" + git config --global user.name "ci bot" + git config --global --add safe.directory $PWD # ignore ownership problem + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4 + - name: compile + run: | + bash ./rebuild.sh + - name: push + run: | + rm -rf lib bin man + mv /home/git/binary-com/perl/{bin,lib} . + git add lib bin + git commit -m "[ci skip] compile $VERSION" + git push origin HEAD:$BRANCH diff --git a/README.md b/README.md index 78656f4e..9d82ab01 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,19 @@ # perl -Custom compiled perl for Binary.com -# compiling steps +Custom compiled perl for Binary.com -Download source code from http://www.cpan.org/src/5.0/perl-5.26.2.tar.gz +## compiling steps -We defined `-Dusesitecustomize` and removed `-Dusethreads`. Most of other parameters are copied from `perl -V | grep config_args` -Run following command: -``` -./Configure -Dusesitecustomize -Dinc_version_list=none -Dprefix=/home/git/binary-com/perl -Dvendorprefix=/home/git/regentmarkets/cpan/local -Dvendorlib=/home/git/regentmarkets/cpan/local/lib/perl5 -Dvendorarch=/home/git/regentmarkets/cpan/local/lib/perl5/x86_64-linux -Duselargefiles -Dccflags="-DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security" -Dldflags=" -Wl,-z,relro" -Dlddlflags="-shared -Wl,-z,relro" -Dcccdlflags="-fPIC" -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Uuseithreads -Uusemultiplicity -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -des -make -make install +```bash +VERSION=5.26.1 ./rebuild.sh ``` + +## compiling it with CI + +1. enable CI test in your forked repo : + at https://github.com/username/perl/settings/actions set `Allow all actions and reusable workflows` + and `Read and write permissions`. Don't forget to click `save` at both section. +2. Or create a new branch directly on binary-com/perl repo +3. create a branch whose name include a perl version `perl-x.yy.zz`, e.g. `upgrade/perl.5.38.2` + +Then CI will download and compile perl and push it to your branch diff --git a/rebuild.sh b/rebuild.sh index b1dd9846..215f622d 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -1,10 +1,16 @@ #!/bin/bash set -e -wget http://www.cpan.org/src/5.0/perl-5.26.2.tar.gz -rm -rf perl-5.26.2 -tar xzvf perl-5.26.2.tar.gz -cd perl-5.26.2 +if [ -z "$VERSION" ]; then + echo "No VERSION environment variable set. Exiting..." + exit 1 +fi +echo "Building perl version $VERSION" +rm -rf bin lib man +wget http://www.cpan.org/src/5.0/perl-$VERSION.tar.gz +rm -rf perl-$VERSION +tar xzvf perl-$VERSION.tar.gz +cd perl-$VERSION # Apply patch for fixing Time::Local tests entering year 2020 (CPAN RT#124787) zcat ../patches/0001-Fix-Time-Local-tests.patch.gz | patch -p1 --verbose || exit 1 @@ -12,6 +18,7 @@ zcat ../patches/0001-Fix-Time-Local-tests.patch.gz | patch -p1 --verbose || exit # Apply patch for fixing gcc 10 problem https://github.com/openwrt/packages/pull/12178 patch -Np1 < ../patches/999-fix-build-failure-against-gcc-10.patch +#We defined `-Dusesitecustomize` and removed `-Dusethreads`. Most of other parameters are copied from `perl -V | grep config_args` ./Configure -Dusesitecustomize -Dinc_version_list=none -Dprefix=/home/git/binary-com/perl -Dsitelib=/home/git/regentmarkets/cpan-private/local/lib/perl5 -Dsitearch=/home/git/regentmarkets/cpan-private/local/lib/perl5/x86_64-linux -Dvendorprefix=/home/git/regentmarkets/cpan/local -Dvendorlib=/home/git/regentmarkets/cpan/local/lib/perl5 -Dvendorarch=/home/git/regentmarkets/cpan/local/lib/perl5/x86_64-linux -Duselargefiles -Dccflags="-DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security" -Dldflags=" -Wl,-z,relro" -Dlddlflags="-shared -Wl,-z,relro" -Dcccdlflags="-fPIC" -Duse64bitint -Dman1dir=none -Dman3dir=none -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Uuseithreads -Uusemultiplicity -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -des make && make test && make install From 00f7c63fdbba586e640cd690e64c0b72ba51bed7 Mon Sep 17 00:00:00 2001 From: chylli-deriv Date: Tue, 19 Mar 2024 11:36:51 +0800 Subject: [PATCH 2/8] [ci skip] From 8fd9ecbbc8432f3e46f7dbbaed54625714eab08d Mon Sep 17 00:00:00 2001 From: chylli-deriv <52912308+chylli-deriv@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:57:13 +0800 Subject: [PATCH 3/8] Update README.md [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d82ab01..d7f69bcb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # perl -Custom compiled perl for Binary.com +Custom compiled perl for deriv.com ## compiling steps From 65d9ba3cdb81c5b096f4422334e5e3b265e51acf Mon Sep 17 00:00:00 2001 From: chylli-deriv <52912308+chylli-deriv@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:28:42 +0800 Subject: [PATCH 4/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7f69bcb..b3299ffb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Custom compiled perl for deriv.com ## compiling steps ```bash -VERSION=5.26.1 ./rebuild.sh +VERSION=5.26.2 ./rebuild.sh ``` ## compiling it with CI From e41cee1b77c67c2741702dd7d52d29e80095c8fb Mon Sep 17 00:00:00 2001 From: chylli-deriv <52912308+chylli-deriv@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:45:27 +0800 Subject: [PATCH 5/8] Update .github/workflows/build_workflow.yml Co-authored-by: kathleen-deriv <122329285+lim-deriv@users.noreply.github.com> --- .github/workflows/build_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index ec0dfea4..c36bb98d 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -2,6 +2,8 @@ name: Build workflow run-name: Build workflow on: push: + branches: + - '!master' concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true From 85fd6e7aed182f2421f1021fce321c18ebebf92f Mon Sep 17 00:00:00 2001 From: chylli-deriv Date: Tue, 26 Mar 2024 16:57:10 +0800 Subject: [PATCH 6/8] Tue Mar 26 09:27:16 CST 2024 trigger tests [ci][skip dummy] From 3f943651bd5f7a3b77f5177ea7440dae8f6bfbb1 Mon Sep 17 00:00:00 2001 From: chylli-deriv Date: Tue, 26 Mar 2024 17:03:18 +0800 Subject: [PATCH 7/8] try no branch name --- .github/workflows/build_workflow.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index c36bb98d..ec0dfea4 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -2,8 +2,6 @@ name: Build workflow run-name: Build workflow on: push: - branches: - - '!master' concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true From 7c554df108674e6aa35616a8b0ce33367da3c024 Mon Sep 17 00:00:00 2001 From: chylli-deriv Date: Tue, 26 Mar 2024 17:05:13 +0800 Subject: [PATCH 8/8] use branches-ignore --- .github/workflows/build_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index ec0dfea4..5d15295b 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -2,6 +2,8 @@ name: Build workflow run-name: Build workflow on: push: + branches-ignore: + - 'master' concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true