Skip to content

Feature/32bit release targets#3

Merged
Athemis merged 6 commits intomainfrom
feature/32bit-release-targets
Dec 2, 2025
Merged

Feature/32bit release targets#3
Athemis merged 6 commits intomainfrom
feature/32bit-release-targets

Conversation

@Athemis
Copy link
Copy Markdown
Owner

@Athemis Athemis commented Dec 2, 2025

Summary

  • adds 32bit targets to release pipeline
  • currently only i686 (linux/windows) since i586 build fails (linux) or no i585 target is available (windows)

Testing

  • cargo fmt
  • cargo clippy --all-targets --all-features
  • cargo test
  • Other: CI Release Pipeline succeeds

Summary by CodeRabbit

  • Chores
    • Optimized binary compilation settings for improved performance and smaller artifact sizes.
    • Enhanced release build process with improved artifact naming and packaging for Linux and Windows distributions.
    • Added support for 32-bit build targets with additional dependency handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@Athemis
Copy link
Copy Markdown
Owner Author

Athemis commented Dec 2, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 2, 2025

Walkthrough

Engage. The release workflow has been reconfigured to implement sanitized reference naming for artifacts, introduce per-target build configurations with multilib support for 32-bit targets, and propagate PKG_CONFIG_LIBDIR variables. Additionally, the Cargo.toml release profile has been updated to employ thin LTO and symbol stripping.

Changes

Cohort / File(s) Summary
GitHub Actions Release Workflow
.github/workflows/release.yml
Added SAFE_REF sanitization step to replace slashes with dashes; introduced per-target RUSTPKG configurations and multilib handling for Linux i686 and Windows x86; propagated PKG_CONFIG_LIBDIR environment variable; added Linux 32-bit dependency installation block; removed Linux binary strip step; updated artifact naming to use elnpack-$SAFE_REF-$TARGET format for both Linux and Windows; adjusted packaging paths and upload artifact references accordingly.
Build Configuration
Cargo.toml
Modified [profile.release] settings: changed lto from boolean true to "thin" and strip from "debuginfo" to "symbols".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Attention areas: Verify SAFE_REF substitution logic handles all edge cases in ref names; confirm multilib dependencies correctly target i686-unknown-linux-gnu and Windows x86; validate artifact naming consistency across all platforms; ensure PKG_CONFIG_LIBDIR propagation does not conflict with existing environment configurations.

Poem

🚀 Make it so—the artifacts now bear their names with grace,
Thin optimization and symbols stripped for speed's embrace,
With multilib and references sanitized with care,
The release pipeline charts new course through space! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main objective of this changeset: adding 32-bit release targets to the build pipeline.
Description check ✅ Passed The pull request description follows the required template with all essential sections completed, including a clear summary, comprehensive testing checklist with all items marked complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/32bit-release-targets

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

149-149: Consistent artifact naming leverages sanitized references across platforms.

Your adoption of SAFE_REF throughout the packaging and upload stages ensures consistent, predictable artifact naming across both Linux and Windows platforms. The pattern elnpack-SAFE_REF-TARGET.{archive-type} provides clear provenance information—the branch or tag, the architecture target, and the format—all derived from your sanitized reference.

The implementation correctly adapts to each environment: bash string interpolation for Linux, PowerShell variable for Windows. This maintains semantic consistency despite platform differences.

One minor observation: the Windows step creates $safeRef (camelCase) from env:SAFE_REF (UPPERCASE), while the Linux step uses $SAFE_REF directly. Both are functionally correct, but consider standardizing variable naming conventions across shell contexts for future maintainability.

For enhanced readability and consistency, consider using a uniform variable naming convention across both bash and PowerShell contexts. For example, always use SAFE_REF in capitals:

- $safeRef = $env:SAFE_REF
- Compress-Archive -Path "$pkgDir/*" -DestinationPath "elnpack-$safeRef-${env:TARGET}.zip"
+ Compress-Archive -Path "$pkgDir/*" -DestinationPath "elnpack-$($env:SAFE_REF)-${env:TARGET}.zip"

This eliminates the intermediate variable and maintains consistent naming patterns.

Also applies to: 161-161, 166-166, 168-168

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3680556 and 29151c5.

📒 Files selected for processing (2)
  • .github/workflows/release.yml (4 hunks)
  • Cargo.toml (1 hunks)
