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

Fix MacOS CI #145

Merged
merged 1 commit into from
May 14, 2024
Merged

Conversation

ddeclerck
Copy link
Contributor

No description provided.

@ddeclerck ddeclerck force-pushed the fix_macos_ci branch 12 times, most recently from 1569e7f to 4dd2ef8 Compare May 13, 2024 14:03
@GitMensch
Copy link
Collaborator

consider to either include libjson-c or copying cJSON.[ch] into the libcob folder

concerning the one failed test:

27. used_binaries.at:1088: testing check include header file ...
../../tests/used_binaries.at:1103: $COMPILE_MODULE prog.cob
../../tests/used_binaries.at:1107: $COMPILE_MODULE --include $(_return_path "$(pwd)/filec.h") -fstatic-call prog.cob
stderr:
/var/folders/3m/p59k4qdj0f17st0gn2cmj3640000gn/T/cob16960_0.c:108:31: error: too few arguments to function call, expected 2, have 1
  b_2 = f ((cob_u8_ptr)"Hello");
        ~                     ^
/Users/runner/work/gnucobol/gnucobol/_build/tests/testsuite.dir/0027/filec.h:3:21: note: 'f' declared here
COB_EXT_IMPORT void f (char *, long);
                    ^
1 error generated.
../../tests/used_binaries.at:1125: $COMPILE_MODULE --save-temps filec.c -o libfilec.$COB_MODULE_EXT
../../tests/used_binaries.at:1129: $COMPILE_MODULE --include $(_return_path "$(pwd)/filec.h") -fstatic-call prog2.cob
--- /dev/null	2024-05-13 14:05:02
+++ /Users/runner/work/gnucobol/gnucobol/_build/tests/testsuite.dir/at-groups/27/stderr	2024-05-13 14:05:04
@@ -0,0 +1,4 @@
+ld: Undefined symbols:
+  _f, referenced from:
+      _prog_ in cob17175_0-e76249.o
+clang: error: linker command failed with exit code 1 (use -v to see invocation)
../../tests/used_binaries.at:1129: exit code was 1, expected 0
../../tests/used_binaries.at:1129: $COMPILE_MODULE --include $(_return_path "$(pwd)/filec.h") -fstatic-call -L. -lfilec prog2.cob
stderr:
ld: unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '/Users/runner/work/gnucobol/gnucobol/_build/tests/testsuite.dir/0027/libfilec.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
stdout:
../../tests/used_binaries.at:1129: exit code was 1, expected 0
27. used_binaries.at:1088: 27. check include header file (used_binaries.at:1088): FAILED (used_binaries.at:1129)

I have no clue how to fix that; my changes here seem to have fixed the Win32 (MinGW and MSVC) issues.

@ddeclerck
Copy link
Contributor Author

ddeclerck commented May 13, 2024

concerning the one failed test:

27. used_binaries.at:1088: testing check include header file ...
../../tests/used_binaries.at:1103: $COMPILE_MODULE prog.cob
../../tests/used_binaries.at:1107: $COMPILE_MODULE --include $(_return_path "$(pwd)/filec.h") -fstatic-call prog.cob
stderr:
/var/folders/3m/p59k4qdj0f17st0gn2cmj3640000gn/T/cob16960_0.c:108:31: error: too few arguments to function call, expected 2, have 1
  b_2 = f ((cob_u8_ptr)"Hello");
        ~                     ^
/Users/runner/work/gnucobol/gnucobol/_build/tests/testsuite.dir/0027/filec.h:3:21: note: 'f' declared here
COB_EXT_IMPORT void f (char *, long);
                    ^
1 error generated.
../../tests/used_binaries.at:1125: $COMPILE_MODULE --save-temps filec.c -o libfilec.$COB_MODULE_EXT
../../tests/used_binaries.at:1129: $COMPILE_MODULE --include $(_return_path "$(pwd)/filec.h") -fstatic-call prog2.cob
--- /dev/null	2024-05-13 14:05:02
+++ /Users/runner/work/gnucobol/gnucobol/_build/tests/testsuite.dir/at-groups/27/stderr	2024-05-13 14:05:04
@@ -0,0 +1,4 @@
+ld: Undefined symbols:
+  _f, referenced from:
+      _prog_ in cob17175_0-e76249.o
+clang: error: linker command failed with exit code 1 (use -v to see invocation)
../../tests/used_binaries.at:1129: exit code was 1, expected 0
../../tests/used_binaries.at:1129: $COMPILE_MODULE --include $(_return_path "$(pwd)/filec.h") -fstatic-call -L. -lfilec prog2.cob
stderr:
ld: unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '/Users/runner/work/gnucobol/gnucobol/_build/tests/testsuite.dir/0027/libfilec.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
stdout:
../../tests/used_binaries.at:1129: exit code was 1, expected 0
27. used_binaries.at:1088: 27. check include header file (used_binaries.at:1088): FAILED (used_binaries.at:1129)

I have no clue how to fix that; my changes here seem to have fixed the Win32 (MinGW and MSVC) issues.

I believe this has to do with the bundle/loadable module VS dynamic library thing specific to MacOS.
I have no idea how to fix that either (and no will to delve into MacOS insanities - I have to preserve my own sanity).

@GitMensch
Copy link
Collaborator

Far sanity purpose: let's use AT_XFAIL_IF ($COB_MODULE_EXT="dylib") in this test (with some useful description in a comment up-front.

But that looks highly suspicions: sed -i '' 's/-undefined suppress//g' config.h what are we doing here and why?

Concerning the addition of libjson-c / cJSON-[hc]: without that we don't build and test a complete module (the JSON part).

@ddeclerck
Copy link
Contributor Author

Far sanity purpose: let's use AT_XFAIL_IF ($COB_MODULE_EXT="dylib") in this test (with some useful description in a comment up-front.

Alright.

But that looks highly suspicions: sed -i '' 's/-undefined suppress//g' config.h what are we doing here and why?

See comment above.

Concerning the addition of libjson-c / cJSON-[hc]: without that we don't build and test a complete module (the JSON part).

Yeah, I realized meanwhile and made the change ;)

@ddeclerck ddeclerck force-pushed the fix_macos_ci branch 4 times, most recently from b245211 to 3fe0a64 Compare May 13, 2024 16:54
@GitMensch
Copy link
Collaborator

GitMensch commented May 13, 2024

All checks pass - YAY.
As noted: please adjust the typo for "ototype" in configure.ac as well and check that in upstream together with a Changelog entry.
As we do change something "quite big" for darwin, it is likely a good idea to also note that in NEWS, what do you think?

After doing the configure.ac related changes upstream, this PR needs to be rebased (or adjusted to only change the mirror-only workflow definitions).

@ddeclerck
Copy link
Contributor Author

All checks pass - YAY. As noted: please adjust the typo for "ototype" in configure.ac as well and check that in upstream together with a Changelog entry. As we do change something "quite big" for darwin, it is likely a good idea to also note that in NEWS, what do you think?

Changes done. I also added a NEWS entry, because this is indeed an important change.

After doing the configure.ac related changes upstream, this PR needs to be rebased (or adjusted to only change the mirror-only workflow definitions).

I'll do that in the morning.

@GitMensch GitMensch merged commit 4907e0d into OCamlPro:gcos4gnucobol-3.x May 14, 2024
4 checks passed
@ddeclerck ddeclerck deleted the fix_macos_ci branch October 4, 2024 11:23
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