Skip to content

[CI] mingw-w64 workflow testing a fresh compiler #15516

Open
@straight-shoota

Description

@straight-shoota

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) make primitives_spec to have .build/crystal.exe as a prerequisite and b) that .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).

make -o .build/crystal.exe primitives_spec # we know the compiler is fresh; do not rebuild it here

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions