Skip to content

insert date into cgo files to invalidate cache - #60

Open
sebastian-carpenter wants to merge 1 commit into
wolfSSL:masterfrom
sebastian-carpenter:invalidate-cache
Open

insert date into cgo files to invalidate cache#60
sebastian-carpenter wants to merge 1 commit into
wolfSSL:masterfrom
sebastian-carpenter:invalidate-cache

Conversation

@sebastian-carpenter

Copy link
Copy Markdown
Contributor

Modifying the underlying install of wolfssl may silently invalidate the binary go has cached for go-wolfssl.

For every package insert the date of options generation to help invalidate this cache. Updated README.md to reflect the new expectation of running generateOptions.sh with each modification of the wolfssl install.

@sebastian-carpenter sebastian-carpenter self-assigned this Sep 4, 2026
Copilot AI lite review requested due to automatic review settings September 4, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

README contains an invalid command placeholder and the generator uses a locale-dependent date string that can cause inconsistent generated output.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds an “options generation date” marker to cgo-bearing files and updates generateOptions.sh/README guidance so regenerating options can reliably invalidate Go’s build cache when the underlying wolfSSL install changes.

Changes:

  • Add an // Options generation date: marker to the per-package cgo directive carriers.
  • Update generateOptions.sh to write/update the date marker during option generation.
  • Update README instructions to reflect the expectation of rerunning generateOptions.sh when the wolfSSL install is modified.
File summaries
File Description
wolfx509/certgen_wolfcrypt.go Adds options-generation date marker for wolfx509’s cgo directive carrier
wolftls/conn.go Adds options-generation date marker for wolftls’ cgo directive carrier
aes.go Adds options-generation date marker for wolfSSL package cgo directive carrier
examples/client/client-psk.go Adds options-generation date marker to help invalidate cache for example build
examples/server/server-psk.go Adds options-generation date marker to help invalidate cache for example build
generateOptions.sh Writes the generation date into options.go and rewrites date markers across cgo files
README.md Updates documentation to explain regeneration expectations and cache invalidation behavior
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread generateOptions.sh
Comment thread README.md
@lealem47

lealem47 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Thoughts on this approach?

  DATE="$(date -u +%Y%m%dT%H%M%SZ)"      # space-free, so it's a valid -D argument                                                                                    

  sed -i.bak \
      -e "s|^// #cgo CFLAGS:.*|// #cgo CFLAGS: -g -Wall -I$PREFIX/include -DGOWOLFSSL_STAMP=$DATE|" \                                                                 
      -e "s|^// #cgo LDFLAGS:.*|// #cgo LDFLAGS: -L$PREFIX/lib -lwolfssl -lm|" \
      $CGO_FILES
``

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