-
Notifications
You must be signed in to change notification settings - Fork 798
Update FIH tests to use recent TFM and bump toolchain to 14.2 to ensure compatibility with the TFM version #2426
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
Open
maulik-arm
wants to merge
1
commit into
mcu-tools:main
Choose a base branch
from
maulik-arm:fih-tfm-update-gcc14.2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+52
−1
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,63 @@ | |
|
||
set -e | ||
|
||
# Function to update/install native GCC inside the Docker container | ||
update_native_gcc() { | ||
REQUIRED_MAJOR=12 | ||
INSTALLED_MAJOR=$(gcc -dumpversion | cut -d. -f1 || echo 0) | ||
|
||
if [[ "$INSTALLED_MAJOR" -lt "$REQUIRED_MAJOR" ]]; then | ||
echo "Installing native GCC $REQUIRED_MAJOR..." | ||
apt-get update | ||
apt-get install -y --no-install-recommends gcc-$REQUIRED_MAJOR g++-$REQUIRED_MAJOR \ | ||
cpp-$REQUIRED_MAJOR libgcc-$REQUIRED_MAJOR-dev libstdc++-$REQUIRED_MAJOR-dev | ||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$REQUIRED_MAJOR 60 | ||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-$REQUIRED_MAJOR 60 | ||
rm -rf /var/lib/apt/lists/* | ||
else | ||
echo "Native GCC is already version $INSTALLED_MAJOR; skipping installation." | ||
fi | ||
} | ||
|
||
# Function to update/install ARM Embedded GCC inside the Docker container | ||
update_cross_gcc() { | ||
ARM_GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz" | ||
TOOLCHAIN_DIR="/opt/arm-gcc" | ||
|
||
# Install prerequisites | ||
echo "Installing prerequisites for ARM toolchain..." | ||
apt-get update | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
curl libncurses5 xz-utils file | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Download and extract | ||
echo "Downloading and extracting ARM Embedded GCC..." | ||
mkdir -p "$TOOLCHAIN_DIR" | ||
curl -SLf "$ARM_GCC_URL" -o /tmp/arm-gcc.tar.xz | ||
tar -xJf /tmp/arm-gcc.tar.xz -C "$TOOLCHAIN_DIR" --strip-components=1 | ||
rm -f /tmp/arm-gcc.tar.xz | ||
|
||
# Symlink into PATH | ||
echo "Symlinking ARM toolchain into /usr/local/bin..." | ||
ln -sf "$TOOLCHAIN_DIR/bin/"* /usr/local/bin/ | ||
} | ||
|
||
# Ensure we have the proper compiler before running tests | ||
update_native_gcc | ||
update_cross_gcc | ||
|
||
source $(dirname "$0")/paths.sh | ||
|
||
SKIP_SIZE=$1 | ||
BUILD_TYPE=$2 | ||
DAMAGE_TYPE=$3 | ||
FIH_LEVEL=$4 | ||
|
||
# Required for git am to apply patches under TF-M | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "fih-test docker" | ||
|
||
if test -z "$FIH_LEVEL"; then | ||
# Use the default level | ||
CMAKE_FIH_LEVEL="" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can this package not be got from the distro itself? How long will this file be available? How often can it be accessed per IP? Is it rate limited? I don't think we should be putting things like this in given that there's so many unknown variables and given that we've seen countless problems in the past trying to get even the tfm repo for CI checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, the package has to be from the distro (which means I have to update the distro). But how do I do that? Did you missed the discord conversation where I raised the same question? https://discord.com/channels/1106321706588577904/1390625171785646151. let me know how to update the distro and I will do the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that from @d3zd3z :
I see no comment suggesting that packages should be manually added like this, action is on @d3zd3z to deal with docket image ownership