neon-bindings / neon

Rust bindings for writing safe and fast native Node.js modules.
https://www.neon-bindings.com/
Apache License 2.0
7.98k stars 282 forks source link

cargo-cp-artifact error: "Did not copy cdylib:package" starting with rustc 1.79.0 #1049

Closed adam-coster closed 2 months ago

adam-coster commented 2 months ago

I'm using the cargo-cp-artifact package to build a simple Rust package called "pixel-checksum".

A few days ago, a daily GitHub workflow that I hadn't touched for a while started failing. My logs showed the error message Did not copy "cdylib:pixel-checksum" for the package that was trying to build. Since I hadn't changed anything, I assumed this was due to an update to the default rustc version on the GitHub runner.

I didn't get this error locally, but was on an older version of Rust (1.72.0). I updated to latest, and reproduced the error. I then confirmed that no other Rust versions reproduce this error:

I found this related issue but it doesn't seem to be applicable. I tried setting my package name to exactly match the crate name, and tried the -a parameter, as in that issue, to no avail.

Here's the project, for reference: https://github.com/bscotch/stitch/tree/develop/packages/pixel-checksum

I know very little about Rust, so I'm not 100% sure I've done my due diligence here. But it's definitely rustc-version-dependent!

I updated my workflow to include:

      # ...
      - run: rustup default 1.78.0
      # ...

Which allowed my worfklow to work as it did before.

kjvalencik commented 2 months ago

This was a breaking change in cargo (started replacing hyphens with underscores).

A fix in cargo-cp-artifact to work around the change was published in 0.1.9.

Can you try upgrading to this version and see if it resolved the issue?

antonok-edm commented 2 months ago

@kjvalencik cargo-cp-artifact 0.1.9 fixed the issue, at least for me

(thanks!)