fix(windows): add memset_explicit symbol export for mingw cross-compilation #118
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sarman/tftsr-devops_investigation#118
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/cargo-config-sodium"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Automated PR Review (qwen3.5-122b-think via liteLLM):\n\n
Summary
This PR addresses a Windows MinGW cross-compilation issue by adding a
memset_explicitshim library. The changes compile a C static library and link it explicitly when targeting Windows GNU. The implementation is straightforward and addresses the stated problem of undefined references during MinGW builds.Findings
[SUGGESTION] src-tauri/build.rs:14 -
__declspec(dllexport)is unnecessary for static librariesEvidence:
#define EXPORT __declspec(dllexport)in memset_s_shim.cFix: Remove the
EXPORTmacro usage or use it conditionally only for DLL builds. For static libraries on Windows, symbols are exported by default without this directive. This is not a functional bug but follows best practices.[SUGGESTION] src-tauri/build.rs:11 - Build script could benefit from error handling
Evidence:
cc::Build::new().file("memset_s_shim.c").compile("memset_shim");has no error handlingFix: Consider adding
.compile("memset_shim")return value checking or lettingcccrate handle errors (current behavior is acceptable asccwill panic on failure anyway).Verdict: APPROVE WITH COMMENTS
The code will compile and function correctly. The
__declspec(dllexport)on a static library is harmless but unnecessary - it's commonly ignored by linkers for static libs. The fix addresses the core issue of missingmemset_explicitsymbol for libsodium-sys-stable on MinGW targets. The changes are minimal and targeted appropriately.