Skip to content

Add Solaris build#517

Merged
0-wiz-0 merged 1 commit intonih-at:mainfrom
psumbera:solaris
Jan 27, 2026
Merged

Add Solaris build#517
0-wiz-0 merged 1 commit intonih-at:mainfrom
psumbera:solaris

Conversation

@psumbera
Copy link
Contributor

No description provided.

@0-wiz-0
Copy link
Member

0-wiz-0 commented Jan 27, 2026

Thank you for the workflow!
As for the CMake part: in the Solaris docs at https://docs.oracle.com/cd/E88353_01/html/E37843/memset-s-3c.html it is claimed that #define __STDC_WANT_LIB_EXT1__ 1 is needed, and we already do that.
What Solaris version are you using exactly?

@psumbera
Copy link
Contributor Author

Thank you for the workflow! As for the CMake part: in the Solaris docs at https://docs.oracle.com/cd/E88353_01/html/E37843/memset-s-3c.html it is claimed that #define __STDC_WANT_LIB_EXT1__ 1 is needed, and we already do that. What Solaris version are you using exactly?

You are right. But in case of lib/zip_buffer.c it's defined after inclusion of <string.h>.

Not sure what is proper solution.

@0-wiz-0
Copy link
Member

0-wiz-0 commented Jan 27, 2026

I thought I had fixed that in e16526d - which version are you testing against?

@psumbera
Copy link
Contributor Author

Ok, I saw the problem in 1.11.4. I didn't verify latest commits. So hopefully it does work now.

@0-wiz-0 0-wiz-0 merged commit e96a210 into nih-at:main Jan 27, 2026
1 check was pending
@0-wiz-0
Copy link
Member

0-wiz-0 commented Jan 27, 2026

Thank you, merged!

@0-wiz-0
Copy link
Member

0-wiz-0 commented Jan 27, 2026

Hm, ziptool_regress fails to build with

[ 91%] Building C object regress/CMakeFiles/ziptool_regress.dir/ziptool_regress.c.o
  In file included from /home/runner/work/libzip/libzip/src/ziptool.c:34,
                   from /home/runner/work/libzip/libzip/regress/ziptool_regress.c:94:
  /home/runner/work/libzip/libzip/src/ziptool.c: In function ‘zstat’:
  /home/runner/work/libzip/libzip/lib/compat.h:189:23: error: implicit declaration of function ‘localtime_s’; did you mean ‘localtime_r’? [-Wimplicit-function-declaration]
    189 | #define zip_localtime localtime_s
        |                       ^~~~~~~~~~~
  /home/runner/work/libzip/libzip/src/ziptool.c:675:15: note: in expansion of macro ‘zip_localtime’
    675 |         tpm = zip_localtime(&sb.mtime, &tm);
        |               ^~~~~~~~~~~~~
  /home/runner/work/libzip/libzip/src/ziptool.c:675:13: error: assignment to ‘struct tm *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    675 |         tpm = zip_localtime(&sb.mtime, &tm);
        |             ^
  gmake[2]: *** [regress/CMakeFiles/ziptool_regress.dir/build.make:76: regress/CMakeFiles/ziptool_regress.dir/ziptool_regress.c.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:1484: regress/CMakeFiles/ziptool_regress.dir/all] Error 2
  gmake: *** [Makefile:146: all] Error 2
