Skip to content

CI: Use autoconf cache and NIT certificate cache#3109

Open
jimklimov wants to merge 53 commits intonetworkupstools:masterfrom
jimklimov:use-autoconf-cache
Open

CI: Use autoconf cache and NIT certificate cache#3109
jimklimov wants to merge 53 commits intonetworkupstools:masterfrom
jimklimov:use-autoconf-cache

Conversation

@jimklimov
Copy link
Copy Markdown
Member

@jimklimov jimklimov commented Oct 2, 2025

Closes issue #3108
Closes issue #3390

Updated code boasts also change detection (based on a hash of uname -a, configure.ac and m4/*.m4 sources, and configure script options including the compiler names) and optional storage of the caches outside of the build directory.

This way, builds for unchanged conditions use their individual cached discoveries stored in separate directories. This should allow one build system to handle numerous configurations (like the USB/SSL/... matrix in ci_build.sh) and even platforms (autogen once, build out-of-tree) with many workers using the shared storage. This also handles a separate config.cache for each make distcheck* goal.

Currently this does not handle clean-up of the cache, other than hits to the same one (or an in-tree config.cache file). Overheads are about 40Kb on systems tested so far.

Also currently relies on presence of md5sum to make some hash, but that is easily extensible if needed on systems that lack it but have anything equivalent (cksum, sha*sum, openssl digest, etc.) - see NDE for ideas if it comes to that.

  • UPDATE: macos did not have md5sum by that name, scripts refactored

Similar logic and config applied to NIT certificates, for them to be re-used (generation of crypto material does take its toll, especially on congested hypervisors and weak SBCs). Also in this mode, if nit.sh does generate certs in a sufficiently capable operating environment, it would try to populate both OpenSSL and NSS stores, and optionally JKS (for jNut) if it can.

@jimklimov jimklimov added this to the 2.8.5 milestone Oct 2, 2025
@jimklimov jimklimov added enhancement Windows CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) macOS labels Oct 2, 2025
@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Oct 2, 2025

https://ci.appveyor.com/project/nut-travis/nut/builds/52845240#L2573

C:\projects\nut\tools\nut-scanner/nut-scanner.c:479:(.text+0x218): undefined reference to GetAdaptersAddresses'`

Need to take care about variables like NETLIBS_GETADDRS that are optionally set when we try to get methods compiled: upon a re-run, the initial value is set to empty, in anticipation of the diligent testing (which never happens because cached result is that the method is available).

Probably a lot of other similar LIBS and other variables we pre-set as "" and build upwards as part of feature support detection would need similar massaging.

@jimklimov jimklimov marked this pull request as draft October 2, 2025 18:32
@AppVeyorBot
Copy link
Copy Markdown

@jimklimov jimklimov added the needs-work PR discussion concluded that some work is needed from the contributor label Oct 8, 2025
@jimklimov jimklimov modified the milestones: 2.8.5, 2.8.6 Nov 9, 2025
… options to USE_AUTOCONF_CACHE and/or CLEAN_AUTOCONF_CACHE [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ACHE:yes and carry over the config.cache between builds [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…TOCONF_CACHE:yes and carry over the config.cache between builds [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…OCONF_CACHE=no [networkupstools#3108]

Callers like specific CI recipes should be free to enable certain behaviors though.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… we want/do use it [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…n dev-test builds [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…DDRS usage

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…k` for less noise

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ig opts" hash [networkupstools#3108]

Now even several build environments sharing a source directory
with a generated configure script should be able to safely use
their individual caches.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the use-autoconf-cache branch from 5585671 to ca06004 Compare April 23, 2026 14:52
@jimklimov jimklimov marked this pull request as ready for review April 23, 2026 14:53
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

A ZIP file with standard source tarball and another tarball with pre-built docs for commit 58f1bd2 is temporarily available: NUT-tarballs-PR-3109.zip.

…or config.cache [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…der runs moved to NUT v2.8.6 [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the use-autoconf-cache branch from 0fcd331 to da1b198 Compare April 23, 2026 15:25
…SHDIR into Windows builds if we want to and can [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the use-autoconf-cache branch from da1b198 to 677092d Compare April 23, 2026 15:27
…oggle, like in ci_build.sh

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the use-autoconf-cache branch from 80d67d7 to b64e5fe Compare April 25, 2026 21:19
@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

jimklimov and others added 7 commits April 26, 2026 18:32
…sh a copy of first-run config.log and config.h as examples of resulting configuration [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…igure_nut(): stash a copy of first-run config.log and config.h as examples of resulting configuration [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…lds to not lose track [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…somehash_files() method detection [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
…er()/somehash_files() method detection [networkupstools#3390]

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
…ebang via /usr/bin/env [networkupstools#1711]

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

…#3390]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…) with forward slashes too [networkupstools#1711]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…) yet some more [networkupstools#1711]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ry, to not lose track [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@AppVeyorBot
Copy link
Copy Markdown

Build nut 2.8.5.4636-master completed (commit bc0cf01319 by @jimklimov)

@AppVeyorBot
Copy link
Copy Markdown

Build nut 2.8.5.4637-master completed (commit 2edff0fc56 by @jimklimov)

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…stash optional items not needed in production use of the cache, but rather to track its regressions on re-runs etc. [networkupstools#3108]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the use-autoconf-cache branch from 5791fc2 to 69059b4 Compare April 27, 2026 09:25
@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

Build nut 2.8.5.4639-master completed (commit a6efd9e1d1 by @jimklimov)

@AppVeyorBot
Copy link
Copy Markdown

…of all expected certs for NSS or OpenSSL scenarios [networkupstools#3390]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) enhancement macOS SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants