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

re-test sorobans against their observations with core-chosen rust compiler #4652

Merged
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
5 changes: 5 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ RUST_TOOLCHAIN_FILE=$(top_srcdir)/rust-toolchain.toml
RUST_TOOLCHAIN_CHANNEL=$(shell sed -n 's/channel *= *"\([^"]*\)"/\1/p' $(RUST_TOOLCHAIN_FILE))
CARGO=cargo +$(RUST_TOOLCHAIN_CHANNEL)

# we pass RUST_TOOLCHAIN_CHANNEL by environment variable
# to tests since they can't take command-line arguments.
export RUST_TOOLCHAIN_CHANNEL

RUST_BUILD_DIR=$(top_builddir)/src/rust
RUST_BIN_DIR=$(RUST_BUILD_DIR)/bin
RUST_TARGET_DIR=$(top_builddir)/target
Expand Down Expand Up @@ -313,6 +317,7 @@ else # !USE_POSTGRES
TESTS=test/selftest-nopg
endif # !USE_POSTGRES
TESTS += test/check-nondet
TESTS += test/check-sorobans

format: always
if USE_CLANG_FORMAT
Expand Down
33 changes: 33 additions & 0 deletions src/test/check-sorobans
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

# Copyright 2025 Stellar Development Foundation and contributors. Licensed
# under the Apache License, Version 2.0. See the COPYING file at the root
# of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

# This file re-runs all the tests in each soroban submodule, using the rustc
# that stellar-core is compiled with. In theory these tests shouldn't be broken
# very often since there's CI on the soroban repos, but it's still possible that
# the soroban CI ran on a different rust compiler / stdlib version than
# stellar-core was built with, and the fine-grained "observations" stored in the
# soroban repos are worth re-checking.

if [ -z "${RUST_TOOLCHAIN_CHANNEL}" ];
then
echo "RUST_TOOLCHAIN_CHANNEL must be set to the channel of the rust compiler that stellar-core was built with"
exit 1
fi

set -e
set -x

cd rust/soroban
for i in p??; do
cd $i
RUSTFLAGS="-Cmetadata=${i}" cargo +${RUST_TOOLCHAIN_CHANNEL} \
test \
--locked \
--package soroban-env-host \
--features testutils \
--profile test-opt
cd ..
done