[go: up one dir, main page]

Skip to content
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

Add Fedora 37 image with gcc12 #60

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/Fedora-37.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# GitHub Action Workflow for building the Fedora 35 images.

# SPDX-License-Identifier: BSD-2-Clause-Patent

name: "Fedora 37 Images"

# This workflow only runs (on the main branch or on PRs targeted
# at the main branch) and if files inside the Fedora-35 directory
# have been modifed/added/removed...

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'Fedora-37/**'
pull_request:
branches: [ main ]
paths:
- 'Fedora-37/**'

jobs:
Build_Image:
uses: ./.github/workflows/build-image.yaml
with:
image_name: "Fedora-37"
sub_images: "build test dev"

127 changes: 127 additions & 0 deletions Fedora-37/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Dockerfile for building container images for use in the EDK2 CI.
#
# Copyright (C) 2022, Red Hat, Inc.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# This file contains the definitions for images to be used for different
# jobs in the EDK2 CI pipeline. The set of tools and dependencies is split into
# multiple images to reduce the overall download size by providing images
# tailored to the task of the CI job. Currently there are two images: "build"
# and "test".
# The images are indented to run on x86_64.


# Build Image
# This image is intended for jobs that compile the source code and as a general
# purpose image. It contains the toolchains for all supported architectures, and
# all build dependencies.
FROM registry.fedoraproject.org/fedora:37 AS build
ARG GCC_VERSION=12.2.1-4.fc37
ARG GCC_VERSION_CROSS=12.2.1-2.fc37
ARG NASM_VERSION=2.15.05-3.fc37
ARG PYTHON_VERSION=3.11
ARG GCC_LOONGARCH64_URL="https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-6.3-cross-tools-c-only.tar.xz"
ARG CSPELL_VERSION=5.20.0
ARG MARKDOWNLINT_VERSION=0.31.0
ARG POWERSHELL_VERSION=7.3.3
ARG DOTNET_VERSION=6.0
RUN dnf \
--assumeyes \
--nodocs \
--setopt=install_weak_deps=0 \
install \
acpica-tools \
dotnet-runtime-${DOTNET_VERSION} \
curl \
gcc-c++-${GCC_VERSION} \
gcc-${GCC_VERSION} \
gcc-aarch64-linux-gnu-${GCC_VERSION_CROSS} \
gcc-arm-linux-gnu-${GCC_VERSION_CROSS} \
gcc-riscv64-linux-gnu-${GCC_VERSION_CROSS} \
git \
libX11-devel \
libXext-devel \
libuuid-devel \
make \
nuget \
osteffenrh marked this conversation as resolved.
Show resolved Hide resolved
nasm-${NASM_VERSION} \
https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-1.rh.x86_64.rpm \
python${PYTHON_VERSION} \
python3-distutils-extra \
python3-pip \
python3-setuptools \
nodejs \
npm \
tar \
sudo
RUN alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN pip install pip --upgrade

RUN mkdir -p /cross-tools/ && \
curl -L "${GCC_LOONGARCH64_URL}" | \
tar --extract -z --strip-components=1 -C /cross-tools

ENV GCC5_AARCH64_PREFIX /usr/bin/aarch64-linux-gnu-
ENV GCC5_ARM_PREFIX /usr/bin/arm-linux-gnu-
ENV GCC5_RISCV64_PREFIX /usr/bin/riscv64-linux-gnu-
ENV GCC5_LOONGARCH64_PREFIX /cross-tools/bin/loongarch64-unknown-linux-gnu-

# Tools used by build extensions.
RUN npm install -g npm \
cspell@${CSPELL_VERSION} \
markdownlint-cli@${MARKDOWNLINT_VERSION}

# Test Image
# This image is indented for jobs that run tests (and possibly also build)
# firmware images. It is based on the build image and adds Qemu for the
# architectures under test.

#Building qemu from source:
FROM build AS test
ARG QEMU_URL="https://gitlab.com/qemu-project/qemu.git"
ARG QEMU_BRANCH="v7.2.0"
RUN dnf \
--assumeyes \
--nodocs \
--setopt=install_weak_deps=0 \
install \
bzip2 \
findutils \
git \
glib2-devel \
libfdt-devel \
ninja-build \
pixman-devel \
python3 \
tar \
zlib-devel && \
git clone "${QEMU_URL}" --branch "${QEMU_BRANCH}" --depth 1 qemu && \
cd qemu && \
curl "https://patchwork.ozlabs.org/project/qemu-devel/patch/20230105161804.82486-1-lersek@redhat.com/mbox/" | git apply --ignore-whitespace && \
./configure --target-list=x86_64-softmmu,arm-softmmu,aarch64-softmmu,loongarch64-softmmu && \
make install -j $(nproc) && \
rm -rf qemu-build && \
dnf \
--assumeyes \
remove \
ninja-build

