public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] ci: Add a linux CI
@ 2023-07-09 17:12 Tal Regev
  2023-07-12 12:42 ` Christophe Lyon
  0 siblings, 1 reply; 3+ messages in thread
From: Tal Regev @ 2023-07-09 17:12 UTC (permalink / raw)
  To: gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 500 bytes --]

Description: adding a ci in a github repo. Everytime a user will do a PR to
master branch or releases branches, it will activate the ci on their repo.
for example: https://github.com/talregev/gcc/pull/1. Can help users to
verify their own changes before submitting a patch.

ChangeLog: Add a linux CI

Bootstrapping and testing: I tested it on linux with
host: x86_64-linux-gnu
target: x86_64-linux-gnu
some tests are failing. You can see the results in my CI yourself.

Patch: attach to this email.

[-- Attachment #2: linux_ci.patch --]
[-- Type: application/octet-stream, Size: 3551 bytes --]

diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml
new file mode 100644
index 00000000000..f90ea0bd311
--- /dev/null
+++ b/.github/workflows/linux.yaml
@@ -0,0 +1,113 @@
+name: Linux
+on:
+  push:
+    branches: 
+      - master
+      - releases/gcc-*
+    tags:
+      - releases/gcc-*
+  pull_request:
+    branches: 
+      - master
+      - releases/gcc-*
+    tags:
+      - releases/gcc-*
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+  cancel-in-progress: true
+
+jobs:
+  build:
+    name: ${{ matrix.name }}-build
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        include:
+          - name: ubuntu-x64
+            target: x86_64
+        
+      fail-fast: false
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          fetch-depth: 2
+
+      - name: Install dependencies
+        run: |
+          sudo apt-get -qq update
+          sudo apt install -y gcc-multilib build-essential flex zlib1g-dev gnat gdc
+
+      - name: Install dependencies for aarch64
+        if: success() && contains(matrix.target, 'aarch64')
+        run: |
+          sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
+
+      - name: Download prerequisites
+        if: success()
+        run: |
+          ./contrib/download_prerequisites    
+
+      - name: Configure x86_64
+        if: success() && matrix.target == 'x86_64'
+        run: |
+          unset ADA_INCLUDE_PATH
+          unset ADA_OBJECT_PATH
+          cd ../
+          mkdir build
+          cd build
+          ../gcc/configure \
+                --enable-languages=c,c++,go,d,fortran,objc,obj-c++,m2 \
+                --prefix=/usr \
+                --with-gcc-major-version-only \
+                --program-prefix=x86_64-linux-gnu- \
+                --enable-shared \
+                --enable-linker-build-id \
+                --libexecdir=/usr/lib \
+                --without-included-gettext \
+                --enable-threads=posix \
+                --libdir=/usr/lib \
+                --enable-nls \
+                --enable-clocale=gnu \
+                --enable-libstdcxx-debug \
+                --enable-libstdcxx-time=yes \
+                --with-default-libstdcxx-abi=new \
+                --enable-gnu-unique-object \
+                --disable-vtable-verify \
+                --enable-plugin \
+                --enable-default-pie \
+                --with-system-zlib \
+                --with-target-system-zlib=auto \
+                --enable-objc-gc=auto \
+                --enable-multiarch \
+                --disable-werror \
+                --with-arch-32=i686 \
+                --with-abi=m64 \
+                --with-multilib-list=m32,m64,mx32 \
+                --enable-multilib \
+                --with-tune=generic \
+                --without-cuda-driver \
+                --enable-checking=release \
+                --build=x86_64-linux-gnu \
+                --host=x86_64-linux-gnu \
+                --target=x86_64-linux-gnu
+
+      - name: Make bootstrap
+        if: success()
+        run: |
+          cd ../build
+          make bootstrap -j$(nproc)
+
+      - name: Make install
+        if: success()
+        run: |
+          cd ../build
+          sudo make install
+
+      - name: Tests
+        if: success()
+        run: |
+          /usr/bin/x86_64-linux-gnu-gcc --version
+          /usr/bin/x86_64-linux-gnu-gcc -v
+          cd ../build
+          make -k check

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ci: Add a linux CI
  2023-07-09 17:12 [PATCH] ci: Add a linux CI Tal Regev
@ 2023-07-12 12:42 ` Christophe Lyon
  2023-07-12 17:52   ` Tal Regev
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Lyon @ 2023-07-12 12:42 UTC (permalink / raw)
  To: Tal Regev; +Cc: gcc-patches, Maxim Kuvyrkov

[-- Attachment #1: Type: text/plain, Size: 1903 bytes --]

Hi,


On Sun, 9 Jul 2023 at 19:13, Tal Regev via Gcc-patches <
gcc-patches@gcc.gnu.org> wrote:

> Description: adding a ci in a github repo. Everytime a user will do a PR to
> master branch or releases branches, it will activate the ci on their repo.
> for example: https://github.com/talregev/gcc/pull/1. Can help users to
> verify their own changes before submitting a patch.
>
> ChangeLog: Add a linux CI
>
> Bootstrapping and testing: I tested it on linux with
> host: x86_64-linux-gnu
> target: x86_64-linux-gnu
> some tests are failing. You can see the results in my CI yourself.
>
>
Thanks for sharing your patch & idea.
I think GCC validation is and has been a problem for a long time ;-)

I am not a maintainer, so take my comments with a grain of salt ;-)

- I don't know if the GCC project would want to accept such patches,
pointing to github etc...
- github is not the main GCC repository, it hosts several mirrors AFAIK
- these mirrors are updated by individuals, I think, I don't know at which
frequency etc... correct me if I'm wrong
- would this mean that each time each such mirror/fork is updated, this
triggers builds on github servers? Would that handle the load? I don't
think so (also: how many "free" minutes of CPU time can be used?)
- as you have noticed the GCC testsuite is not 100% clean (i.e. there are
failures, so 'make check' always exits with an error code), making such a
step useless. What we need is to compare to a baseline (eg. results of
previous build) and report if there were detections. Several companies have
CI systems doing this (either internally, or on publicly accessible servers)

In particular, at Linaro we monitor regressions for several arm and aarch64
flavors, and we are also experimenting with "pre-commit CI", based on
patchwork.

Thanks anyway for sharing, it's good to see such initiatives ;-)

Christophe



> Patch: attach to this email.
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ci: Add a linux CI
  2023-07-12 12:42 ` Christophe Lyon
