Skip to content

fix(nix): expose libstdc++ during completion install#337

Merged
jamesbrink merged 2 commits into
mainfrom
fix/issue-336-postinstall-completion-gen
Jun 20, 2026
Merged

fix(nix): expose libstdc++ during completion install#337
jamesbrink merged 2 commits into
mainfrom
fix/issue-336-postinstall-completion-gen

Conversation

@jamesbrink

Copy link
Copy Markdown
Member

Summary

  • add a Linux-only preInstall hook to expose stdenv.cc.cc.lib on LD_LIBRARY_PATH
  • keeps the CUDA-free cargoWithProfile run ... completions helper runnable before Nix fixup patches runtime paths
  • document the Nix sandbox completion-generation fix in the changelog

Closes #336.

Validation

  • nix fmt
  • nix eval --raw .#packages.x86_64-linux.mold.preInstall
  • nix build .#packages.x86_64-linux.mold --dry-run
  • git diff --check
  • nix flake check --all-systems --no-build
  • codex review --uncommitted (no findings)

Copilot AI review requested due to automatic review settings June 20, 2026 02:34

@greptile-apps greptile-apps Bot 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

Pull request overview

This PR fixes a Nix sandbox build failure on Linux where shell completion generation in postInstall runs the freshly built (CUDA-free) target/release/mold before Nix fixup has patched runtime paths, causing a dynamic loader error for libstdc++.so.6.

Changes:

  • Add a Linux-only preInstall hook to export stdenv.cc.cc.lib onto LD_LIBRARY_PATH so completion generation can execute in sandboxed builders.
  • Document the Nix sandbox completion-generation fix in the changelog (issue #336).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
flake.nix Adds Linux-only preInstall that prepends stdenv.cc.cc.lib to LD_LIBRARY_PATH so postInstall completion generation can run in Nix sandbox.
CHANGELOG.md Records the Linux Nix sandbox completion-generation fix and links to #336.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.91%. Comparing base (955943d) to head (da29b18).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
- Coverage   66.91%   66.91%   -0.01%     
==========================================
  Files         254      254              
  Lines      142741   142741              
==========================================
- Hits        95519    95518       -1     
- Misses      47222    47223       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jamesbrink jamesbrink merged commit cf58e95 into main Jun 20, 2026
5 checks passed
@jamesbrink jamesbrink deleted the fix/issue-336-postinstall-completion-gen branch June 20, 2026 02:49
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.

postInstall completion gen fails in sandbox: cargo-run'd target/release/mold can't load libstdc++.so.6 (ee8afea1 only fixed checkPhase)

2 participants