Skip to content

Conversation

@ddeclerck
Copy link
Collaborator

@ddeclerck ddeclerck commented May 4, 2025

This PR brings non CI-related changes from PR 225 to GC3.
Essentially, it allows to customize the diff command to use.

@ddeclerck
Copy link
Collaborator Author

ddeclerck commented May 4, 2025

Hmm, failures in MSYS2 are due to an update of the gcc version used, which in turn incremented the default std version. This is related to https://sourceforge.net/p/gnucobol/discussion/help/thread/2a4601183a.
Should we attempt to fix that properly, or just pass the -Wno-error=incompatible-pointer-types flag ?

Though: maybe we should add CI checks for different std values (at least for the Ubuntu CI)

@GitMensch
Copy link
Collaborator

Concerning std23: The Gentoo patch looks like what I had in mind - I "only" need to test it on "ancient" compilers (if there are issues that means an ifdef/macro solution) and it likely has to been extended into codegen before, which would be a bit more work - you're welcome to provide another PR for that (for the time being only using a macro if you find that good without conditional compilation).

We should have a single CI with the oldest std and checks (I think that's there) and otherwise go with the default one.

Copy link
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

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

Changelog entries missing (even goes to tests this time), possibly adjust the actual check within configure.

@ddeclerck ddeclerck force-pushed the configurable_diff branch 5 times, most recently from b685cb1 to 6469b87 Compare May 13, 2025 10:29
@ddeclerck
Copy link
Collaborator Author

Added the Changelog entries and updated the config test.
(MSYS2 CI temporarily adjusted until PR #229 is merged)

Copy link
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

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

Thank you for your work.
Some minor changes are needed, can likely go upstream today.

mkdir _build
cd _build
../configure $CFGOPT
../configure $CFGOPT CFLAGS=--std=c17 DIFF="/c/Program Files/Git/usr/bin/diff.exe" DIFF_FLAGS="-w"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please clarify: with the adjusted test the setting of DIFF is not necessary any more, is it?
Also: why do we need -w - --strip-trailing-cr is set automatically and should be enough, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We still need to use a "custom diff" (the one from Git-bash) to workaround the diff problems we have in MSYS2 (cf #225 (comment)).

As for -w, last time I checked, it was needed despite using --strip-trailing-cr. I can check again...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And as you can see by the last run, comparison fails in NIST even if the files are "identical" (and despite using --strip-trailing-cr) ; I don't get what could cause this, but -w seems to work around this...

Copy link
Collaborator Author

@ddeclerck ddeclerck May 13, 2025

Choose a reason for hiding this comment

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

Oh, in fact the --strip-trailing-cr flag was not passed on MSYS2 - due to the path to diff containing spaces (was messing with the option detection). Fixed by quoting $DIFF in configure.ac.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We still need to use a "custom diff" (the one from Git-bash) to workaround the diff problems we have in MSYS2 (cf #225 (comment)).

The point is that the test in configure.ac should go through all available diff binaries in PATH and then set DIFF to the one that does not fail the test, which should be the one from git (in the case that this is not in PATH, please use PATH="$PATH:/c/Program Files/Git/usr/bin" ../configure $CFGOPT CFLAGS=--std=c17 to ensure that the check can find it).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, yeah, I had forgotten about that part. I'll update accordingly.

@ddeclerck ddeclerck force-pushed the configurable_diff branch 5 times, most recently from f4295ea to 2931616 Compare May 13, 2025 13:36
@ddeclerck ddeclerck force-pushed the configurable_diff branch from 2931616 to 58d4b7d Compare May 13, 2025 13:51
@GitMensch
Copy link
Collaborator

I think you have the encoding right now, as an alternative c/Program\ Files/ would likely have been another option.

Copy link
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

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

Good for upstream now - and good that the test is now also verified in the CI :-)

@ddeclerck
Copy link
Collaborator Author

Merged in SVN @ 5508.

@GitMensch GitMensch closed this May 13, 2025
@ddeclerck ddeclerck deleted the configurable_diff branch July 29, 2025 07:22
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.

2 participants