[PR #11] [MERGED] fix(native): edit a crlf cargo.lock instead of refusing it #16

Closed
opened 2026-11-02 15:32:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mixins/pull/11
Author: @reservedbytes
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: fix/crlf-cargo-lock


📝 Commits (1)

  • f780789 fix(native): edit a crlf cargo.lock instead of refusing it

📊 Changes

2 files changed (+27 additions, -0 deletions)

View changed files

📝 crates/horizon-mixins-cli/tests/cases/native.rs (+23 -0)
📝 crates/horizon-mixins-core/src/native.rs (+4 -0)

📄 Description

What and why

On Windows, Git checks Horizon out with CRLF by default (core.autocrlf), and Horizon's .gitattributes doesn't pin Cargo.lock to LF

Cargo is fine with that, but any bundle with a [[crate]] fails with E_CRATE: the dependent has no workspace entry in Cargo.lock

edit_lock splits the lock on "\n\n" and matches lines ending in ", so with \r\n it finds nothing.
#4 doesn't cover this... it only sets LF for horizon-mixins' own checkout, not the workspace it stages

edit_lock now edits an LF copy and gives the lock its CRLF back

Checks

cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked (92 passed, new test a_crlf_checkout_stages_and_builds, which fails without the fix)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon-mixins/pull/11 **Author:** [@reservedbytes](https://github.com/reservedbytes) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/crlf-cargo-lock` --- ### 📝 Commits (1) - [`f780789`](https://github.com/horizon-rust/horizon-mixins/commit/f780789d1ca535988f18696c1d3e3e5d7fac29e3) fix(native): edit a crlf cargo.lock instead of refusing it ### 📊 Changes **2 files changed** (+27 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-mixins-cli/tests/cases/native.rs` (+23 -0) 📝 `crates/horizon-mixins-core/src/native.rs` (+4 -0) </details> ### 📄 Description ## What and why On Windows, Git checks Horizon out with CRLF by default (`core.autocrlf`), and Horizon's `.gitattributes` doesn't pin `Cargo.lock` to LF Cargo is fine with that, but any bundle with a `[[crate]]` fails with `E_CRATE: the dependent has no workspace entry in Cargo.lock` `edit_lock` splits the lock on `"\n\n"` and matches lines ending in `"`, so with `\r\n` it finds nothing. #4 doesn't cover this... it only sets LF for horizon-mixins' own checkout, not the workspace it stages `edit_lock` now edits an LF copy and gives the lock its CRLF back ## Checks `cargo fmt --all --check` `cargo clippy --workspace --all-targets --locked -- -D warnings` `cargo test --workspace --locked` (92 passed, new test `a_crlf_checkout_stages_and_builds`, which fails without the fix) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:32:32 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon-mixins#16
No description provided.