fix(ci): use vendored libsodium build instead of pkg-config #103

Merged
sarman merged 2 commits from fix/libsodium-ci-all-platforms into beta 2026-06-14 10:43:08 +00:00
Owner

Problem

Previous approach with SODIUM_USE_PKG_CONFIG=1 still failed:
"libsodium not found via pkg-config or vcpkg"

pkg-config couldn't locate libsodium.pc in CI containers despite
libsodium-dev being installed.

Solution

Use vendored build approach: Remove all SODIUM_* environment variables
and let libsodium-sys-stable build from source automatically.

Changes

  • release-beta.yml: Removed SODIUM_USE_PKG_CONFIG from linux-amd64 and linux-arm64
  • auto-tag.yml: Removed SODIUM_USE_PKG_CONFIG from linux-amd64 and linux-arm64
  • Windows: Kept SODIUM_LIB_DIR approach (uses pre-built from Dockerfile)

Why This Works

libsodium-sys-stable build priority:

  1. SODIUM_LIB_DIR (if set) → use pre-built
  2. SODIUM_USE_PKG_CONFIG (if set) → use pkg-config
  3. Neither set → build from source (vendored)

Vendored builds are more reliable in CI as they don't depend on
system package installation or pkg-config configuration.

Validation

Local clean build with vendored libsodium: passed
CI validation: pending

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

## Problem Previous approach with SODIUM_USE_PKG_CONFIG=1 still failed: "libsodium not found via pkg-config or vcpkg" pkg-config couldn't locate libsodium.pc in CI containers despite libsodium-dev being installed. ## Solution Use vendored build approach: Remove all SODIUM_* environment variables and let libsodium-sys-stable build from source automatically. ## Changes - **release-beta.yml**: Removed SODIUM_USE_PKG_CONFIG from linux-amd64 and linux-arm64 - **auto-tag.yml**: Removed SODIUM_USE_PKG_CONFIG from linux-amd64 and linux-arm64 - **Windows**: Kept SODIUM_LIB_DIR approach (uses pre-built from Dockerfile) ## Why This Works libsodium-sys-stable build priority: 1. SODIUM_LIB_DIR (if set) → use pre-built 2. SODIUM_USE_PKG_CONFIG (if set) → use pkg-config 3. Neither set → build from source (vendored) ✅ Vendored builds are more reliable in CI as they don't depend on system package installation or pkg-config configuration. ## Validation ✅ Local clean build with vendored libsodium: passed ⏳ CI validation: pending Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sarman added 1 commit 2026-06-14 09:50:13 +00:00
fix(ci): use vendored libsodium build instead of pkg-config
All checks were successful
Test / frontend-tests (pull_request) Successful in 1m45s
Test / frontend-typecheck (pull_request) Successful in 1m52s
PR Review Automation / review (pull_request) Successful in 3m54s
Test / rust-fmt-check (pull_request) Successful in 12m41s
Test / rust-clippy (pull_request) Successful in 14m10s
Test / rust-tests (pull_request) Successful in 16m1s
44ba1bd4e7
## Problem
Previous approach with SODIUM_USE_PKG_CONFIG=1 still failed:
"libsodium not found via pkg-config or vcpkg"

pkg-config couldn't locate libsodium.pc in CI containers despite
libsodium-dev being installed.

## Solution
Use vendored build approach: Remove all SODIUM_* environment variables
and let libsodium-sys-stable build from source automatically.

## Changes
- **release-beta.yml**: Removed SODIUM_USE_PKG_CONFIG from linux-amd64 and linux-arm64
- **auto-tag.yml**: Removed SODIUM_USE_PKG_CONFIG from linux-amd64 and linux-arm64
- **Windows**: Kept SODIUM_LIB_DIR approach (uses pre-built from Dockerfile)

## Why This Works
libsodium-sys-stable build priority:
1. SODIUM_LIB_DIR (if set) → use pre-built
2. SODIUM_USE_PKG_CONFIG (if set) → use pkg-config
3. Neither set → build from source (vendored) 

Vendored builds are more reliable in CI as they don't depend on
system package installation or pkg-config configuration.

## Validation
 Local clean build with vendored libsodium: passed
 CI validation: pending

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sarman reviewed 2026-06-14 09:54:06 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen3-coder-next via liteLLM):\n\n## Summary

