Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI for forward-porting GC3 patches to GC4 #147

Draft
wants to merge 9 commits into
base: gc4
Choose a base branch
from

Conversation

ddeclerck
Copy link
Contributor

Follow-up of #146.

@ddeclerck ddeclerck changed the title Dummy commit CI for forward-porting GC3 patches to GC4 May 29, 2024
@ddeclerck ddeclerck force-pushed the gc3_to_gc4 branch 3 times, most recently from 6900d8d to 1c95bd0 Compare May 30, 2024 21:21
@@ -96,12 +96,15 @@ autoreconf $AC_OPTS $MAINPATH > $msgs 2>&1; ret=$?
# Filter aminclude_static as those are only used _within_ another
# check so reporting as portability problem is only noise.
# This has the effect of redirecting some error messages to stdout.
# to be moved to the Makefile - currently only usable for bootstrap,
# but should be done on autogen, too
Copy link
Collaborator

Choose a reason for hiding this comment

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

A, that old TODO...

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.

I suggest to wrap the commits again. From what I've inspected we need one refactor for integrating 4.x logic (you've spotted that well) nicely.

libcob/fileio.c Outdated
snprintf (file_open_env, (size_t)COB_FILE_MAX, "%s%s", "IO_", s);
if ((file_open_io_env = cob_get_env (file_open_env, NULL)) == NULL) {
snprintf (file_open_env, (size_t)COB_FILE_MAX, "%s%s", "io_", s);
if (f != NULL) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

When/why should f be null here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because some functions (open_cbl_file, cob_sys_delete_file, ...) were "improved" to perform file mapping in GC3 (rev 3944), by calling the cob_chk_file_mapping function, which does not take a cob_file argument in GC3 but does in GC4, and that function in turn calls cob_chk_file_env. Since these functions (open_cbl_file, cob_sys_delete_file, ...) do not use a cob_file object, I resorted to passing NULL and coping with that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this okay for you @GitMensch ?

@GitMensch
Copy link
Collaborator

oops, hope I haven't broken the gitignore in f36dcda - if not then we likely should apply that to the gcos3x branch as well.

@ddeclerck
Copy link
Contributor Author

ddeclerck commented May 31, 2024

I suggest to wrap the commits again. From what I've inspected we need one refactor for integrating 4.x logic (you've spotted that well) nicely.

Saw your message a bit late, added another commit in the meantime 😅

By wrapping up you mean, committing to SVN ? (after doing the requested modifications of course)

@GitMensch
Copy link
Collaborator

GitMensch commented Jun 1, 2024 via email

@ddeclerck
Copy link
Contributor Author

I tend to be overly "conservative". Indeed this piece of code is barely modified afterwards, so I'll do the refactoring.

@ddeclerck
Copy link
Contributor Author

Is this okay to merge (@GitMensch) ?

@GitMensch
Copy link
Collaborator

I'll try to review this (late) evening.

@GitMensch
Copy link
Collaborator

looks_absolute should use "src", not file_open_name directly (merge issue?)

"apply_file_paths" should get that via argument as well and have a function comment that it writes to the global buffer. Then add a Changelog "extracted from xyz and also used in abc" to finish that last commit.

We either have to remember for later that we need to add a testcase for the new use or (potentially easier) also include it in the last commit as well.

@ddeclerck
Copy link
Contributor Author

looks_absolute should use "src", not file_open_name directly (merge issue?)

This change is introduced in a later commit (3993).

"apply_file_paths" should get that via argument as well and have a function comment that it writes to the global buffer. Then add a Changelog "extracted from xyz and also used in abc" to finish that last commit.

Alright ; as for its output, should it write it through its argument or directly to file_open_name ?

We either have to remember for later that we need to add a testcase for the new use or (potentially easier) also include it in the last commit as well.

By "new use", de you mean the fact that we apply file paths to the complex case ?

@GitMensch
Copy link
Collaborator

