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

ci: pin build_dist runner to ubuntu 22.04 #128

Merged
merged 9 commits into from
Mar 5, 2025
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
2 changes: 1 addition & 1 deletion .github/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# hadolint global ignore=DL3033,SC3044
FROM fedora:20@sha256:5d5a02b873d298da9bca4b84440c5cd698b0832560c850d92cf389cef58bc549
FROM fedora:21@sha256:a268e5e12257c7770eb44c24041baf5e728fba2eed1a84f007b81845ded0a485

ENV PATH="${PATH}:/root/.cargo/bin/"

Expand Down
15 changes: 10 additions & 5 deletions .github/builder/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

set -e

if [ -z "${RUST_NIGHTLY_VERSION}" ]; then
echo "RUST_NIGHTLY_VERSION not set. It should be defined by ci.yml workflow."
exit 1
fi

download_and_verify_llvm() {
LLVM_PGP_KEY_URL="https://releases.llvm.org/5.0.2/tstellar-gpg-key.asc"
LLD_URL="https://releases.llvm.org/5.0.2/lld-5.0.2.src.tar.xz"
Expand Down Expand Up @@ -107,8 +112,8 @@ download_and_verify_make() {

download_and_verify_rust() {
RUST_GPG_KEY_URL="https://static.rust-lang.org/rust-key.gpg.ascii"
RUST_URL="https://static.rust-lang.org/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.xz"
RUST_SIG_URL="https://static.rust-lang.org/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.xz.asc"
RUST_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_VERSION}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz"
RUST_SIG_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_VERSION}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz.asc"

if [ -z "${BUILDER_DIR}" ]; then
echo "BUILDER_DIR not set. Exiting..."
Expand Down Expand Up @@ -219,11 +224,11 @@ download_and_verify_builder_rpms() {

if [ ! -d "${BUILDER_DIR}/rsrc/rpms" ]; then
echo "RPM dependencies not found. Downloading..."
# NOTE: This may stop working at some point, as Fedora 20 is EOL. Therefore, we download the
# NOTE: This may stop working at some point, as Fedora 21 is EOL. Therefore, we download the
# packages with the expectation that we will provide them separately if they are no longer
# available.
docker run -v "${BUILDER_DIR}/rsrc/rpms:/rpms" fedora:20 bash -c \
'yum -y update && yum install --downloadonly --downloaddir=/rpms coreutils gcc gcc-c++ make which && chmod -R 755 /rpms/'
docker run --rm -v "${BUILDER_DIR}/rsrc/rpms:/rpms" fedora:21 bash -c \
'yum -y update && yum install --downloadonly --downloaddir=/rpms coreutils gcc gcc-c++ make which tar && chmod -R 755 /rpms/'
fi
}

Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
PUBLIC_SIMICS_ISPM_VERSION: "1.8.3"
MINGW_URL: "https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0-16.0.6-11.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-13.2.0-llvm-16.0.6-mingw-w64ucrt-11.0.0-r1.7z"
MINGW_VERSION: "13.2.0-16.0.6-11.0.0-ucrt-r1"
RUST_NIGHTLY_VERSION: "2025-02-28"

permissions:
contents: read
Expand All @@ -45,7 +46,7 @@ jobs:

- name: Cache SIMICS Dependencies
id: cache-simics-packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: "${HOME}/simics"
key: simics-linux-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }}-${{ env.PUBLIC_SIMICS_ISPM_VERSION }}
Expand Down Expand Up @@ -117,7 +118,7 @@ jobs:

- name: Cache Test Artifacts
id: cache-test-artifacts-riscv-64
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: tests/rsrc/riscv-64/
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/riscv-64/**/*') }}
Expand Down Expand Up @@ -156,7 +157,7 @@ jobs:

- name: Cache Test Artifacts
id: cache-test-artifacts-x86_64-breakpoint-uefi-edk2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: tests/rsrc/x86_64-breakpoint-uefi-edk2
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/x86_64-breakpoint-uefi-edk2/**/*') }}
Expand Down Expand Up @@ -195,7 +196,7 @@ jobs:

- name: Cache Test Artifacts
id: cache-test-artifacts-x86_64-crash-uefi
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: tests/rsrc/x86_64-crash-uefi
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/x86_64-crash-uefi/**/*') }}
Expand Down Expand Up @@ -234,7 +235,7 @@ jobs:

- name: Cache Test Artifacts
id: cache-test-artifacts-x86_64-timeout-uefi-edk2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: tests/rsrc/x86_64-timeout-uefi-edk2
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/x86_64-timeout-uefi-edk2/**/*') }}
Expand Down Expand Up @@ -273,7 +274,7 @@ jobs:

- name: Cache Test Artifacts
id: cache-test-artifacts-x86_64-uefi
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: tests/rsrc/x86_64-uefi
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/x86_64-uefi/**/*') }}
Expand Down Expand Up @@ -312,7 +313,7 @@ jobs:

- name: Cache Test Artifacts
id: cache-test-artifacts-x86_64-uefi-edk2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: tests/rsrc/x86_64-uefi-edk2
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/x86_64-uefi-edk2/**/*') }}
Expand Down Expand Up @@ -364,7 +365,7 @@ jobs:

- name: Cache Test Artifacts
id: cache-test-artifacts-x86-user
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: tests/rsrc/x86-user/
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/x86-user/**/*') }}
Expand Down Expand Up @@ -472,12 +473,12 @@ jobs:

- uses: dtolnay/rust-toolchain@83bdede770b06329615974cf8c786f845d824dfb # nightly
with:
toolchain: nightly
toolchain: nightly-${{ env.RUST_NIGHTLY_VERSION }}
components: rustfmt,clippy,miri

