Skip to content

Commit

Permalink
- Fix critical bug with downloading tarballs from arbitrary HTTP URLs
Browse files Browse the repository at this point in the history
- Bootstrap against Node.js 6
- Update versions of dependencies
  • Loading branch information
svanderburg committed Aug 16, 2017
1 parent 1ae1e9c commit f1f1692
Show file tree
Hide file tree
Showing 10 changed files with 527 additions and 728 deletions.
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# $ nix-shell -A shell

node bin/node2nix -e nix/node-env.nix --no-copy-node-env
node bin/node2nix -e nix/node-env.nix -6 --no-copy-node-env
cd tests
node ../bin/node2nix -i tests.json -o node-packages-v4.nix -c default-v4.nix -e ../nix/node-env.nix --no-copy-node-env
node ../bin/node2nix -i tests.json -o node-packages-v6.nix -c default-v6.nix -e ../nix/node-env.nix -6 --no-copy-node-env
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-4_x"}:
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-6_x"}:

let
nodeEnv = import ./nix/node-env.nix {
Expand Down
4 changes: 4 additions & 0 deletions lib/packagefetcher/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ function fetchMetaDataFromHTTP(baseDir, dependencyName, versionSpec, callback) {
finish();
}
});
} else {
// For other files, simply skip them. We need these dummy callbacks because there is some kind of quirk in the API that terminates the program.
entry.on("data", function() {});
entry.on("end", function() {});
}
});

Expand Down
4 changes: 2 additions & 2 deletions lib/packagefetcher/npmregistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function fetchMetaDataFromNPMRegistry(baseDir, dependencyName, versionSpec, regi
}
});
} else {
paramExpr.sha1 = packageObj.dist.shasum; // SHA1 hashes are in hexadecimal notation which we can just adopt
paramExpr.sha1 = packageObj.dist.shasum; // SHA1 hashes are in hexadecimal notation which we can just adopt verbatim
callback();
}
},
Expand All @@ -129,7 +129,7 @@ function fetchMetaDataFromNPMRegistry(baseDir, dependencyName, versionSpec, regi
packageObj: packageObj,
identifier: dependencyName + "-" + packageObj.version,
src: new nijs.NixFunInvocation({
funExpr: new nijs.NixExpression("fetchurl"),
funExpr: new nijs.NixExpression("fetchurl"),
paramExpr: paramExpr
}),
baseDir: path.join(baseDir, dependencyName)
Expand Down
Loading

0 comments on commit f1f1692

Please sign in to comment.