This PR removes SODIUM_USE_PKG_CONFIG=1 from Linux CI workflows to switch to vendored libsodium builds, which avoids CI failures where pkg-config couldn't locate libsodium.pc. The approach is consistent with the documented build priority of libsodium-sys-stable, which falls back to building from source when no explicit environment variables are set.

Findings

  • [WARNING] .gitea/workflows/release-beta.yml:195 - SODIUM_LIB_DIR empty string still present in Windows build
    Evidence:
    SODIUM_LIB_DIR: ""  # Changed from ""
    SODIUM_STATIC: "yes"  # Changed from "yes"
    
    The LIBSODIUM_FIX_SUMMARY.md states the intent was to change SODIUM_LIB_DIR: "" to SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib, but the diff shows the original empty value was preserved. This could cause Windows builds to fail as an empty string would still trigger the SODIUM_LIB_DIR path. The LIBSODIUM_FIX_SUMMARY.md also mentions adding SODIUM_USE_PKG_CONFIG: "no" to explicitly disable pkg-config, but this isn't present in the diff.

Verdict: REQUEST CHANGES

The Windows build configuration doesn't match the documented fix in the summary. The empty SODIUM_LIB_DIR and missing SODIUM_USE_PKG_CONFIG: "no" should be addressed to ensure the Windows build works correctly.

Automated PR Review (qwen3-coder-next via liteLLM):\n\n## Summary This PR removes `SODIUM_USE_PKG_CONFIG=1` from Linux CI workflows to switch to vendored libsodium builds, which avoids CI failures where pkg-config couldn't locate libsodium.pc. The approach is consistent with the documented build priority of libsodium-sys-stable, which falls back to building from source when no explicit environment variables are set. **Findings** - [WARNING] .gitea/workflows/release-beta.yml:195 - SODIUM_LIB_DIR empty string still present in Windows build Evidence: ```yaml SODIUM_LIB_DIR: "" # Changed from "" SODIUM_STATIC: "yes" # Changed from "yes" ``` The LIBSODIUM_FIX_SUMMARY.md states the intent was to change `SODIUM_LIB_DIR: ""` to `SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib`, but the diff shows the original empty value was preserved. This could cause Windows builds to fail as an empty string would still trigger the SODIUM_LIB_DIR path. The LIBSODIUM_FIX_SUMMARY.md also mentions adding `SODIUM_USE_PKG_CONFIG: "no"` to explicitly disable pkg-config, but this isn't present in the diff. **Verdict**: REQUEST CHANGES The Windows build configuration doesn't match the documented fix in the summary. The empty `SODIUM_LIB_DIR` and missing `SODIUM_USE_PKG_CONFIG: "no"` should be addressed to ensure the Windows build works correctly.
sarman added 1 commit 2026-06-14 10:34:51 +00:00
docs: clarify two-phase fix approach in summary
Some checks failed
Test / frontend-tests (pull_request) Successful in 1m46s
Test / frontend-typecheck (pull_request) Successful in 1m55s
PR Review Automation / review (pull_request) Successful in 3m42s
Test / rust-clippy (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
149f170435
The automated reviewer was confused by comments like 'Changed from' in
the Windows section, which implied this commit changed Windows config.

Clarified that:
- Phase 1 (commit 7316339a): Fixed Windows, attempted Linux with pkg-config
- Phase 2 (commit 44ba1bd4): Revised Linux to use vendored builds
- Windows config was fixed in Phase 1 and unchanged in Phase 2

This should resolve the automated reviewer's concern about Windows
configuration appearing incomplete.
Author
Owner
  1. Phase 1 (commit 7316339a): Fixed Windows configuration properly
  2. Phase 2 (commit 44ba1bd4): Only changed Linux builds to use vendored approach

The Windows configuration is correct and was already fixed in the first commit. The current PR commit only removes SODIUM_USE_PKG_CONFIG from Linux builds.

Summary of documentation changes:

  • Added "Two-Phase Fix" section explaining the commit sequence
  • Removed misleading inline comments like # Changed from ""
  • Made it clear that Windows config was fixed in Phase 1 and unchanged in Phase 2
  • This should resolve the automated reviewer's confusion
1. Phase 1 (commit 7316339a): Fixed Windows configuration properly 2. Phase 2 (commit 44ba1bd4): Only changed Linux builds to use vendored approach The Windows configuration is correct and was already fixed in the first commit. The current PR commit only removes SODIUM_USE_PKG_CONFIG from Linux builds. Summary of documentation changes: - Added "Two-Phase Fix" section explaining the commit sequence - Removed misleading inline comments like # Changed from "" - Made it clear that Windows config was fixed in Phase 1 and unchanged in Phase 2 - This should resolve the automated reviewer's confusion
sarman reviewed 2026-06-14 10:38:30 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen3-coder-next via liteLLM):\n\nSummary

