Skip to content

Fix coccinelle linking regression test on Cygwin#13738

Merged
dra27 merged 3 commits intoocaml:trunkfrom
dra27:cocinelle-cygwin
Jan 16, 2025
Merged

Fix coccinelle linking regression test on Cygwin#13738
dra27 merged 3 commits intoocaml:trunkfrom
dra27:cocinelle-cygwin

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented Jan 16, 2025

#13673 added a test which includes:

output="cocinelle";
all_modules = "a.cmx cocinelle.cmx";
program="./cocinelle.exe";

where the program is cocinelle.exe (on all platforms) and result of running that program is sent to the file concinelle.

This doesn't work on Cygwin, as cocinelle.exe is created first, and at that point cocinelle and cocinelle.exe are the same file. When ocamltest tries to run ./cocinelle.exe it dutifully redirects stdout to cocinelle and Cygwin dutifully truncates concinelle.exe. Executing an empty executable returns code 0, and then the check on the output correctly fails.

I've fixed it by adding .output (which is what the only other test which uses this feature does), although it's not entirely clear to me why either output or program is being set here, @Octachron?

@Octachron
Copy link
Copy Markdown
Member

I really don't remember a good reason for setting either program or output beyond the point that the test did fail before the corresponding bug fix.

@gasche
Copy link
Copy Markdown
Member

gasche commented Jan 16, 2025

Note: I believe that the correct spelling is "coccinelle" (see the software page), with two consecutive "c" to sound like an "x", so while we are at it we could also fix this.

dra27 added 2 commits January 16, 2025 20:53
Native code version of the test specifies that the program is
coccinelle.exe (on all platforms) and the output coccinelle. On Cygwin,
these are the same file and setting up the output therefore truncates
the program before it runs.
@dra27 dra27 changed the title Fix cocinelle linking regression test on Cygwin Fix coccinelle linking regression test on Cygwin Jan 16, 2025
@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Jan 16, 2025

@dra27 dra27 merged commit b542018 into ocaml:trunk Jan 16, 2025
@dra27 dra27 deleted the cocinelle-cygwin branch January 16, 2025 21:48
dra27 added a commit that referenced this pull request Jan 23, 2025
Fix coccinelle linking regression test on Cygwin

(cherry picked from commit b542018)
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.

3 participants