diff options
author | Ben Woodard <woodard@redhat.com> | 2022-05-16 09:34:43 -0700 |
---|---|---|
committer | Dodji Seketeli <dodji@redhat.com> | 2022-05-17 00:13:40 +0200 |
commit | d7557e8c25b118f75e0f79f6fafbe50360759d4a (patch) | |
tree | 977d09ea592c60986e922a81ed13f24508b9c487 | |
parent | abipkgdiff: Add support to compare packages with CTF debug format (diff) | |
download | libabigail-d7557e8c25b118f75e0f79f6fafbe50360759d4a.tar.gz libabigail-d7557e8c25b118f75e0f79f6fafbe50360759d4a.tar.bz2 libabigail-d7557e8c25b118f75e0f79f6fafbe50360759d4a.tar.xz |
Add github actions to support workflows
To facilitate collaboration with developers working on the BUILD-SI
project who are using github, I have been maintaining a clone of the
libabigail repo there. Having this repo also allows us to leverage
some of the tooling that github provides, in particular the ability to
have github actions test patches to verify that the builds succeed,
and all the regression tests run successfully. This will allow it to
better integrate with the normal agile workflow used by at least this
community of developers.
* .github/workflows/build-container.yaml: New file.
* .github/workflows/libabigail.yaml: Likewise.
* .github/workflows/test.yaml: Likewise.
* .github/workflows/test-fedora.yaml: Likewise.
* .github/README.md: Likewise.
* docker/Dockerfile.fedora: Likewise.
* docker/Dockerfile.ubuntu: Likewise.
* docker/Dockerfile.fedora-base: Likewise.
* docker/Dockerfile.test: Likewise.
* README-DOCKER.md: Likewise.
Signed-off-by: Vanessa Sochat <sochat1@llnl.gov>
Reviewed-by: Ben Woodard <woodard@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
-rw-r--r-- | .github/README.md | 7 | ||||
-rw-r--r-- | .github/workflows/build-container.yaml | 99 | ||||
-rw-r--r-- | .github/workflows/libabigail.yaml | 126 | ||||
-rw-r--r-- | .github/workflows/test-fedora.yaml | 65 | ||||
-rw-r--r-- | .github/workflows/test.yaml | 34 | ||||
-rw-r--r-- | README-DOCKER.md | 66 | ||||
-rw-r--r-- | docker/Dockerfile.fedora | 38 | ||||
-rw-r--r-- | docker/Dockerfile.fedora-base | 21 | ||||
-rw-r--r-- | docker/Dockerfile.test | 28 | ||||
-rw-r--r-- | docker/Dockerfile.ubuntu | 30 |
10 files changed, 514 insertions, 0 deletions
diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 00000000..255d9a27 --- /dev/null +++ b/.github/README.md | |||
@@ -0,0 +1,7 @@ | |||
1 | # Github automations | ||
2 | |||
3 | Github provides several CI/CD features that some people find | ||
4 | useful. This directory enables those features for people who want to | ||
5 | use them. More information about the layout of this directory and how | ||
6 | to make use of these features can be found here: | ||
7 | https://docs.github.com/en/actions | ||
diff --git a/.github/workflows/build-container.yaml b/.github/workflows/build-container.yaml new file mode 100644 index 00000000..5b2737ba --- /dev/null +++ b/.github/workflows/build-container.yaml | |||
@@ -0,0 +1,99 @@ | |||
1 | name: Build Deploy Container | ||
2 | |||
3 | on: | ||
4 | |||
5 | # Always have a base image ready to go - this is a nightly build | ||
6 | schedule: | ||
7 | - cron: 0 3 * * * | ||
8 | |||
9 | # Allow manual trigger of a build | ||
10 | workflow_dispatch: | ||
11 | inputs: | ||
12 | whatever: | ||
13 | description: 'This variable does not matter, its a GHA bug.' | ||
14 | |||
15 | # On push to main we build and deploy images | ||
16 | push: | ||
17 | branches: | ||
18 | - develop | ||
19 | |||
20 | # Do build to test works on PR | ||
21 | pull_request: [] | ||
22 | |||
23 | # Publish packages on release | ||
24 | release: | ||
25 | types: [published] | ||
26 | |||
27 | jobs: | ||
28 | build: | ||
29 | permissions: | ||
30 | packages: write | ||
31 | strategy: | ||
32 | fail-fast: false | ||
33 | matrix: | ||
34 | |||
35 | # Dockerfiles to build, container names to use, and to tag as libabigail:latest? | ||
36 | container: [["Dockerfile.fedora", "ghcr.io/woodard/libabigail-fedora", true], | ||
37 | ["Dockerfile.ubuntu", "ghcr.io/woodard/libabigail-ubuntu-22.04", false], | ||
38 | ["Dockerfile.fedora-base", "ghcr.io/woodard/libabigail-fedora-base", false]] | ||
39 | |||
40 | runs-on: ubuntu-latest | ||
41 | name: Build | ||
42 | steps: | ||
43 | - name: Checkout | ||
44 | uses: actions/checkout@v3 | ||
45 | |||
46 | - name: Make Space For Build | ||
47 | run: | | ||
48 | sudo rm -rf /usr/share/dotnet | ||
49 | sudo rm -rf /opt/ghc | ||
50 | |||
51 | # It's easier to reference named variables than indexes of the matrix | ||
52 | - name: Set Environment | ||
53 | env: | ||
54 | dockerfile: ${{ matrix.container[0] }} | ||
55 | uri: ${{ matrix.container[1] }} | ||
56 | isLatest: ${{ matrix.container[2] }} | ||
57 | run: | | ||
58 | echo "dockerfile=$dockerfile" >> $GITHUB_ENV | ||
59 | echo "uri=$uri" >> $GITHUB_ENV | ||
60 | echo "isLatest=$isLatest" >> $GITHUB_ENV | ||
61 | |||
62 | - name: Pull previous layers for cache | ||
63 | run: docker pull ${uri}:latest || echo "No container to pull" | ||
64 | |||
65 | - name: Build Container | ||
66 | run: | | ||
67 | container=$uri:latest | ||
68 | docker build -f docker/${dockerfile} -t ${container} . | ||
69 | if [[ "${isLatest}" == "true" ]]; then docker tag ${container} ghcr.io/woodard/libabigail:latest | ||
70 | fi | ||
71 | echo "container=$container" >> $GITHUB_ENV | ||
72 | |||
73 | - name: GHCR Login | ||
74 | if: (github.event_name != 'pull_request') | ||
75 | uses: docker/login-action@v1 | ||
76 | with: | ||
77 | registry: ghcr.io | ||
78 | username: ${{ github.actor }} | ||
79 | password: ${{ secrets.GITHUB_TOKEN }} | ||
80 | |||
81 | - name: Deploy | ||
82 | if: (github.event_name != 'pull_request') | ||
83 | run: | | ||
84 | docker push ${container} | ||
85 | if [[ "${isLatest}" == "true" ]]; then | ||
86 | docker push ghcr.io/woodard/libabigail:latest | ||
87 | fi | ||
88 | |||
89 | - name: Tag and Push Release | ||
90 | if: (github.event_name == 'release') | ||
91 | run: | | ||
92 | tag=${GITHUB_REF#refs/tags/} | ||
93 | echo "Tagging and releasing ${uri}:${tag}" | ||
94 | docker tag ${uri}:latest ${uri}:${tag} | ||
95 | docker push ${uri}:${tag} | ||
96 | if [[ "${isLatest}" == "true" ]]; then | ||
97 | docker tag ${uri}:latest ghcr.io/woodard/libabigail:${tag} | ||
98 | docker push ghcr.io/woodard/libabigail:${tag} | ||
99 | fi | ||
diff --git a/.github/workflows/libabigail.yaml b/.github/workflows/libabigail.yaml new file mode 100644 index 00000000..a7c40d27 --- /dev/null +++ b/.github/workflows/libabigail.yaml | |||
@@ -0,0 +1,126 @@ | |||
1 | name: Libabigail ABI Checks | ||
2 | on: | ||
3 | pull_request: [] | ||
4 | |||
5 | jobs: | ||
6 | |||
7 | # get-release: | ||
8 | # container: ghcr.io/woodard/libabigail-ubuntu-22.04:latest | ||
9 | # runs-on: ubuntu-latest | ||
10 | # steps: | ||
11 | # - name: Organize Files | ||
12 | # run: | | ||
13 | # mkdir -p /abi | ||
14 | # cp /opt/abigail-env/.spack-env/view/lib/libabigail.so /abi/ | ||
15 | # cp /lib/x86_64-linux-gnu/libc.so.6 /abi/ | ||
16 | # cp /lib/x86_64-linux-gnu/libstdc++.so.6 /abi/ | ||
17 | # cp /lib/x86_64-linux-gnu/libsystemd.so.0 /abi/ | ||
18 | |||
19 | # - name: Upload Libs | ||
20 | # uses: actions/upload-artifact@v3 | ||
21 | # with: | ||
22 | # name: release-libs | ||
23 | # path: | | ||
24 | # /abi/libabigail.so | ||
25 | # /abi/libc.so.6 | ||
26 | # /abi/libstdc++.so.6 | ||
27 | # /abi/libsystemd.so.0 | ||
28 | |||
29 | |||
30 | get-latest: | ||
31 | container: ghcr.io/woodard/libabigail-ubuntu-22.04:latest | ||
32 | runs-on: ubuntu-latest | ||
33 | steps: | ||
34 | - name: Organize Files | ||
35 | run: | | ||
36 | mkdir -p /abi | ||
37 | cp /opt/abigail-env/.spack-env/view/lib/libabigail.so /abi/ | ||
38 | cp /lib/x86_64-linux-gnu/libc.so.6 /abi/ | ||
39 | cp /lib/x86_64-linux-gnu/libstdc++.so.6 /abi/ | ||
40 | cp /lib/x86_64-linux-gnu/libsystemd.so.0 /abi/ | ||
41 | |||
42 | - name: Upload Libs | ||
43 | uses: actions/upload-artifact@v3 | ||
44 | with: | ||
45 | name: latest-libs | ||
46 | path: | | ||
47 | /abi/libabigail.so | ||
48 | /abi/libc.so.6 | ||
49 | /abi/libstdc++.so.6 | ||
50 | /abi/libsystemd.so.0 | ||
51 | |||
52 | get-pr: | ||
53 | container: ghcr.io/woodard/libabigail-ubuntu-22.04:latest | ||
54 | runs-on: ubuntu-latest | ||
55 | steps: | ||
56 | - name: Build Pull Request | ||
57 | uses: actions/checkout@v3 | ||
58 | - name: Build | ||
59 | run: | | ||
60 | rm -rf /src | ||
61 | cp -R $PWD /src | ||
62 | ls /src | ||
63 | . /opt/spack/share/spack/setup-env.sh | ||
64 | cd /opt/abigail-env | ||
65 | spack install | ||
66 | |||
67 | - name: Organize Files | ||
68 | run: | | ||
69 | mkdir -p /abi | ||
70 | cp /opt/abigail-env/.spack-env/view/lib/libabigail.so /abi/ | ||
71 | cp /lib/x86_64-linux-gnu/libc.so.6 /abi/ | ||
72 | cp /lib/x86_64-linux-gnu/libstdc++.so.6 /abi/ | ||
73 | cp /lib/x86_64-linux-gnu/libsystemd.so.0 /abi/ | ||
74 | |||
75 | - name: Upload Libs | ||
76 | uses: actions/upload-artifact@v3 | ||
77 | with: | ||
78 | name: pr-libs | ||
79 | path: | | ||
80 | /abi/libabigail.so | ||
81 | /abi/libc.so.6 | ||
82 | /abi/libstdc++.so.6 | ||
83 | /abi/libsystemd.so.0 | ||
84 | |||
85 | abi: | ||
86 | runs-on: ubuntu-latest | ||
87 | needs: [get-latest, get-pr] # get-release | ||
88 | strategy: | ||
89 | fail-fast: false | ||
90 | matrix: | ||
91 | |||
92 | # Testing every paired library for release vs pr and main vs. pr | ||
93 | libs: ["libabigail.so", | ||
94 | "libc.so.6", | ||
95 | "libstdc++.so.6", | ||
96 | "libsystemd.so.0"] | ||
97 | |||
98 | # Artifact pairs (named) for comparison) | ||
99 | artifacts: [["pr-libs", "latest-libs"]] | ||
100 | #["pr-libs", "release-libs"]] | ||
101 | |||
102 | steps: | ||
103 | - name: Download Previous Version | ||
104 | uses: actions/download-artifact@v2 | ||
105 | with: | ||
106 | name: ${{ matrix.artifacts[1] }} | ||
107 | path: previous/ | ||
108 | |||
109 | - name: Download Pull Request Version | ||
110 | uses: actions/download-artifact@v2 | ||
111 | with: | ||
112 | name: ${{ matrix.artifacts[0] }} | ||
113 | path: current/ | ||
114 | |||
115 | - name: Show Files | ||
116 | run: | | ||
117 | ls current/ | ||
118 | ls previous/ | ||
119 | |||
120 | - name: Run Libabigail | ||
121 | uses: buildsi/libabigail-action@0.0.11 | ||
122 | env: | ||
123 | lib: ${{ matrix.libs }} | ||
124 | with: | ||
125 | abidiff: previous/${{ env.lib }} current/${{ env.lib }} | ||
126 | abidw: "--abidiff current/${{ env.lib }}" | ||
diff --git a/.github/workflows/test-fedora.yaml b/.github/workflows/test-fedora.yaml new file mode 100644 index 00000000..a0d2583f --- /dev/null +++ b/.github/workflows/test-fedora.yaml | |||
@@ -0,0 +1,65 @@ | |||
1 | name: Libabigail ABI Diff Checks | ||
2 | on: | ||
3 | pull_request: [] | ||
4 | |||
5 | jobs: | ||
6 | abi: | ||
7 | runs-on: ubuntu-latest | ||
8 | container: ghcr.io/woodard/libabigail | ||
9 | strategy: | ||
10 | fail-fast: false | ||
11 | matrix: | ||
12 | |||
13 | # Pairs of path and install command | ||
14 | libs: [["/lib64/libabigail.so", "libabigail"], | ||
15 | ["/lib64/libadwaitaqtpriv.so", "libadwaita-qt5"], | ||
16 | ["/lib64/libaspell.so", "aspell"], | ||
17 | ["/lib64/libboost_log.so", "boost-log"], | ||
18 | ["/lib64/libclucene-core.so", "clucene-core"], | ||
19 | ["/lib64/libdap.so", "libdap"], | ||
20 | ["/lib64/libdcerpc-samr.so", "samba-libs"], | ||
21 | ["/lib64/libdjvulibre.so", "djvulibre-libs"], | ||
22 | ["/lib64/dovecot/libdovecot-storage.so", "dovecot"], | ||
23 | ["/lib64/libexiv2.so", "exiv2-libs"], | ||
24 | ["/lib64/libgdal.so", "gdal-libs"], | ||
25 | ["/lib64/libgeos.so", "geos"], | ||
26 | ["/lib64/libglibmm-2.4.so", "glibmm24"], | ||
27 | ["/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed/libgmpopenh264.so", "mozilla-openh264"], | ||
28 | ["/lib64/libhdf5_cpp.so", "hdf5"], | ||
29 | ["/lib64/libicui18n.so", "libicu67"], | ||
30 | ["/lib64/libicui18n.so", "libicu"], | ||
31 | ["/lib64/libicuuc.so", "libicu67"], | ||
32 | ["/lib64/libicuuc.so", "libicu"], | ||
33 | ["/lib64/dyninst/libinstructionAPI.so", "dyninst"], | ||
34 | ["/lib64/libjavascriptcoregtk-4.0.so", "webkit2gtk3-jsc"], | ||
35 | ["/lib64/libjxl.so", "libjxl"], | ||
36 | ["/lib64/libkmldom.so", "libkml"], | ||
37 | ["/lib64/libmusicbrainz5.so", "libmusicbrainz5"], | ||
38 | ["/lib64/libOpenEXRUtil-3_1.so", "openexr-libs"], | ||
39 | ["/lib64/libopenh264.so", "openh264"], | ||
40 | ["/lib64/libOSMesa.so", "mesa-libOSMesa"], | ||
41 | ["/lib64/libproj.so", "proj"], | ||
42 | ["/lib64/libQt5WaylandClient.so", "qt5-qtwayland"], | ||
43 | ["/lib64/libQt5WaylandCompositor.so", "qt5-qtwayland"], | ||
44 | ["/lib64/libQt5XmlPatterns.so", "qt5-qtxmlpatterns"], | ||
45 | ["/lib64/libSDL2_image-2.0.so", "SDL2_image"], | ||
46 | ["/lib64/libstdc++.so", "libstdc++"], | ||
47 | ["/lib64/libtag.so", "taglib"], | ||
48 | ["/lib64/libreoffice/program/libuno_cppuhelpergcc3.so", "libreoffice-ure"], | ||
49 | ["/lib64/libvtkRenderingCore.so", "vtk"], | ||
50 | ["/lib64/libwebrtc_audio_processing.so", "webrtc-audio-processing"]] | ||
51 | steps: | ||
52 | - name: Install Library | ||
53 | env: | ||
54 | lib: ${{ matrix.libs[1] }} | ||
55 | run: dnf install -y ${lib} findutils | ||
56 | |||
57 | - name: Run abidw abidiff | ||
58 | env: | ||
59 | libpath: ${{ matrix.libs[0] }} | ||
60 | run: | | ||
61 | for name in $(find -type f $libpath*); do | ||
62 | printf "abidw --abidiff ${name}\n" | ||
63 | abidw --abidiff ${name} | ||
64 | echo $? | ||
65 | done | ||
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..1b16ea12 --- /dev/null +++ b/.github/workflows/test.yaml | |||
@@ -0,0 +1,34 @@ | |||
1 | name: Test Libabigail | ||
2 | |||
3 | on: | ||
4 | pull_request: [] | ||
5 | push: | ||
6 | branches: | ||
7 | - develop | ||
8 | |||
9 | jobs: | ||
10 | build: | ||
11 | permissions: | ||
12 | packages: read | ||
13 | strategy: | ||
14 | fail-fast: false | ||
15 | matrix: | ||
16 | |||
17 | # Testing containers (build and run make check) | ||
18 | dockerfile: ["Dockerfile.test"] | ||
19 | |||
20 | runs-on: ubuntu-latest | ||
21 | name: Build | ||
22 | steps: | ||
23 | - name: Checkout | ||
24 | uses: actions/checkout@v3 | ||
25 | |||
26 | - name: Make Space For Build | ||
27 | run: | | ||
28 | sudo rm -rf /usr/share/dotnet | ||
29 | sudo rm -rf /opt/ghc | ||
30 | |||
31 | - name: Build Test Container | ||
32 | env: | ||
33 | dockerfile: ${{ matrix.dockerfile }} | ||
34 | run: docker build -f docker/${dockerfile} -t libabigail-test . | ||
diff --git a/README-DOCKER.md b/README-DOCKER.md new file mode 100644 index 00000000..ad2dd8e1 --- /dev/null +++ b/README-DOCKER.md | |||
@@ -0,0 +1,66 @@ | |||
1 | # Libabigail Docker | ||
2 | |||
3 | Libabigail comes with two Dockerfile in [docker](docker) to build each of: | ||
4 | |||
5 | - a Fedora base image (recommended) | ||
6 | - an Ubuntu base image. | ||
7 | |||
8 | These containers are built and deployed on merges to the main branch and releases. | ||
9 | |||
10 | ### Usage | ||
11 | |||
12 | Here is how to build the containers. Note that we build so it belongs to the same | ||
13 | namespace as the repository here. "ghcr.io" means "GitHub Container Registry" and | ||
14 | is the [GitHub packages](https://github.com/features/packages) registry that supports | ||
15 | Docker images and other OCI artifacts. | ||
16 | |||
17 | ```bash | ||
18 | $ docker build -f docker/Dockerfile.fedora -t ghcr.io/woodard/libabigail-fedora . | ||
19 | ``` | ||
20 | ```bash | ||
21 | $ docker build -f docker/Dockerfile.ubuntu -t ghcr.io/woodard/libabigail-ubuntu-22.04 . | ||
22 | ``` | ||
23 | |||
24 | Note that currently the fedora image is deployed to `ghcr.io/woodard/libabigail:latest`. | ||
25 | |||
26 | ### Shell | ||
27 | |||
28 | To shell into a container (here is an example with ubuntu): | ||
29 | |||
30 | ```bash | ||
31 | $ docker run -it ghcr.io/woodard/libabigail-ubuntu-22.04 bash | ||
32 | ``` | ||
33 | |||
34 | Off the bat, you can find the abi executables: | ||
35 | |||
36 | ```bash | ||
37 | # which abidiff | ||
38 | /opt/abigail-env/.spack-env/view/bin/abidiff | ||
39 | ``` | ||
40 | |||
41 | Since the ubuntu base uses spack, you can interact with spack. | ||
42 | You can go to the environment in `/opt/abigail-env` and (given you | ||
43 | have the source code bound to `/src`) build and test again. | ||
44 | |||
45 | ```bash | ||
46 | $ spack install | ||
47 | ``` | ||
48 | |||
49 | And that's it! This workflow should make it easy to install development versions of libabigail with spack. | ||
50 | We will also use the "production" containers to grab libraries in: | ||
51 | |||
52 | ``` | ||
53 | $ ls /opt/abigail-env/.spack-env/view/ | ||
54 | bin include lib share | ||
55 | ``` | ||
56 | |||
57 | Note that the fedora container does not come with spack. | ||
58 | |||
59 | ### Testing | ||
60 | |||
61 | We provide a testing container, which will use a fedora base and add new code to | ||
62 | compile, and then run `make check`. You can do this as follows on your local machine: | ||
63 | |||
64 | ```bash | ||
65 | $ docker build -f docker/Dockerfile.test -t test . | ||
66 | ``` | ||
diff --git a/docker/Dockerfile.fedora b/docker/Dockerfile.fedora new file mode 100644 index 00000000..0257e99e --- /dev/null +++ b/docker/Dockerfile.fedora | |||
@@ -0,0 +1,38 @@ | |||
1 | FROM ghcr.io/woodard/libabigail-fedora-base as builder | ||
2 | |||
3 | # docker build -f docker/Dockerfile.fedora -t ghcr.io/woodard/libabigail-fedora . | ||
4 | |||
5 | WORKDIR /code | ||
6 | COPY . /code | ||
7 | |||
8 | RUN mkdir -p build && \ | ||
9 | autoreconf -i && \ | ||
10 | cd build && \ | ||
11 | CXXFLAGS="-g3 -fvar-tracking-assignments \ | ||
12 | -gstatement-frontiers -gvariable-location-views -grecord-gcc-switches -pipe -Wall \ | ||
13 | -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wp,-D_GLIBCXX_ASSERTIONS \ | ||
14 | -fstack-protector-strong -fstack-clash-protection -fcf-protection \ | ||
15 | -fasynchronous-unwind-tables -O2" CFLAGS="-g3 -fvar-tracking-assignments \ | ||
16 | -gstatement-frontiers -gvariable-location-views -grecord-gcc-switches -pipe -Wall \ | ||
17 | -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wp,-D_GLIBCXX_ASSERTIONS \ | ||
18 | -fstack-protector-strong -fstack-clash-protection -fcf-protection \ | ||
19 | -fasynchronous-unwind-tables -O2" LDFLAGS="-Wl,--no-undefined" \ | ||
20 | ../configure --prefix=/opt/libabigail --enable-rpm=yes && \ | ||
21 | make -j4 && \ | ||
22 | make install | ||
23 | |||
24 | FROM fedora:latest | ||
25 | COPY --from=builder /opt/libabigail /opt/libabigail | ||
26 | ENV PATH=/opt/libabigail/bin:$PATH | ||
27 | |||
28 | # Runtime dependencies | ||
29 | RUN dnf install -y \ | ||
30 | python3-koji \ | ||
31 | python3-mock \ | ||
32 | python3-pyxdg \ | ||
33 | elfutils-libelf \ | ||
34 | elfutils-libs \ | ||
35 | libstdc++ \ | ||
36 | lbzip2 \ | ||
37 | shared-mime-info \ | ||
38 | six | ||
diff --git a/docker/Dockerfile.fedora-base b/docker/Dockerfile.fedora-base new file mode 100644 index 00000000..f803dd7f --- /dev/null +++ b/docker/Dockerfile.fedora-base | |||
@@ -0,0 +1,21 @@ | |||
1 | ARG fedora_version=latest | ||
2 | # ARG fedora_version=35 | ||
3 | FROM fedora:${fedora_version} as builder | ||
4 | |||
5 | # docker build -f docker/Dockerfile.fedora-base -t ghcr.io/woodard/libabigail-fedora-base . | ||
6 | |||
7 | RUN dnf install -y \ | ||
8 | autoconf \ | ||
9 | automake \ | ||
10 | cpio \ | ||
11 | elfutils-devel \ | ||
12 | gcc-c++ \ | ||
13 | lbzip2 \ | ||
14 | libtool \ | ||
15 | libxml2-devel \ | ||
16 | python3-koji \ | ||
17 | python3-mock \ | ||
18 | python3-pyxdg \ | ||
19 | shared-mime-info \ | ||
20 | six \ | ||
21 | wget | ||
diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test new file mode 100644 index 00000000..f25739a6 --- /dev/null +++ b/docker/Dockerfile.test | |||
@@ -0,0 +1,28 @@ | |||
1 | FROM ghcr.io/woodard/libabigail-fedora-base | ||
2 | |||
3 | # docker build -f docker/Dockerfile.test -t test . | ||
4 | |||
5 | RUN dnf install -y \ | ||
6 | file \ | ||
7 | diffutils \ | ||
8 | lbzip2 \ | ||
9 | elfutils-libs | ||
10 | |||
11 | WORKDIR /code | ||
12 | COPY . /code | ||
13 | |||
14 | RUN mkdir -p build && \ | ||
15 | autoreconf -i && \ | ||
16 | cd build && \ | ||
17 | CXXFLAGS="-g3 -fvar-tracking-assignments \ | ||
18 | -gstatement-frontiers -gvariable-location-views -grecord-gcc-switches -pipe -Wall \ | ||
19 | -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wp,-D_GLIBCXX_ASSERTIONS \ | ||
20 | -fstack-protector-strong -fstack-clash-protection -fcf-protection \ | ||
21 | -fasynchronous-unwind-tables -O2" CFLAGS="-g3 -fvar-tracking-assignments \ | ||
22 | -gstatement-frontiers -gvariable-location-views -grecord-gcc-switches -pipe -Wall \ | ||
23 | -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wp,-D_GLIBCXX_ASSERTIONS \ | ||
24 | -fstack-protector-strong -fstack-clash-protection -fcf-protection \ | ||
25 | -fasynchronous-unwind-tables -O2" LDFLAGS="-Wl,--no-undefined" \ | ||
26 | ../configure --prefix=/opt/libabigail --enable-rpm=yes && \ | ||
27 | make -j4 && \ | ||
28 | make check ENABLE_SLOW_TEST=yes || (cat tests/test-suite.log && exit 1) | ||
diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu new file mode 100644 index 00000000..cb1dc166 --- /dev/null +++ b/docker/Dockerfile.ubuntu | |||
@@ -0,0 +1,30 @@ | |||
1 | ARG ubuntu_version=22.04 | ||
2 | ARG gcc_version=10.3.0 | ||
3 | FROM ghcr.io/rse-ops/gcc-ubuntu-${ubuntu_version}:gcc-${gcc_version} | ||
4 | |||
5 | # docker build -t ghcr.io/woodard/libabigail-ubuntu-22.04 . | ||
6 | |||
7 | # Install Libabigail to its own view | ||
8 | WORKDIR /opt/abigail-env | ||
9 | RUN . /opt/spack/share/spack/setup-env.sh && \ | ||
10 | spack env create -d . && \ | ||
11 | spack env activate . && \ | ||
12 | spack add libabigail@master && \ | ||
13 | spack --debug install | ||
14 | |||
15 | # Prepare a source extraction of libabigail at /src (intended to be overwritten by user) | ||
16 | COPY . /src | ||
17 | |||
18 | # Second run - should have deps cached | ||
19 | RUN . /opt/spack/share/spack/setup-env.sh && \ | ||
20 | |||
21 | # This adds metadata for libabigail to spack.yaml | ||
22 | spack develop --path /src libabigail@master && \ | ||
23 | spack --debug install | ||
24 | # At this point you can spack install, and bind the code to /code to develop | ||
25 | |||
26 | # ensure libabigail stuffs always on the path | ||
27 | RUN cd /opt/abigail-env && \ | ||
28 | spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh | ||
29 | |||
30 | ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c"] | ||