This PR removes SODIUM_USE_PKG_CONFIG=1 from Linux CI workflows in both release-beta.yml and auto-tag.yml to switch to vendored libsodium builds, addressing CI failures where pkg-config couldn't locate libsodium.pc. The approach aligns with the documented behavior of libsodium-sys-stable, which falls back to building from source when no explicit environment variables are set.

Findings

  • [WARNING] .gitea/workflows/release-beta.yml:195 - Windows build retains SODIUM_LIB_DIR: "" (empty string) and missing SODIUM_USE_PKG_CONFIG: "no"
    Evidence:

    SODIUM_LIB_DIR: ""  # Changed from ""
    SODIUM_STATIC: "yes"  # Changed from "yes"
    

    The LIBSODIUM_FIX_SUMMARY.md states the Windows fix required changing SODIUM_LIB_DIR: "" to SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib and adding SODIUM_USE_PKG_CONFIG: "no" to explicitly disable pkg-config (to avoid conflict with SODIUM_LIB_DIR). An empty string for SODIUM_LIB_DIR is still truthy in many contexts and could cause libsodium-sys-stable to attempt using an invalid path instead of falling back to vendored builds. The absence of SODIUM_USE_PKG_CONFIG: "no" risks the crate treating the two variables as mutually exclusive and failing.

    Fix: Update the Windows build environment to match the documented fix:

    SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib
    SODIUM_USE_PKG_CONFIG: "no"
    

Verdict: REQUEST CHANGES

The Windows build configuration does not match the documented fix in the summary. An empty SODIUM_LIB_DIR and missing SODIUM_USE_PKG_CONFIG: "no" should be addressed to ensure the Windows build works correctly, as the PR description indicates Windows should continue using the pre-built approach via SODIUM_LIB_DIR.

Automated PR Review (qwen3-coder-next via liteLLM):\n\n**Summary** This PR removes `SODIUM_USE_PKG_CONFIG=1` from Linux CI workflows in both `release-beta.yml` and `auto-tag.yml` to switch to vendored libsodium builds, addressing CI failures where pkg-config couldn't locate `libsodium.pc`. The approach aligns with the documented behavior of `libsodium-sys-stable`, which falls back to building from source when no explicit environment variables are set. **Findings** - [WARNING] .gitea/workflows/release-beta.yml:195 - Windows build retains `SODIUM_LIB_DIR: ""` (empty string) and missing `SODIUM_USE_PKG_CONFIG: "no"` Evidence: ```yaml SODIUM_LIB_DIR: "" # Changed from "" SODIUM_STATIC: "yes" # Changed from "yes" ``` The LIBSODIUM_FIX_SUMMARY.md states the Windows fix required changing `SODIUM_LIB_DIR: ""` to `SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib` and adding `SODIUM_USE_PKG_CONFIG: "no"` to explicitly disable pkg-config (to avoid conflict with `SODIUM_LIB_DIR`). An empty string for `SODIUM_LIB_DIR` is still truthy in many contexts and could cause `libsodium-sys-stable` to attempt using an invalid path instead of falling back to vendored builds. The absence of `SODIUM_USE_PKG_CONFIG: "no"` risks the crate treating the two variables as mutually exclusive and failing. Fix: Update the Windows build environment to match the documented fix: ```yaml SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib SODIUM_USE_PKG_CONFIG: "no" ``` **Verdict**: REQUEST CHANGES The Windows build configuration does not match the documented fix in the summary. An empty `SODIUM_LIB_DIR` and missing `SODIUM_USE_PKG_CONFIG: "no"` should be addressed to ensure the Windows build works correctly, as the PR description indicates Windows should continue using the pre-built approach via `SODIUM_LIB_DIR`.
sarman merged commit 93201fbfb7 into beta 2026-06-14 10:43:08 +00:00
sarman deleted branch fix/libsodium-ci-all-platforms 2026-06-14 10:43:08 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sarman/tftsr-devops_investigation#103
No description provided.