Socket
Socket
Sign inDemoInstall

cargo-cp-artifact

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cargo-cp-artifact - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

4

package.json
{
"name": "cargo-cp-artifact",
"version": "0.1.8",
"version": "0.1.9",
"description": "Copies compiler artifacts emitted by rustc by parsing Cargo metadata",

@@ -32,4 +32,4 @@ "main": "src/index.js",

"devDependencies": {
"mocha": "^10.0.0"
"mocha": "^10.2.0"
}
}

@@ -82,3 +82,3 @@ # cargo-cp-artifact

It surprisingly difficult to reliably find the location of a cargo compiler artifact. It is impacted by many parameters, including:
It's surprisingly difficult to reliably find the location of a cargo compiler artifact. It is impacted by many parameters, including:

@@ -85,0 +85,0 @@ * Build profile

@@ -9,3 +9,3 @@ "use strict";

[
"cargo-cp-artifct -a cdylib my-crate index.node",
"cargo-cp-artifact -a cdylib my-crate index.node",
"--",

@@ -12,0 +12,0 @@ "cargo build --message-format=json-render-diagnostics",

@@ -83,4 +83,4 @@ "use strict";

const filename = filenames[i];
const key = getArtifactName({ artifactType: kind, crateName: name });
const outputFiles = options.artifacts[key];
const { key, outputFiles } =
getOutputFiles(kind, name, options.artifacts) || {};

@@ -104,2 +104,20 @@ if (!outputFiles || !filename) {

function getOutputFiles(kind, name, artifacts) {
const key = getArtifactName({ artifactType: kind, crateName: name });
const outputFiles = artifacts[key];
if (outputFiles) {
return { key, outputFiles };
}
// Cargo started replacing `-` with `_` in artifact names. Reverse the process
// and check again. https://github.com/rust-lang/cargo/issues/13867
const altKey = key.replace(/_/g, "-");
return {
key: altKey,
outputFiles: artifacts[altKey],
};
}
async function isNewer(filename, outputFile) {

@@ -106,0 +124,0 @@ try {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc