Skip to content

Enable test builds with --bootstrap#127909

Open
am11 wants to merge 13 commits intodotnet:mainfrom
am11:feature/tests-build-with-bootstrap
Open

Enable test builds with --bootstrap#127909
am11 wants to merge 13 commits intodotnet:mainfrom
am11:feature/tests-build-with-bootstrap

Conversation

@am11
Copy link
Copy Markdown
Member

@am11 am11 commented May 7, 2026

Fixes #115622

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label May 7, 2026
@am11
Copy link
Copy Markdown
Member Author

am11 commented May 7, 2026

For community platforms, this is the cross-build workflow for runtime development/testing:

os=linux
arch=riscv64

# ROOTFS_DIR is set

# cross-build product, --bootstrap
./build.sh clr+libs --cross --arch $arch --os $os --bootstrap

# for rebuild (e.g. after editing code), --use-bootstrap
./build.sh clr+libs --cross --arch $arch --os $os --use-bootstrap

# runtime tests cross-build, --use-bootstrap
src/tests/build.sh -cross -$arch -$os -p:LibrariesConfiguration=Debug --use-bootstrap

# libraries tests cross-build, --use-bootstrap
./build.sh libs.tests --cross --arch $arch --os $os --use-bootstrap

cc:
riscv64: @clamp03, @dotnet/samsung
loongarch64: @LuckyXu-HF, @shushanhf
illumos: @gwr
FreeBSD: @Thefrank, @sec
Haiku: @trungnt2910
OpenBSD: @sethjackson

@am11 am11 requested a review from jkoritzinsky May 7, 2026 12:38
@jkotas
Copy link
Copy Markdown
Member

jkotas commented May 7, 2026

Update PR title to match the content?

@am11 am11 changed the title Inline remaining usages of OpenProcess on Unix Enable test builds with --bootstrap May 7, 2026
@am11
Copy link
Copy Markdown
Member Author

am11 commented May 7, 2026

Update PR title to match the content?

Ah, it somehow used cached title from my previous PR.

@am11 am11 force-pushed the feature/tests-build-with-bootstrap branch from f6b1128 to f6b70d2 Compare May 7, 2026 23:06
@Thefrank
Copy link
Copy Markdown
Contributor

Thefrank commented May 8, 2026

So if I am reading this correctly, after this PR, I can:

This is pretty awesome. I gave up trying to do nightly runtime builds / tests more than a year ago because it was such a hassle natively.

@am11
Copy link
Copy Markdown
Member Author

am11 commented May 8, 2026

Yes, it exists, e.g. in the build container:

$ docker run --rm -v$(pwd):/runtime -w /runtime -e ROOTFS_DIR=/crossrootfs/<xxx> -it <container-urn>
$ os=<yyy>; arch=<xxx>;
$ ./build.sh clr+libs --cross --arch $arch --os $os --bootstrap
$ ./build.sh libs.tests --cross --arch $arch --os $os --use-bootstrap -p:ArchiveTests=true

from host:

# pack and upload testhost to the machine
$ tar -czf testhost_net11.0-<yyy>-Debug-<xxx>.tar.gz artifacts/bin/testhost/net11.0-<yyy>-Debug-<xxx>
$ scp testhost_net11.0-<yyy>-Debug-<xxx>.tar.gz $TargetMachine:/tmp

# copy tests to the machine
$ scp artifacts/helix/tests/linux.AnyCPU.Debug/System.Text.RegularExpressions.Unit.Tests.zip $TargetMachine:/tmp

# usage
$ ssh $TargetMachine

$ mkdir testhost
$ tar -xzf /tmp/testhost_net11.0-<yyy>-Debug-<xxx>.tar.gz -C testhost
$ mkdir regex-tests
$ cd $_
$ unzip System.Text.RegularExpressions.Unit.Tests.zip

$ ./RunTests.sh --runtime-path ~/testhost/artifacts/bin/testhost/net11.0-<yyy>-Debug-<xxx>

For runtime tests, after the build, just pack and upload artifacts/tests/coreclr/<yyy>.<xxx>.Debug to remove machine and after extraction, and then e.g. to run interpreter tests: CORE_ROOT=$(pwd)/artifacts/tests/coreclr/<yyy>.<xxx>.Debug/Tests/Core_Root DOTNET_TieredCompilation=0 artifacts/tests/coreclr/<yyy>.<xxx>.Debug/JIT/Interpreter/InterpreterTester/InterpreterTester.sh


The only thing which doesn't work in general (unrelated to bootstrap) is building / packing individual library tests. e.g. the zip file generated by ./dotnet.sh build -p:UseBootstrap=true -p:ArchiveTests=true -p:TargetOS=$os -p:TargetArchitecture=$arch -p:CrossBuild=true src/libraries/System.Formats.Nrbf/tests misses xunit.console.runtimeconfig.json etc. so it's unusble. Perhaps we need to pass more properties? I just built the. whole libs.tests subset which is exercised in the CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Infrastructure-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

bootstrap: libs.tests subsets fails

3 participants