By "new use", de you mean the fact that we apply file paths to the complex case ?

yes

This change is introduced in a later commit (3993).

good catch - then it is fine to leave as is; if you don't expect any big problem it would be nice to merge that in this bunch to commit that together, but a later bunch is fine as well

Alright ; as for its output, should it write it through its argument or directly to file_open_name ?

Depends on how other functions do it - it is best for now to mimic that (once the merge is completed we may revisit that part, but there are "some" commits left until we get there).

@ddeclerck
Copy link
Contributor Author

I made the necessary changes.

This change is introduced in a later commit (3993).

good catch - then it is fine to leave as is; if you don't expect any big problem it would be nice to merge that in this bunch to commit that together, but a later bunch is fine as well

I find it more convenient to merge consecutive commits. If that's okay for you I could add to the current batch the next eligible commits until 3993 (that would be 6 commits: 3973, 3979, 3988, 3989, 3992 and 3993).

@GitMensch
Copy link
Collaborator

That batch is good to go :-)

@ddeclerck
Copy link
Contributor Author

That batch is good to go :-)

Merged in SVN ;)

I see the next commits deal with translation files. Checking the history, it seems those files are usually just copied "as-is" from the GC3 branch to the trunk; is this correct ?

@GitMensch
Copy link
Collaborator

I see the next commits deal with translation files. Checking the history, it seems those files are usually just copied "as-is" from the GC3 branch to the trunk; is this correct ?

No, only new files are copied, the others left as-is; before a release I regenerate the files but the files are nearly completely maintained by the translation project.
So just record the merge, then copy over new files and svn add them, if there are any.

And of course

@ddeclerck
Copy link
Contributor Author

ddeclerck commented Jun 8, 2024

Alright.

And of course

Hope this unfinished sentence did not have any vital info 😅

@GitMensch
Copy link
Collaborator

I can't remember any important info missing there.

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 84.34066% with 57 lines in your changes missing coverage. Please review.

Please upload report for BASE (gc4@84c55ce). Learn more about missing BASE report.

Files with missing lines Patch % Lines
libcob/strings.c 86.68% 16 Missing and 23 partials ⚠️
libcob/common.c 38.46% 4 Missing and 4 partials ⚠️
cobc/codegen.c 0.00% 3 Missing ⚠️
cobc/parser.y 0.00% 3 Missing ⚠️
libcob/screenio.c 57.14% 0 Missing and 3 partials ⚠️
libcob/move.c 97.36% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@          Coverage Diff           @@
##             gc4     #147   +/-   ##
======================================
  Coverage       ?   66.07%           
======================================
  Files          ?       39           
  Lines          ?    68751           
  Branches       ?    19153           
======================================
  Hits           ?    45427           
  Misses         ?    16114           
  Partials       ?     7210           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ddeclerck
Copy link
Contributor Author

Quick question: I sometimes see alternative code for GC4 in #if 0 blocks; I guess I should implement those and drop the other branch, correct ?

I'm talking about those:

#if 0 /* TODO for 4.0: set the attributes from the field given outside on the stack */
		output ("cob_field *cob_fret, const int cob_pam");
#else
		output ("cob_field **cob_fret, const int cob_pam");
#endif

@GitMensch
Copy link
Collaborator

That's quite a bunch - any reason to not merge upstream?
Open issues you are aware of or special adjustments needed?

[we really need to get to commits that have someone else in the ChangeLogs...]

@ddeclerck
Copy link
Contributor Author

ddeclerck commented Jun 12, 2024

That's quite a bunch - any reason to not merge upstream? Open issues you are aware of or special adjustments needed?

No good reason. It may be many commits, but the first batch had way more lines (this one is only +1,162 −904).
Anyways, I'll merge upstream if that's okay with you.

[we really need to get to commits that have someone else in the ChangeLogs...]

I'm looking forward to reaching commit 4614 - our first contribution to GC3 ;)

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.