@ 2023-07-12 17:52   ` Tal Regev
  0 siblings, 0 replies; 3+ messages in thread
From: Tal Regev @ 2023-07-12 17:52 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: gcc-patches, Maxim Kuvyrkov

[-- Attachment #1: Type: text/plain, Size: 4284 bytes --]

- I am also not sure if the maintainers of gcc will want this ci, but many
other developers will be happy about that.
  Because many copies of gcc are already fork on github. We can see it
here: https://github.com/gcc-mirror/gcc.
  Also gcc maintainers are requested to check and validate the gcc as I did
in the CI here:
  https://gcc.gnu.org/contribute.html. They ask to test it on one platform
and run all testsuites.
  The CI can be extended to work not one job on linux, but other os as
windows and osx as well, then also more platforms on one click check.
- Github is not the main repo for gcc. github holds mirrors for gcc. Like
here: https://github.com/gcc-mirror/gcc.
   Many developers and forks are already on github.
- I am thinking this repo https://github.com/gcc-mirror/gcc is created by
the gcc maintainers because to do a mirror, you need to `git push --mirror`
from the
  original repo as they explain here:
https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository.
But maybe I
  am mistaken.
- It means each time a person will have a PR on their repo. the ci will be
activated. (In the mirror repo they turn the ci). Also the mirror will
allow it,
  It can activate the ci each time the master or the releases branches are
changed. github will handle it. It has already done it for all the other
open source projects.
  For public open source each job has time for 6 hours. can have unlimited
jobs as the repo wants. limited to 20 jobs in parallel. Also there is
unlimited time cpu. all free of charge.
  This is how github action does for all open source projects. meaning if
you just have an open repo (not private) you can have it.
- This should be fixed on the gcc side. If they do so, they will have a
great way to test their code, and have more free bug code to insert into
their repo.
  Also more devs can contribute and they can check gcc across platforms in
one single PR. They can run the ci on many OS systems that they don't have
access or skill to do.

They CI can extend to aarch64, also arm or any flavor. The ci of github
action supports public docker images, and can run gcc on them too.

Thank you for your support.

Regards,
Tal Regev.


On Wed, 12 Jul 2023 at 15:42, Christophe Lyon <christophe.lyon@linaro.org>
wrote:

> Hi,
>
>
> On Sun, 9 Jul 2023 at 19:13, Tal Regev via Gcc-patches <
> gcc-patches@gcc.gnu.org> wrote:
>
>> Description: adding a ci in a github repo. Everytime a user will do a PR
>> to
>> master branch or releases branches, it will activate the ci on their repo.
>> for example: https://github.com/talregev/gcc/pull/1. Can help users to
>> verify their own changes before submitting a patch.
>>
>> ChangeLog: Add a linux CI
>>
>> Bootstrapping and testing: I tested it on linux with
>> host: x86_64-linux-gnu
>> target: x86_64-linux-gnu
>> some tests are failing. You can see the results in my CI yourself.
>>
>>
> Thanks for sharing your patch & idea.
> I think GCC validation is and has been a problem for a long time ;-)
>
> I am not a maintainer, so take my comments with a grain of salt ;-)
>
> - I don't know if the GCC project would want to accept such patches,
> pointing to github etc...
> - github is not the main GCC repository, it hosts several mirrors AFAIK
> - these mirrors are updated by individuals, I think, I don't know at which
> frequency etc... correct me if I'm wrong
> - would this mean that each time each such mirror/fork is updated, this
> triggers builds on github servers? Would that handle the load? I don't
> think so (also: how many "free" minutes of CPU time can be used?)
> - as you have noticed the GCC testsuite is not 100% clean (i.e. there are
> failures, so 'make check' always exits with an error code), making such a
> step useless. What we need is to compare to a baseline (eg. results of
> previous build) and report if there were detections. Several companies have
> CI systems doing this (either internally, or on publicly accessible servers)
>
> In particular, at Linaro we monitor regressions for several arm and
> aarch64 flavors, and we are also experimenting with "pre-commit CI", based
> on patchwork.
>
> Thanks anyway for sharing, it's good to see such initiatives ;-)
>
> Christophe
>
>
>
>> Patch: attach to this email.
>>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-12 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-09 17:12 [PATCH] ci: Add a linux CI Tal Regev
2023-07-12 12:42 ` Christophe Lyon
2023-07-12 17:52   ` Tal Regev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).