🔇 Additional comments (3)
.github/workflows/release.yml (3)

96-98: Well-structured reference sanitization for artifact naming.

Your SAFE_REF derivation elegantly transforms git reference names into filesystem-safe identifiers by replacing all forward slashes with dashes. This approach prevents problematic characters in artifact filenames and protects against path traversal vulnerabilities. The bash parameter expansion is idiomatic and correctly persists the value to the workflow environment.


73-86: Thoughtful expansion to 32-bit targets with appropriate per-target configuration.

Your matrix configuration introduces i686 targets for both Linux and Windows with sensible per-target settings. The pkg_config_libdir path for i686-unknown-linux-gnu points to /usr/lib/i386-linux-gnu/pkgconfig, which aligns with standard Ubuntu/Debian multilib conventions. The multilib flag is correctly set for the Linux target and disabled for the Windows target, reflecting platform-specific requirements.

The addition of these entries maintains consistency with the existing x86_64 configuration while introducing the necessary variations for 32-bit compilation.

Please verify that the pkg_config_libdir path /usr/lib/i386-linux-gnu/pkgconfig exists in your typical build environment. Additionally, confirm that the i686 target is registered with the Rust toolchain before the cargo build command executes.


116-125: Comprehensive and properly sequenced 32-bit dependency installation.

Your installation sequence demonstrates proper understanding of multilib requirements. The dpkg architecture addition precedes the package manager update, which in turn precedes the dependency installation—a logical progression that ensures the system recognizes i386 packages before attempting installation. The multilib compiler suite (gcc-multilib, g++-multilib) combined with the comprehensive set of i386-suffixed development libraries provides a solid foundation for 32-bit compilation.

The conditional execution restricts this specialized installation to the i686 Linux target, avoiding unnecessary operations on Windows and x86_64 runners.

Confirm that the library set (libx11-dev:i386, libgl1-mesa-dev:i386, etc.) covers all dependencies required by elnpack for 32-bit builds. If your application uses additional specialized libraries, ensure they have corresponding i386 variants in the Ubuntu repositories.

Comment on lines 32 to +35
[profile.release]
lto = true
lto = "thin"
panic = "abort"
strip = "debuginfo"
strip = "symbols"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Rust Cargo profile.release lto "thin" string syntax stable version

💡 Result:

Yes — Cargo accepts the string form lto = "thin" in [profile.*] on stable Rust. The Cargo reference lists "thin" as a valid lto value (alongside true/"fat", false, and "off"). [1][2]

Example:
[profile.release]
lto = "thin"

Sources:
[1] Cargo Book — Profiles (official reference).
[2] Rust/Cargo docs showing LTO enum/values.


🌐 Web query:

Rust Cargo profile strip "symbols" setting stable version

💡 Result:

The Cargo profile strip option (so you can use values like "symbols") was stabilized in Rust 1.59.0. [1][2]

Sources:

  • Cargo documentation (unstable/features listing showing stabilization in 1.59). [1]
  • Rust 1.59.0 changelog (Cargo: "Stabilize the strip profile option"). [2]

Optimize release profile with thin LTO and symbol stripping—verify toolchain version.

The changes employ thin LTO and full symbol stripping, which represent a sensible tradeoff: reduced build time and smaller binaries at the cost of diminished post-mortem debuggability. Both lto = "thin" and strip = "symbols" are stable Rust features, though they require a sufficiently recent toolchain. Ensure your Rust version is 1.59 or later to support these profile settings.

Consider whether the transition from strip = "debuginfo" to strip = "symbols" aligns with your production support posture. Full symbol stripping will complicate crash analysis and customer support scenarios.

🤖 Prompt for AI Agents
In Cargo.toml around lines 32-35, the release profile enables thin LTO and full
symbol stripping but may require Rust toolchain >= 1.59 and could hinder
post-mortem debugging; verify the CI/build toolchain version and update it to >=
1.59 (or the minimum Rust version that supports lto="thin" and strip="symbols"),
and if you need to retain some debuginfo for production support change strip
back to "debuginfo" (or document the decision) to balance binary size vs.
supportability.

@Athemis Athemis merged commit 686fc31 into main Dec 2, 2025
4 checks passed
@Athemis Athemis deleted the feature/32bit-release-targets branch December 4, 2025 20:57
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