- name: Cache SIMICS Dependencies
id: cache-simics-packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: ~/simics
key: simics-linux-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }}-${{ env.PUBLIC_SIMICS_ISPM_VERSION }}
Expand Down Expand Up @@ -556,7 +557,7 @@ jobs:

- name: Cache MinGW
id: cache-mingw
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: C:\MinGW\
key: mingw-${{ env.MINGW_VERSION }}
Expand All @@ -578,11 +579,11 @@ jobs:
echo "Downloading Rustup"
Invoke-WebRequest -URI https://win.rustup.rs/x86_64 -OutFile C:\rustup-init.exe
echo "Installing Rust"
C:\rustup-init.exe --default-toolchain nightly --default-host x86_64-pc-windows-gnu -y
C:\rustup-init.exe --default-toolchain nightly-${{ env.RUST_NIGHTLY_VERSION }} --default-host x86_64-pc-windows-gnu -y

- name: Cache SIMICS
id: cache-simics-packages-windows
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: |
C:\ISPM\
Expand Down Expand Up @@ -634,7 +635,7 @@ jobs:

build_dist:
name: Build for Distribution
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand All @@ -647,7 +648,7 @@ jobs:

- name: Cache Builder Dependencies
id: cache-builder-dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: .github/builder/rsrc
key: "cache-builder-dependencies-${{ hashFiles('.github/builder/common.sh') }}"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ jobs:

cargo audit

if ! cargo outdated -R --exit-code 1; then
echo "❗ [T186] Out of date third party dependencies found"
exit 1
fi
# if ! cargo outdated -R --exit-code 1; then
# echo "❗ [T186] Out of date third party dependencies found"
# exit 1
# fi

echo "✅ [T186] No outdated or vulnerable third party dependencies found"
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ pub(crate) mod traits;
pub(crate) mod util;

/// The class name used for all operations interfacing with SIMICS

pub const CLASS_NAME: &str = env!("CARGO_PKG_NAME");

#[derive(Serialize, Deserialize, Clone, Debug)]
Expand Down Expand Up @@ -625,7 +624,7 @@ impl ClassObjectsFinalize for Tsffs {
.map_err(|e| anyhow!("Error getting version string: {}", e))
.and_then(|v| {
v.split(' ')
.last()
.next_back()
.ok_or_else(|| anyhow!("Error parsing version string '{}'", v))
.map(|s| s.to_string())
})
Expand Down
2 changes: 1 addition & 1 deletion src/os/windows/debug_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct DebugInfo<'a> {
pub pdb: PDB<'a, File>,
}

impl<'a> DebugInfo<'a> {
impl DebugInfo<'_> {
/// Instantiate a new debug info for an object
pub fn new<P>(
processor: *mut ConfObject,
Expand Down
6 changes: 3 additions & 3 deletions src/os/windows/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl KernelInfo {
public_symbol
.offset
.to_rva(&pdb_address_map)
.ok_or_else(|| pdb::Error::AddressMapNotFound)?
.ok_or(pdb::Error::AddressMapNotFound)?
.0 as u64
+ self.base,
))
Expand Down Expand Up @@ -324,7 +324,7 @@ impl KernelInfo {
)?;
let debug_info = full_name
.split('\\')
.last()
.next_back()
.ok_or_else(|| anyhow!("Failed to get file name"))
.and_then(|fname| {
// No need for DTB version because kernel is always mapped
Expand Down Expand Up @@ -369,7 +369,7 @@ impl KernelInfo {
public_symbol
.offset
.to_rva(&pdb_address_map)
.ok_or_else(|| pdb::Error::AddressMapNotFound)?
.ok_or(pdb::Error::AddressMapNotFound)?
.0 as u64
+ self.base,
))
Expand Down
2 changes: 1 addition & 1 deletion src/os/windows/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ impl WindowsEProcess {
let base_name = ldr_data_entry.base_name_dtb(processor, directory_table_base)?;
let debug_info = full_name
.split('\\')
.last()
.next_back()
.ok_or_else(|| anyhow!("Failed to get file name"))
.and_then(|fname| {
// No need for DTB version because kernel is always mapped
Expand Down
2 changes: 1 addition & 1 deletion tests/rsrc/x86_64-breakpoint-uefi-edk2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ENV EDK2_REPO_URL "https://github.com/tianocore/edk2.git"
ENV EDK2_REPO_HASH "d189de3b0a2f44f4c9b87ed120be16569ea19b51"
ENV EDK2_REPO_HASH "95d8a1c255cfb8e063d679930d08ca6426eb5701"
ENV EDK2_PATH "/edk2"


Expand Down
2 changes: 1 addition & 1 deletion tests/rsrc/x86_64-timeout-uefi-edk2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ENV EDK2_REPO_URL "https://github.com/tianocore/edk2.git"
ENV EDK2_REPO_HASH "d189de3b0a2f44f4c9b87ed120be16569ea19b51"
ENV EDK2_REPO_HASH "95d8a1c255cfb8e063d679930d08ca6426eb5701"
ENV EDK2_PATH "/edk2"


Expand Down
2 changes: 1 addition & 1 deletion tests/rsrc/x86_64-uefi-edk2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ENV EDK2_REPO_URL "https://github.com/tianocore/edk2.git"
ENV EDK2_REPO_HASH "d189de3b0a2f44f4c9b87ed120be16569ea19b51"
ENV EDK2_REPO_HASH "95d8a1c255cfb8e063d679930d08ca6426eb5701"
ENV EDK2_PATH "/edk2"


Expand Down