Description
Primitive specs test the behaviour of the compiler build. They need a fresh .build/crystal
to succeed.
This doesn't work as expected in the x86_64-mingw-w64-test-compiler
job because we never build the compiler there. If we change the compiler's behaviour, it'll fail (see #15186 (comment)).
The command in the workflow suggests that we incorrectly assume a) and b) that make primitives_spec
to have .build/crystal.exe
as a prerequisite.build/crystal.exe
exists.
UPDATE: .build/crystal.exe
is actually a prerequisite of primitives_spec
. The -o
flag just disabled building it (but the specs still run with the system compiler).
crystal/.github/workflows/mingw-w64.yml
Line 140 in 62c92a0
I believe we probably should make both premises true:
primitives_spec
should require.build/crystal
to exist as a very primitive measure to detect incorrect use (UPDATE: Maybe this is already fine. We used explicitly used the-o
flag incorrectly).- Copy the compiler artifact from the build job into the test-compiler job
For primitive specs it's essential that they run on a fresh compiler. But we usually run other tests on the fresh compiler as well to ensure it behaves correctly.
In other workflows (which typically use the bin/ci
tool) the process is usually something like this:
# test std_spec on previous compiler
make std_spec clean
# build fresh compiler
make crystal
# run tests on fresh compiler
make primitives_spec std_spec compiler_spec
make samples
CRYSTAL_OPTS=--debug make samples
We should probably have a similar setup for mingw64 as well. For organizational purposes it would be nice to keep the split into separate jobs, but have the compiler test job depend on the build job.
I'm also wondering if we need to build shards
everytime in the build job. We added that because the artifact is used for releases, but that should really only be necessary for release builds.