Skip to content

Fail the macOS build when the D runtime lookup fails - #2

Merged
kabiroberai merged 1 commit into
xtool-org:mainfrom
ap-1:fail-on-runtime-lookup-error
Oct 1, 2026
Merged

kabiroberai merged 1 commit into
xtool-org:mainfrom
ap-1:fail-on-runtime-lookup-error

Conversation

@ap-1

@ap-1 ap-1 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

If find_runtime_libraries can't find phobos/druntime it prints an error and exits 1, but since it's called inside $(...) as an argument to libtool, set -e doesn't catch it.

Instead, the build keeps going and you end up with a libxadibase.a that doesn't have the D runtime in it, which only shows up later as undefined symbol errors when linking. We can assign it to a variable first to make the build stop there instead.

I ran into this packaging xadi for nixpkgs, where the lookup failed and the build still succeeded.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a macOS build issue where a failed runtime library lookup could allow linking to continue with missing libraries.

Signed-off-by: Anish Pallati <i@anish.land>
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1dcfdf00-0f18-4a82-badc-e466113e6d66

📥 Commits

Reviewing files that changed from the base of the PR and between 5b1b490 and 17e9966.

📒 Files selected for processing (1)
  • macOS/build.sh

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The macOS build script now resolves runtime libraries before calling libtool. If the lookup fails, set -e stops the script at the assignment.

Changes

Runtime library build

Layer / File(s) Summary
Resolve runtime libraries
macOS/build.sh
build_arch captures the runtime-library paths before invoking libtool and passes them to the archive command. With set -e, a failed lookup stops the script at the assignment.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 17e99

The runtime lookup now occurs before archive creation, and callers do not suppress failure handling.

Architecture Summary

Architecture risk: 🔵 Low · up to 17e99

The change affects 1 system.

Changed systems: macOS

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — macOS (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in macOS/build.sh: build_arch adds a local runtime_libraries variable for the resolved runtime-library paths.
  • observed — Modified behavior in macOS/build.sh: build_arch now resolves runtime libraries before calling libtool and supplies the captured paths to the archive command. A failed lookup now terminates the script at the assignment under set -e; previously the lookup ran inside libtool’s arguments.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: making the macOS build fail when the D runtime lookup fails.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@kabiroberai kabiroberai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@kabiroberai
kabiroberai merged commit fed7f64 into xtool-org:main Oct 1, 2026
4 checks passed
@ap-1
ap-1 deleted the fail-on-runtime-lookup-error branch October 1, 2026 05:23
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.

2 participants