Current bunch LGTM - put to upstream as you like.

Note: readline detection (and inclusion) may be adjusted by the use pkg_config/ncurses-config; but I agree, that this shouldn't make much difference for the coverage.

@GitMensch
Copy link
Collaborator

GitMensch commented Feb 15, 2025 via email

@ddeclerck ddeclerck force-pushed the gc3_to_gc4 branch 5 times, most recently from 7c640cb to 9b14e76 Compare February 17, 2025 08:28
@ddeclerck
Copy link
Contributor Author

This is a bunch of many small commits, mostly cleanup and build/warning fixes (this notably improves testsuite results under MSVC).

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.

minor notes found in the review

@GitMensch
Copy link
Collaborator

bunch is fine for check-in

@ddeclerck
Copy link
Contributor Author

And that's it for this batch.

The biggest part is Boris' contribution for thread-safety of INSPECT/STRING state structures (5302 + my fix 5406).
Note that this contribution also added backward-compatibility tests to the testsuite (a huge file : backcomp.at) - since we break compatibility with GC4, should I just remove this file ?

Other notable parts of this batch are the BDB adjustments for keys of different lengths and partial keys (5296 and 5412) and some of Chuck's modifications to moves to NUMERIC-EDITED (5287).

The rest is a few things here and there.

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.

some changes requested, the biggest is the one about backward compatibilty

@GitMensch
Copy link
Collaborator

Re-posting a note from @chuck-haatvedt as it seem to not be posted by the mail gateway:

Today I did a build of GNUCOBOL 4 using my MSYS2 build scripts on Windows 10. The build encountered a number of failures in the testsuite that do not happen in my GNUCOBOL 3.3+ builds..

## ------------- ##
## Test results. ##
## ------------- ##

ERROR: 1370 tests were run,
41 failed (26 expected failures).
20 tests were skipped.

## ------------------------ ##
## Summary of the failures. ##
## ------------------------ ##
Failed tests:
GnuCOBOL 4.0 test suite: GnuCOBOL Tests test groups:

 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
      KEYWORDS

   8: used_binaries.at:385 temporary path invalid
      cobc runmisc
 835: run_misc.at:9559   Test dump feature (4)
      dump
 836: run_misc.at:10010  Test dump feature (5)
      dump
 914: run_file.at:493    OUTPUT on INDEXED file to missing directory
      runfile open assign
 986: run_file.at:8603   INDEXED undeclared keys
      runfile
 1016: run_file.at:21497  PIPE I/O
      runfile
 1017: run_file.at:21700  STDOUT STDERR I/O
      runfile pipe :ci: :co: :ce:
 1018: run_file.at:21889  LINE SEQUENTIAL one Record
      runfile cob_sync read write
 1025: run_file.at:23696  INDEXED COMMIT/ROLLBACK
      runfile
 1026: run_file.at:24261  SEQUENTIAL/RELATIVE COMMIT/ROLLBACK
      runfile
 1027: run_file.at:24778  LINE SEQUENTIAL COMMIT / ROLLBACK
      runfile
 1028: run_file.at:25080  OPEN OUTPUT COMMIT / ROLLBACK
      runfile
 1029: run_file.at:25319  MF io status (indexed)
      runfile
 1030: run_file.at:25548  Test MF Status (sequential)
      runfile
 1033: run_file.at:26122  LINE SEQUENTIAL
      runfile mf-file

testsuite.log

@ddeclerck
Copy link
Contributor Author

Yeah, those are exactly the 14 tests that still fail under the GC4 MSYS2 CI. They've been failing since I set up the CI before starting the merge - though the number of failing tests went down from 25 to 14. I still hope the next batches will reduce that number... in any case bringing that down to 0 is one of the post-merge task.

@GitMensch GitMensch mentioned this pull request Mar 10, 2025
@GitMensch
Copy link
Collaborator

adjust/drop that backward comment, then good for upstream

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