Export all SCML file paths via environment variable in Docker image

This commit is contained in:
Tao Su 2025-12-11 06:09:45 +00:00 committed by Tate, Hongliang Tian
parent b042ca1115
commit 246fbafa20
2 changed files with 5 additions and 4 deletions

View File

@ -77,6 +77,10 @@ RUN apt clean && rm -rf /var/lib/apt/lists/*
# Install sctrace
RUN ln -s /root/asterinas/tools/sctrace.sh /usr/local/bin/sctrace
# Set the `ASTER_SCML` env var to make sctrace easier to use for Asterinas developers.
# For more information, check out the README of sctrace.
RUN echo 'export ASTER_SCML=$(find /root/asterinas/book/src/kernel/linux-compatibility/ -name "*.scml")' >> /root/.bashrc
# Copy the gvisor syscall test binaries
COPY --from=build-gvisor /root/gvisor/build/syscall_test_bins /root/syscall_test_bins
ENV GVISOR_PREBUILT_DIR=/root/syscall_test_bins

View File

@ -9,8 +9,5 @@ SCRIPT_PATH="$(readlink -f "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
ASTERINAS_ROOT="$(dirname "$SCRIPT_DIR")"
# Search all SCML files
scml_files=$(find "$ASTERINAS_ROOT/book/src/kernel/linux-compatibility" -type f -name "*.scml" | tr '\n' ' ')
# Run sctrace with all arguments passed to this script
cargo run -q --manifest-path "$ASTERINAS_ROOT/tools/sctrace/Cargo.toml" -- $scml_files "$@"
cargo run -q --manifest-path "$ASTERINAS_ROOT/tools/sctrace/Cargo.toml" -- "$@"