[185](https://github.com/nih-at/libzip/actions/runs/21400471581/job/61609832772#step:3:1861)

@0-wiz-0
Copy link
Member

0-wiz-0 commented Jan 27, 2026

https://docs.oracle.com/cd/E88353_01/html/E37843/localtime-s-3c.html again says that #define __STDC_WANT_LIB_EXT1__ 1 should fix this, and src/ziptool.c includes compat.h, which starts with

/* to have *_MAX definitions for all types when compiling with g++ */
 #define __STDC_LIMIT_MACROS

 /* to have ISO C secure library functions */
 #define __STDC_WANT_LIB_EXT1__ 1

Not sure yet what the problem is.

@psumbera
Copy link
Contributor Author

Sorry, for the problems! Originally it was passing. I think it would be better to allow CI builds for all pull requests.

@psumbera
Copy link
Contributor Author

I think that this resolves the issue:

diff --git a/regress/ziptool_regress.c b/regress/ziptool_regress.c
index 1cfd2921..00f3765a 100644
--- a/regress/ziptool_regress.c
+++ b/regress/ziptool_regress.c
@@ -1,3 +1,5 @@
+#include "compat.h"
+
 #include "zip.h"
 
 #include <sys/stat.h>

But overall I think that it might be better to define -D__STDC_WANT_LIB_EXT1__=1 for build (set(CMAKE_REQUIRED_DEFINITIONS "-D__STDC_WANT_LIB_EXT1__=1")) than having it in lib/compat.h.

@0-wiz-0
Copy link
Member

0-wiz-0 commented Jan 27, 2026

I've fixed the Solaris build, thanks for the pointer.

As for your other suggestion - this is already set in the CMake file

./CMakeLists.txt:list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__STDC_WANT_LIB_EXT1__=1)

so it should affect the whole build, and I'm not sure why it didn't affect ziptool_regress

@dillof
Copy link
Member

dillof commented Feb 17, 2026

The build failed repeatedly today:

Syncing source code to VM
  Installing rsync in VM...
  Exec SSH: rm -rf /home/runner/work
  /usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null solaris sh
  /usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/libzip/libzip --files-from manifest.txt --use-compress-program zstdmt
  Warning: Permanently added '[127.0.0.1]:10022' (ED25519) to the list of known hosts.
  Exec SSH: mkdir -p /home/runner/work
  /usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null solaris sh
  Warning: Permanently added '[127.0.0.1]:10022' (ED25519) to the list of known hosts.
  Syncing via Rsync
  /usr/bin/rsync -artopg --exclude _actions --exclude _PipelineMapping -e ssh /home/runner/work/ solaris:/home/runner/work/
  Warning: Permanently added '[127.0.0.1]:10022' (ED25519) to the list of known hosts.
Creating workdir symlink
  Exec SSH: ln -s /home/runner/work $HOME/work
  /usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null solaris sh
  Warning: Permanently added '[127.0.0.1]:10022' (ED25519) to the list of known hosts.
Run 'prepare' in VM
  Exec SSH: cd "$GITHUB_WORKSPACE"
  pkg install cmake zstd
  python -m venv nihtest-venv
  source nihtest-venv/bin/activate
  pip install nihtest
  /usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null solaris sh
  Warning: Permanently added '[127.0.0.1]:10022' (ED25519) to the list of known hosts.
   Startup: Refreshing catalog 'solaris' ... Done
   Startup: Caching catalogs ... Done
  Planning: Solver setup ... Done
  Planning: Running solver ... Done
  Planning: Consolidating action changes ... Done
  Planning: Evaluating mediators ... Done
  Planning: Planning completed in 4.32 seconds
  No updates necessary for this image.
Error: The process '/usr/bin/ssh' failed with exit code 4

Could you please have a look if you can see what's wrong?

@psumbera
Copy link
Contributor Author

The build failed repeatedly today:

Run 'prepare' in VM
  Exec SSH: cd "$GITHUB_WORKSPACE"
  pkg install cmake zstd
  python -m venv nihtest-venv
  source nihtest-venv/bin/activate
  pip install nihtest
  /usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null solaris sh
  Warning: Permanently added '[127.0.0.1]:10022' (ED25519) to the list of known hosts.
   Startup: Refreshing catalog 'solaris' ... Done
   Startup: Caching catalogs ... Done
  Planning: Solver setup ... Done
  Planning: Running solver ... Done
  Planning: Consolidating action changes ... Done
  Planning: Evaluating mediators ... Done
  Planning: Planning completed in 4.32 seconds
  No updates necessary for this image.
Error: The process '/usr/bin/ssh' failed with exit code 4

Could you please have a look if you can see what's wrong?

#518 should resolve this. Other option would be to reqeust exact version of the image...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments