Skip to content

Fix NIF compilation issues#74

Merged
ocean merged 8 commits intomainfrom
dev
Feb 2, 2026
Merged

Fix NIF compilation issues#74
ocean merged 8 commits intomainfrom
dev

Conversation

@ocean
Copy link
Owner

@ocean ocean commented Feb 2, 2026

Summary by CodeRabbit

  • Chores

    • Added a test-only release mode to validate releases without publishing.
    • Kept automatic version extraction and tag-vs-project version validation to prevent mismatched releases.
    • Adjusted publish gating so artifacts are published only on tagged releases when not in test mode.
    • Added cross-build configuration to pass through required build-time environment settings.
  • Refactor

    • Refined cross-build matrix and target selections, and simplified cross-tool usage flags for more reliable cross-platform builds and publishing.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Walkthrough

Adds a test_only workflow_dispatch input and reworks the release build matrix and cross-build flags; removes CARGO_BUILD_TARGET, sets project-dir: ".", and gates publishing to tag pushes when inputs.test_only != 'true'. Adds Cross.toml to passthrough RUSTLER_NIF_VERSION.

Changes

Cohort / File(s) Summary
Release workflow
.github/workflows/release.yml
Adds test_only workflow_dispatch input; updates job matrix (removes intel macos entry, keeps macos-15, replaces/aadds cross-enabled Linux entries and a native x86_64 linux entry); replaces CARGO_BUILD_TARGET usage; changes use-cross to `matrix.job.use-cross && 'true'
Cross config
Cross.toml
Adds Cross.toml with [build.env] passthrough = ["RUSTLER_NIF_VERSION"] and header comments referencing precompilation guidance.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Developer
    participant GitHub as "GitHub Actions"
    participant Workflow as ".github/workflows/release.yml"
    participant Repo as "Repository (mix.exs)"
    participant Builder as "Build action / cross"
    participant Storage as "Artifact Upload / Release"

    Developer->>GitHub: push / create tag or manual dispatch (with inputs.test_only)
    GitHub->>Workflow: trigger release workflow
    Workflow->>Repo: read mix.exs to extract PROJECT_VERSION
    Repo-->>Workflow: return PROJECT_VERSION
    Workflow->>Workflow: determine run type (tag vs branch) and inputs.test_only
    Workflow->>Builder: execute matrixed builds (use-cross flag set per matrix, project-dir=".")
    Builder-->>Storage: upload build artifacts
    alt tag present AND versions match AND inputs.test_only != 'true'
        Workflow->>GitHub: publish release from artifacts
    else mismatch OR inputs.test_only == 'true'
        Workflow-->>GitHub: skip publish
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Feature rustler precompiled #71 — Edits the same release.yml workflow and cross-build configuration (matrix, use-cross handling, project-dir, and publish gating).

Poem

🐇 I nibble bytes and chase the tag,

I toggle test_only — hop or lag.
Cross compiles sing across each night,
Versions checked, artifacts take flight.
A rabbit claps for CI's bright light 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix NIF compilation issues' directly addresses the main changes in the PR, which involve reworking the release workflow for proper NIF (Native Interface File) compilation across multiple platforms and adding Cross.toml configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ocean ocean changed the title Dev Fix NIF compilation issues Feb 2, 2026
Copy link
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: 2

🤖 Fix all issues with AI agents
In @.github/workflows/release.yml:
- Line 100: The current if condition uses "inputs.test_only == 'false'", which
fails for tag pushes because inputs.test_only is empty; update the condition to
check that test_only is not the literal 'true' instead (e.g., replace
"inputs.test_only == 'false'" with "inputs.test_only != 'true'") while keeping
the startsWith(github.ref, 'refs/tags/') check, so tag pushes (empty input) and
workflow_dispatch with test_only='false' both allow publishing but
workflow_dispatch with test_only='true' will skip publishing.
- Around line 30-31: The macOS x86_64 runner entry ("target:
x86_64-apple-darwin, os: macos-15, use-target: false") is incorrect because
macos-15 is arm64; either change the os value to the intel-specific runner
(e.g., "os: macos-15-intel") for the x86_64 entry or set "use-target: true" and
keep the explicit target, ensuring the pair "target: x86_64-apple-darwin" and
"use-target" are consistent; update the line with "target: x86_64-apple-darwin,
os: macos-15, use-target: false" accordingly.

@ocean ocean merged commit 2ed41d8 into main Feb 2, 2026
14 checks passed
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