# Dev Image
# This image is indented for local use. This builds on the test image but adds
# tools for local developers.
FROM test AS dev
ENV GCM_LINK=https://github.com/GitCredentialManager/git-credential-manager/releases/download/v2.0.785/gcm-linux_amd64.2.0.785.tar.gz
RUN dnf \
--assumeyes \
--nodocs \
--setopt=install_weak_deps=0 \
install \
libicu \
curl \
tar

# Setup the git credential manager for developer credentials.
RUN curl -L "${GCM_LINK}" | tar -xz -C /usr/local/bin
RUN git-credential-manager-core configure
RUN git config --global credential.credentialStore cache
RUN cp /etc/skel/.bashrc /root/.bashrc
22 changes: 22 additions & 0 deletions Fedora-37/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Fedora 37 Images

This set of images is based on the Fedora 37 minimal image.
It has three flavors, `build`, `test`, and `dev`.
The first two are primarily intended for automated builds
and CI usage.

The `build` image contains the compilers and build tools
needed for building EDK2 under Linux (x86_64).

The `test` image extends the `build` image and adds Qemu for
testing purposes.

The `dev` image in turn extends the `test` image and adds developer
convenience tools, for example the git credential manager.

These images include:
- gcc 12.2 (x86, arm, aarch64, riscv)
- gcc for LoongArch (2022-09-06)
- nasm 2.15.05
- Python 3.11
- Qemu 7.2 (x86, arm ,aarch64)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ be found in [current status](#Current-Status).

| Image Name | OS SKU | Type | Build Status | Documentation |
| :--------- | :----- | :--- | :----------- | :---- |
| [fedora-37-build](https://github.com/tianocore/containers/pkgs/container/containers%2Ffedora-37-build) | Fedora 37 | Build | [![Fedora 37 Images](https://github.com/tianocore/containers/actions/workflows/Fedora-37.yaml/badge.svg)](https://github.com/tianocore/containers/actions/workflows/Fedora-37.yaml) | [Doc](Fedora-37/Readme.md) |
| [fedora-37-test](https://github.com/tianocore/containers/pkgs/container/containers%2Ffedora-37-test) | Fedora 37 | Test | [![Fedora 37 Images](https://github.com/tianocore/containers/actions/workflows/Fedora-37.yaml/badge.svg)](https://github.com/tianocore/containers/actions/workflows/Fedora-37.yaml) | [Doc](Fedora-37/Readme.md) |
| [fedora-37-dev](https://github.com/tianocore/containers/pkgs/container/containers%2Ffedora-37-dev) | Fedora 37 | Dev | [![Fedora 37 Images](https://github.com/tianocore/containers/actions/workflows/Fedora-37.yaml/badge.svg)](https://github.com/tianocore/containers/actions/workflows/Fedora-37.yaml) | [Doc](Fedora-37/Readme.md) |
| [fedora-35-build](https://github.com/tianocore/containers/pkgs/container/containers%2Ffedora-35-build) | Fedora 35 | Build | [![Fedora 35 Images](https://github.com/tianocore/containers/actions/workflows/Fedora-35.yaml/badge.svg)](https://github.com/tianocore/containers/actions/workflows/Fedora-35.yaml) | [Doc](Fedora-35/Readme.md) |
| [fedora-35-test](https://github.com/tianocore/containers/pkgs/container/containers%2Ffedora-35-test) | Fedora 35 | Test | [![Fedora 35 Images](https://github.com/tianocore/containers/actions/workflows/Fedora-35.yaml/badge.svg)](https://github.com/tianocore/containers/actions/workflows/Fedora-35.yaml) | [Doc](Fedora-35/Readme.md) |
| [fedora-35-dev](https://github.com/tianocore/containers/pkgs/container/containers%2Ffedora-35-dev) | Fedora 35 | Dev | [![Fedora 35 Images](https://github.com/tianocore/containers/actions/workflows/Fedora-35.yaml/badge.svg)](https://github.com/tianocore/containers/actions/workflows/Fedora-35.yaml) | [Doc](Fedora-35/Readme.md) |
Expand Down