Commit c588edaf authored by Lily Foster's avatar Lily Foster Committed by tomf
Browse files

prefetch-npm-deps: remove runtime dependency on nix

parent 5b0e4242
Loading
Loading
Loading
Loading
+317 −182

File changed.

Preview size limit exceeded, changes collapsed.

+11 −10
Original line number Diff line number Diff line
@@ -6,18 +6,19 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.75"
anyhow = "1.0.82"
backoff = "0.4.0"
base64 = "0.21.5"
base64 = "0.22.0"
digest = "0.10.7"
env_logger = "0.10.1"
env_logger = "0.11.3"
isahc = { version = "1.7.2", default_features = false }
log = "0.4.20"
rayon = "1.8.0"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
log = "0.4.21"
nix-nar = "0.3.0"
rayon = "1.10.0"
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
sha1 = "0.10.6"
sha2 = "0.10.8"
tempfile = "3.8.1"
url = { version = "2.4.1", features = ["serde"] }
walkdir = "2.4.0"
tempfile = "3.10.1"
url = { version = "2.5.0", features = ["serde"] }
walkdir = "2.5.0"
+2 −2
Original line number Diff line number Diff line
{ lib, stdenvNoCC, rustPlatform, makeWrapper, pkg-config, curl, gnutar, gzip, nix, testers, fetchurl, cacert, prefetch-npm-deps, fetchNpmDeps }:
{ lib, stdenvNoCC, rustPlatform, makeWrapper, pkg-config, curl, gnutar, gzip, testers, fetchurl, cacert, prefetch-npm-deps, fetchNpmDeps }:

{
  prefetch-npm-deps = rustPlatform.buildRustPackage {
@@ -20,7 +20,7 @@
    buildInputs = [ curl ];

    postInstall = ''
      wrapProgram "$out/bin/prefetch-npm-deps" --prefix PATH : ${lib.makeBinPath [ gnutar gzip nix ]}
      wrapProgram "$out/bin/prefetch-npm-deps" --prefix PATH : ${lib.makeBinPath [ gnutar gzip ]}
    '';

    passthru.tests =
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use std::{
};
use url::Url;

#[allow(clippy::struct_field_names)]
#[derive(Serialize, Deserialize)]
pub(super) struct Key {
    pub(super) key: String,
+2 −5
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ use std::{
    collections::HashMap,
    env, fs,
    path::{Path, PathBuf},
    process::{self, Command},
    process,
};
use tempfile::tempdir;
use url::Url;
@@ -266,10 +266,7 @@ fn main() -> anyhow::Result<()> {
    fs::write(out.join("package-lock.json"), lock_content)?;

    if print_hash {
        Command::new("nix")
            .args(["--experimental-features", "nix-command", "hash", "path"])
            .arg(out.as_os_str())
            .status()?;
        println!("{}", util::make_sri_hash(out)?);
    }

    Ok(())
Loading