Skip to content

fix(ci): vendor OpenSSL to fix cross-compilation in release workflow - #3

Merged
WillIsback merged 2 commits into
mainfrom
fix/release-openssl
May 12, 2026
Merged

WillIsback merged 2 commits into
mainfrom
fix/release-openssl

Conversation

@WillIsback

Copy link
Copy Markdown
Owner

Summary

  • Fixes the Build & Release job failure caused by openssl-sys not finding OpenSSL inside the cross Docker container
  • Adds OPENSSL_VENDORED=1 env var to the cross build step, which compiles OpenSSL from source and statically links it — no system library required

Root cause

reqwest defaults to the system OpenSSL on Linux. The cross container (ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main) does not include libssl-dev, so openssl-sys fails during the build with:

Could not find openssl via pkg-config
Package openssl was not found in the pkg-config search path.

Fix

- name: Build code-review-cli
  env:
    OPENSSL_VENDORED: "1"
  run: cross build --release --bin code-review-cli --target ${{ matrix.target }}

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

AI Code Review

Issues

  • Incomplete Lockfile Update: The Cargo.lock diff shows the removal of async-openai and its dependencies, but it does not show the corresponding removal of reqwest-eventsource from the code-review-cli dependencies list in the lockfile (only async-openai is removed from the dependency list). If reqwest-eventsource is still used, it must be removed from Cargo.toml as well, otherwise the lockfile is inconsistent.
  • Missing Cargo.toml Diff: The diff only shows Cargo.lock. It is critical to verify that async-openai and reqwest-eventsource are actually removed from Cargo.toml dependencies to ensure the lockfile changes are intentional and complete.

Improvements

  • Explicit Version Pinning: In Cargo.lock, thiserror is changed from thiserror 2.0.18 to just thiserror. While likely resolved to 2.0.18, explicit version pinning in lockfiles helps prevent accidental upgrades to incompatible major versions if the resolver behavior changes.
  • Gitignore Granularity: Adding target/ to .gitignore is standard, but ensure this is consistent across all team members' environments. If target/ was previously tracked, this change will cause untracked file noise until git rm -r --cached target/ is run.

Positives

  • Dependency Cleanup: Removing async-openai and its large transitive dependency tree (including reqwest-eventsource, quinn, rand variants, etc.) significantly reduces the binary size and build time.
  • CI Build Fix: Adding OPENSSL_VENDORED: "1" in the GitHub Actions workflow is a practical fix for cross-compilation issues with OpenSSL on certain targets, ensuring reproducible builds.
  • Standard Gitignore: Adding venv/, target/, .pytest_cache/, and actions-runner/ to .gitignore cleans up the repository and prevents accidental commits of build artifacts and virtual environments.

This review was generated by self-hosted AI reviewer.

@github-actions

Copy link
Copy Markdown

AI Code Review

Issues

  • Broken Dependency Graph: The diff removes async-openai and its entire dependency tree (including reqwest features like rustls and quinn, rand, tokio-stream, etc.) from Cargo.lock without corresponding changes to Cargo.toml shown. This will likely cause cargo build to fail with "package not found" or version mismatch errors unless Cargo.toml was also updated to remove these dependencies.
  • Inconsistent thiserror Versioning: The lockfile shows thiserror (v2) depending on thiserror-impl (unversioned reference), while other crates explicitly pin thiserror 2.0.18. This inconsistency can lead to resolution failures or unexpected behavior.
  • Missing Cargo.toml Context: The removal of async-openai from code-review-cli and docgen dependencies is implied by the lockfile changes but not explicitly shown in a Cargo.toml diff. If Cargo.toml wasn't updated, the build will fail.

Improvements

  • Explicit Version Pinning: Ensure thiserror dependencies in Cargo.toml explicitly specify version = "2" to avoid ambiguity between v1 and v2, which have different APIs.
  • Verify Cargo.toml Sync: Before merging, ensure Cargo.toml for code-review-cli and docgen explicitly removes async-openai and any other unused dependencies to keep the lockfile clean.
  • CI Environment Variable: The addition of OPENSSL_VENDORED: "1" is good for cross-compilation stability, but ensure the target system has the necessary build tools (like gcc or clang) installed in the GitHub Actions runner, as vendored builds can be slower and larger.

Positives

  • Cleaner Dependency Tree: Removing async-openai and its heavy transitive dependencies (like quinn, rand, tokio-stream) significantly reduces the binary size and build time, assuming the functionality is no longer needed.
  • Improved .gitignore: Adding venv/, target/, .pytest_cache/, and actions-runner/ prevents cluttering the repository with build artifacts and local environment files.
  • Build Stability: Setting OPENSSL_VENDORED=1 helps avoid issues with system OpenSSL libraries during cross-compilation, making the release process more reproducible.

This review was generated by self-hosted AI reviewer.

@WillIsback
WillIsback merged commit 18ee0b0 into main May 12, 2026
2 checks passed
@WillIsback
WillIsback deleted the fix/release-openssl branch May 13, 2026 21:55
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.

1 participant