forked from wasmerio/wasmer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-install-capi-lib
- Loading branch information
Showing
1,057 changed files
with
115,495 additions
and
48,796 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[profile.ci] | ||
# Print out output for failing tests as soon as they fail, and also at the end | ||
# of the run (for easy scrollability). | ||
failure-output = "immediate-final" | ||
# Do not cancel the test run on the first failure. | ||
fail-fast = false | ||
# Automatically mark a test as "slow" after 60 seconds, then kill it after 180s | ||
slow-timeout = { period = "60s", terminate-after = 3 } | ||
# Retry a couple times in case there are flaky tests | ||
retries = 3 |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
FROM debian:stable AS openssl_riscv64 | ||
#FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:edge AS openssl_riscv64 | ||
|
||
# set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container | ||
ENV CROSS_DOCKER_IN_DOCKER=true | ||
|
||
RUN apt-get update && \ | ||
apt-get install --assume-yes --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
cpio \ | ||
sharutils \ | ||
gnupg \ | ||
build-essential \ | ||
libc6-dev | ||
|
||
#COPY install_deb.sh / | ||
|
||
#install libssl-dev for riscv64! | ||
#RUN /install_deb.sh riscv64 libssl-dev | ||
#RUN dpkg --add-architecture riscv64 | ||
#RUN apt-get update | ||
#RUN apt-get install libssl-dev:riscv64 | ||
#ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include | ||
#ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu | ||
|
||
|
||
# install rust tools | ||
RUN curl --proto "=https" --tlsv1.2 --retry 3 -sSfL https://sh.rustup.rs | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
RUN rustup -v toolchain install 1.70 | ||
# add docker the manual way | ||
COPY install_docker.sh / | ||
RUN /install_docker.sh | ||
|
||
RUN apt-get update && \ | ||
apt-get install --assume-yes --no-install-recommends \ | ||
docker-ce \ | ||
docker-ce-cli \ | ||
containerd.io \ | ||
docker-buildx-plugin \ | ||
docker-compose-plugin | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
gcc-riscv64-linux-gnu \ | ||
g++-riscv64-linux-gnu \ | ||
qemu-user-static \ | ||
libssl-dev \ | ||
pkg-config \ | ||
libc6-dev-riscv64-cross | ||
|
||
ENV CROSS_TOOLCHAIN_PREFIX=riscv64-linux-gnu- | ||
ENV CROSS_SYSROOT=/usr/riscv64-linux-gnu | ||
ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \ | ||
AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ | ||
CC_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"gcc \ | ||
CXX_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"g++ \ | ||
CFLAGS_riscv64gc_unknown_linux_gnu="-march=rv64gc -mabi=lp64d" \ | ||
BINDGEN_EXTRA_CLANG_ARGS_riscv64gc_unknown_linux_gnu="--sysroot=$CROSS_SYSROOT" \ | ||
QEMU_LD_PREFIX="$CROSS_SYSROOT" \ | ||
RUST_TEST_THREADS=1 \ | ||
PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" | ||
|
||
RUN rustup target add riscv64gc-unknown-linux-gnu --toolchain 1.70-x86_64-unknown-linux-gnu | ||
|
||
#compile libssl-dev for riscv64! | ||
COPY build_openssl.sh / | ||
RUN /build_openssl.sh | ||
ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/openssl_riscv64/include | ||
ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/openssl_riscv64/lib |
This file contains 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euo pipefail | ||
|
||
apt-get install wget | ||
|
||
wget https://www.openssl.org/source/openssl-3.1.1.tar.gz | ||
|
||
tar xf openssl-3.1.1.tar.gz | ||
rm openssl-3.1.1.tar.gz | ||
cd openssl-3.1.1 | ||
|
||
AR=riscv64-linux-gnu-ar NM=riscv64-linux-gnu-nm CC=riscv64-linux-gnu-gcc \ | ||
./Configure -static no-asm no-tests --prefix=/openssl_riscv64 linux64-riscv64 | ||
|
||
make -j | ||
make install |
This file contains 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euo pipefail | ||
|
||
arch="${1}" | ||
shift | ||
|
||
# need to install certain local dependencies | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get update | ||
apt-get install --assume-yes --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
cpio \ | ||
sharutils \ | ||
debian-ports-archive-keyring \ | ||
gnupg | ||
|
||
# Add port from bookworm to get some riscv packages | ||
debsource="deb http://deb.debian.org/debian-ports unstable main" | ||
|
||
# temporarily use debian sources rather than ubuntu. | ||
touch /etc/apt/sources.list | ||
mv /etc/apt/sources.list /etc/apt/sources.list.bak | ||
echo -e "${debsource}" > /etc/apt/sources.list | ||
|
||
dpkg --add-architecture "${arch}" || echo "foreign-architecture ${arch}" \ | ||
> /etc/dpkg/dpkg.cfg.d/multiarch | ||
|
||
## Add Debian keys. | ||
#curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{11,12}.asc' -O | ||
#curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{11,12}-security.asc' -O | ||
#curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{11,12}.asc' -O | ||
#curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2023}.key' -O | ||
# | ||
#for key in *.asc *.key; do | ||
# apt-key add "${key}" | ||
# rm "${key}" | ||
#done | ||
|
||
# allow apt-get to retry downloads | ||
echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries | ||
|
||
apt-get update | ||
for dep in $@; do | ||
apt-get install "${dep}:${arch}" --assume-yes | ||
done | ||
|
||
# restore our old sources list | ||
mv -f /etc/apt/sources.list.bak /etc/apt/sources.list | ||
if [ -f /etc/dpkg/dpkg.cfg.d/multiarch.bak ]; then | ||
mv /etc/dpkg/dpkg.cfg.d/multiarch.bak /etc/dpkg/dpkg.cfg.d/multiarch | ||
fi | ||
|
||
# can fail if arch is used (amd64 and/or i386) | ||
dpkg --remove-architecture "${arch}" || true | ||
apt-get update |
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euo pipefail | ||
|
||
mkdir -m 0755 -p /etc/apt/keyrings | ||
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
|
||
echo \ | ||
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ | ||
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | ||
tee /etc/apt/sources.list.d/docker.list > /dev/null |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Deletes all objects in an S3 bucket that are older than a given number of days. | ||
# Used for cleaning up the custom Github Actions cache. | ||
|
||
import boto3 | ||
import datetime | ||
import os | ||
|
||
# Define the S3 bucket name and the number of days to retain objects | ||
days_to_retain = 7 | ||
|
||
bucket_name = os.environ['AWS_BUCKET_NAME'] | ||
access_key = os.environ['AWS_ACCESS_KEY_ID'] | ||
secret_key = os.environ['AWS_SECRET_ACCESS_KEY'] | ||
endpoint = os.environ['AWS_ENDPOINT'] | ||
|
||
# Create a connection to the S3 service | ||
s3 = boto3.resource('s3', | ||
endpoint_url = endpoint, | ||
aws_access_key_id = access_key, | ||
aws_secret_access_key = secret_key, | ||
region_name = 'auto', | ||
) | ||
|
||
bucket = s3.Bucket(bucket_name) | ||
|
||
# Calculate the retention date. | ||
cutoff_date = (datetime.datetime.now() - datetime.timedelta(days=days_to_retain)) | ||
cutoff_date = cutoff_date.replace(tzinfo=datetime.timezone.utc) | ||
|
||
print(f'Deleting all objects in bucket {bucket_name} older than {cutoff_date}...') | ||
|
||
total_count = 0 | ||
deleted_count = 0 | ||
|
||
for obj in bucket.objects.all(): | ||
total_count += 1 | ||
if obj.last_modified < cutoff_date: | ||
print(f'Deleting {obj.key}...') | ||
obj.delete() | ||
deleted_count += 1 | ||
|
||
print(f'Complete! Deleted {deleted_count} objects out of a total {total_count}.') |
This file contains 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
Oops, something went wrong.