Skip to content

GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)#14013

Merged
dra27 merged 12 commits intoocaml:trunkfrom
dra27:more-ci-tweaks
May 5, 2025
Merged

GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)#14013
dra27 merged 12 commits intoocaml:trunkfrom
dra27:more-ci-tweaks

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented May 4, 2025

This adds a couple of things I've been using over on my fork for Relocatable OCaml for the last few months:

  • Optional additional test matrix items added via a CI: Full matrix label
    • A --disable-shared job on Linux
    • The "minimal" build (everything which can be turned off turned off), which is run on Jenkins, but which wasn't available for PRs
    • Cygwin testing
  • The ability to turn off the testsuite on a PR (intended to be used carefully, or only temporarily!) via a CI: Skip testsuite label

I've pulled in and updated the documentation improvements from #13996 and also the fix to tools/check-symbol-names as my version hadn't originally been calling that. Unlike in #13996, I opted to fix the test_create_cursor_failures.ml test, as the failure was for the same reason as the i386 run originally in #13419. To do, I've adapted a fix in the style of #8797 in ocamltest only.

I've included comments in the YAML for the part which generates the matrix, but note that the workflow here is to avoid re-running either of the build workflows automatically if the labels are added/removed - the idea is to re-run the config job in each workflow manually if the labels have been changed. There's more merging work with these workflows to do in the future, but I think this is a reasonable step forward...

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented May 4, 2025

Example on my fork with the two labels applied - dra27#195 (I won’t add the new labels here until we’ve agreed both that we want to do it and on the names!)

Copy link
Copy Markdown
Contributor

@MisterDA MisterDA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like all these changes. I appreciate how the configure arguments are now handled, and the introduction of the config job. I made a minor suggestion on the C code.

I'm a bit puzzled by the double comments: why are // # needed in all these lines?

I'm tempted to suggest to switch to a list of arches in the build matrix: instead of having x86_64: [true, false], we could have arch: ['x86', 'x86_64'], which I find cleaner; and in the future arm64!

The label run-cygwin-tests was introduced in my previous attempt, it can be removed.

Comment on lines +140 to +143
int i = 0;
LUID_AND_ATTRIBUTES* privilege = process_privileges->Privileges;

while (i++ < process_privileges->PrivilegeCount) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int i = 0;
LUID_AND_ATTRIBUTES* privilege = process_privileges->Privileges;
while (i++ < process_privileges->PrivilegeCount) {
LUID_AND_ATTRIBUTES* privilege = process_privileges->Privileges;
for (int i = 0; i < process_privileges->PrivilegeCount; i++) {

Is there a reason you didn't opt for the for loop?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah - because it was adapted from this in #8797:

        /* Search for SeRestorePrivilege */
        while (i < privs->PrivilegeCount
               && (privilege->Luid.HighPart != privilege_luid.HighPart
                   || privilege->Luid.LowPart != privilege_luid.LowPart)) {
          i++;
          privilege++;
        }

(I can't resist the temptation to say "Luxury! When I were a lad we didn't have any of these 'ere for loops!")

@dra27 dra27 force-pushed the more-ci-tweaks branch from 3aca4bf to 2ce55cc Compare May 5, 2025 15:29
@dra27
Copy link
Copy Markdown
Member Author

dra27 commented May 5, 2025

I'm a bit puzzled by the double comments: why are // # needed in all these lines?

Ah, that's because my editor doesn't recognise TypeScript embedded in YAML! 🫣

MisterDA and others added 6 commits May 5, 2025 16:40
Define the matrix for the others job using an actions/github-script
step, which allows the possibility of the matrix being dynamic.
Tests a full `--disable-shared` build on Linux and also a Linux build
with as many options disabled as possible (as the minimal build in the
other-configs job on Jenkins also does).

The matrix is expanded by adding the 'CI: Full matrix' label to a pull
request.
If Cygwin is running "elevated" - which it is in CI - then it acts as
though it's running as root. It intentionally activates
SeBackupPrivilege, which thwarts the test_create_cursor_failures.ml
test.

The OCaml testsuite will never require root privileges for anything
meaningful, so ocamltest on Cygwin simply drops the SeBackupPrivilege
when running on Cygwin, which means the test correctly fails.
@dra27 dra27 force-pushed the more-ci-tweaks branch from 2ce55cc to 23e27b6 Compare May 5, 2025 15:40
@dra27
Copy link
Copy Markdown
Member Author

dra27 commented May 5, 2025

I pushed an extra commit trying out the arch versus x86_64 idea, thanks!

dra27 added 6 commits May 5, 2025 17:02
Yes, yes, the filename -msvc.yml has become a bit out of date...
Applying this label _before_ the testsuite has started in either GitHub
Actions or AppVeyor will cause the execution of the testsuite to be
skipped.
@dra27 dra27 force-pushed the more-ci-tweaks branch from 23e27b6 to a9449fa Compare May 5, 2025 16:02
Copy link
Copy Markdown
Member

@gasche gasche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on behalf of @MisterDA, thank you both.

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented May 5, 2025

I've renamed the run-cygwin-tests label and added the CI: Skip testsuite label and checked that the configuration steps on the PR on my fork all had the correct sets of flags

@dra27 dra27 merged commit 96b56fd into ocaml:trunk May 5, 2025
24 checks passed
@kit-ty-kate
Copy link
Copy Markdown
Member

kit-ty-kate commented May 5, 2025

Is it expected for one of the GHA jobs to be named ${{ matrix.name }} ? That job was skipped so i'm not 100% sure which one it is, but looking at the other names, i think it's the new Cygwin job.

EDIT: ah nevermind, it's in the "ThreadSanitizer" sub-category

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented May 5, 2025

That’s something I hope to deal with when they all get merged - the semantics of an empty or a skipped matrix are a bit meh!

dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit that referenced this pull request May 19, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request May 20, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request Jun 27, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
dra27 added a commit to dra27/ocaml that referenced this pull request Jun 27, 2025
GHA: add an optional wider test matrix (Cygwin, static, minimal, etc.)
(cherry picked from commit 96b56fd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants