Skip to content

fix(publish-crate): scope package-name sed to [package] section only#18

Merged
VrilLabs merged 2 commits into
mainfrom
copilot/fix-publish-helios-to-crates-io-another-one
Jul 2, 2026
Merged

fix(publish-crate): scope package-name sed to [package] section only#18
VrilLabs merged 2 commits into
mainfrom
copilot/fix-publish-helios-to-crates-io-another-one

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The "Normalize crate package name" step used a global sed substitution that matched name = "helios" anywhere in rs/helios/Cargo.toml. Since the [package] name is already vrillabs-helios, the only remaining match was the [lib] target name — corrupting it to vrillabs-helios, which Cargo rejects: library target names cannot contain hyphens (cargo-targets reference).

Change

Scope the substitution to the [package] TOML section via a sed address range:

- sed -i 's/^name = "helios"$/name = "vrillabs-helios"/' rs/helios/Cargo.toml
+ sed -i '/^\[package\]/,/^\[/{s/^name = "helios"$/name = "vrillabs-helios"/}' rs/helios/Cargo.toml

The range /^\[package\]/,/^\[/ limits the substitution to lines between the [package] header and the next section header, leaving [lib] name = "helios" (a valid Rust identifier) untouched. The step remains a no-op for current tags and still correctly patches old tags where the package was named helios before the crates.io rename.

The global sed substitution in the "Normalize crate package name" step
was replacing every `name = "helios"` line in rs/helios/Cargo.toml,
including the [lib] target name. Since the [package] name is already
`vrillabs-helios`, the only line still matching was `[lib] name =
"helios"`, which was wrongly renamed to `vrillabs-helios`.

Per the official Cargo reference (cargo-targets.html):
  "library target names cannot contain hyphens"

Cargo rejects the mangled manifest with that error, causing cargo
set-version / cargo metadata to fail.

Fix: use a sed address range (/^\[package\]/,/^\[/) to restrict the
substitution to the [package] section, leaving the [lib] name (a valid
Rust identifier) untouched.
Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'Publish helios to crates.io' fix(publish-crate): scope package-name sed to [package] section only Jul 2, 2026
Copilot AI requested a review from VrilLabs July 2, 2026 11:09
@VrilLabs VrilLabs marked this pull request as ready for review July 2, 2026 11:10
Copilot AI review requested due to automatic review settings July 2, 2026 11:10
@VrilLabs VrilLabs merged commit 8f47241 into main Jul 2, 2026
2 checks passed

Copilot AI left a comment

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

3 participants