Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Support git dependencies #92

Merged
merged 33 commits into from Apr 10, 2019
Merged

Support git dependencies #92

merged 33 commits into from Apr 10, 2019

Conversation

srghma
Copy link
Contributor

@srghma srghma commented Jan 5, 2019

This pr subsumes:
#85
#23

Closes:

Difference:

  • tests are working
  • using builtins.fetchGit only because nix-prefetch-git doesnt work on build phase on NixOs

@srghma
Copy link
Contributor Author

srghma commented Jan 5, 2019

@moretea @lheckemann hi, could you please review this pr (soon will fix tests by using new node version , but they are working locally)

@srghma
Copy link
Contributor Author

srghma commented Jan 6, 2019

@zimbatm @moretea tests are fixed

@srghma
Copy link
Contributor Author

srghma commented Jan 11, 2019

TODO:

Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, it looks like it's getting into shape!

bin/yarn2nix.js Outdated Show resolved Hide resolved
default.nix Outdated Show resolved Hide resolved
nix/testFileShFunctions.nix Outdated Show resolved Hide resolved
bin/lib/urlToName.js Outdated Show resolved Hide resolved
Having:

  mkYarnPackage {
    name = "this-package";
    src = ./. # directory with files ./file1, ./file2, ./package.json
    workspaceDependencies = [other-package] # other-package contains
    ./otherfile1, ./otherfile2, ./package.json
  }

Before:

  `tree` during preInstall shows following directory structure

  ./node_modules
  ./.yarnrc
  ./file1
  ./file2
  ./deps/this-package/file1
  ./deps/this-package/file2
  ./deps/this-package/package.json
  ./deps/other-package/otherfile1
  ./deps/other-package/otherfile2
  ./deps/other-package/package.json

After

  `tree` during preInstall shows following directory structure

  ./node_modules
  ./.yarnrc
  ./deps/this-package/file1
  ./deps/this-package/file2
  ./deps/this-package/package.json
  ./deps/other-package/otherfile1
  ./deps/other-package/otherfile2
  ./deps/other-package/package.json
default.nix Outdated
@@ -1,10 +1,14 @@
{ pkgs ? import <nixpkgs> {}
, nodejs ? pkgs.nodejs
, nodejs ? pkgs.nodejs-8_x
Copy link
Member

@zimbatm zimbatm Apr 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use the nixpkgs default version

Suggested change
, nodejs ? pkgs.nodejs-8_x
, nodejs ? pkgs.nodejs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change makes ci tests fail

 ✘  ~/projects/yarn2nix   pull85  export NIXPKGS_CHANNEL=nixos-18.03 && ./run-tests.sh
--- Running tests with IFD enabled
building '/nix/store/xvv3zdgw7h9q1ilikhph9wx3qhkg9kb8-fixup_yarn_lock.drv'...
installing
node -v
v6.14.4
patching script interpreter paths in /nix/store/1cga0h2vqbr7xxxvjn9ccvk4n8jzw0zp-fixup_yarn_lock
/nix/store/1cga0h2vqbr7xxxvjn9ccvk4n8jzw0zp-fixup_yarn_lock/bin/fixup_yarn_lock: interpreter directive changed from "/usr/bin/env node" to "/nix/store/85y6qr70pyv2njvg1pnsl4zcln540iyc-nodejs-6.14.4/bin/node"
building '/nix/store/x2qkrxrb97lmzzj2k840s4xnksbrsqax-yarn2nix-modules-1.0.0.drv'...
configuring
building
yarn config v1.5.1
success Set "yarn-offline-mirror" to "/nix/store/3xz5j2lp0y2cqcnhsinvhzgdcqqj5ncj-offline".
Done in 0.03s.
/nix/store/1cga0h2vqbr7xxxvjn9ccvk4n8jzw0zp-fixup_yarn_lock/bin/fixup_yarn_lock:46
        )
        ^

SyntaxError: Unexpected token )
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
builder for '/nix/store/x2qkrxrb97lmzzj2k840s4xnksbrsqax-yarn2nix-modules-1.0.0.drv' failed with exit code 1

I propose to remove tests for NIXPKGS_CHANNEL=nixos-18.03

Copy link
Contributor Author

@srghma srghma Apr 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apart from that I would say the pr is ready to be consumed

@zimbatm
Copy link
Member

zimbatm commented Apr 5, 2019

@srghma is it ready?

@srghma
Copy link
Contributor Author

srghma commented Apr 5, 2019

@zimbatm, didn't think anyone is interested because of lot of changes)

Yes, I use it successfully in my company.

Only one thing left: I want to share function urlToName between executables, will do it this weekend

@zimbatm
Copy link
Member

zimbatm commented Apr 6, 2019

yes it's quite a bit of changes :) If you are confident that it works I am ready to merge it when you are.

@srghma
Copy link
Contributor Author

srghma commented Apr 8, 2019

@zimbatm hi, can we merge now?

@zimbatm zimbatm merged commit 8c73c4a into nix-community:master Apr 10, 2019
@srghma
Copy link
Contributor Author

srghma commented Apr 10, 2019

@zimbatm tnx for merging it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants