Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasktorch as a nix package #164

Closed
wants to merge 12 commits into from
Closed

Conversation

wavewave
Copy link
Contributor

On top of #162, I packaged hasktorch 0.0.2 as a nix package, also with libtorch-ffi as a nix package.
For user (not a hasktorch developer), I created user-shell.nix which set up the dependencies for using hasktorch by running

$ nix-shell user-shell.nix

@idontgetoutmuch
Copy link

It failed for me :(

Preprocessing test suite 'sysinfo-test' for sysinfo-0.1.1..
Building test suite 'sysinfo-test' for sysinfo-0.1.1..
[1 of 1] Compiling Main             ( test/Spec.hs, dist/build/sysinfo-test/sysinfo-test-tmp/Main.o )
Initialized empty Git repository in /nix/store/jl51p1qmwk94w8wf6jq5pr8s1rq7ipq4-source/third_party/fbgemm/.git/
Linking dist/build/sysinfo-test/sysinfo-test ...
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 1401 (delta 19), reused 28 (delta 13), pack-reused 1353
Receiving objects: 100% (1401/1401), 658.64 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (1008/1008), done.
running tests
From https://github.com/pytorch/fbgemm
 * [new branch]      fb-config          -> origin/fb-config
 * [new branch]      jianyuh-patch-1    -> origin/jianyuh-patch-1
 * [new branch]      jspark1105-patch-1 -> origin/jspark1105-patch-1
 * [new branch]      master             -> origin/master
Running 1 test suites...
Test suite sysinfo-test: RUNNING...
Switched to a new branch 'fetchgit'

sysInfo function
  retuns valid data FAILED [1]
  uptime > 0 FAILED [2]
  freeram > 0 FAILED [3]

Failures:

  test/Spec.hs:24:16:
  1) sysInfo function retuns valid data
       predicate failed on: Left 96

  To rerun use: --match "/sysInfo function/retuns valid data/"

  test/Spec.hs:16:23:
  2) sysInfo function uptime > 0
       uncaught exception: ErrorCall
       Invalid value Left 96
       CallStack (from HasCallStack):
         error, called at test/Spec.hs:16:23 in main:Main

  To rerun use: --match "/sysInfo function/uptime > 0/"

  test/Spec.hs:16:23:
  3) sysInfo function freeram > 0
       uncaught exception: ErrorCall
       Invalid value Left 96
       CallStack (from HasCallStack):
         error, called at test/Spec.hs:16:23 in main:Main

  To rerun use: --match "/sysInfo function/freeram > 0/"

Randomized with seed 426662167

Finished in 0.0010 seconds
3 examples, 3 failures
Test suite sysinfo-test: FAIL
Test suite logged to: dist/test/sysinfo-0.1.1-sysinfo-test.log
0 of 1 test suites (0 of 1 test cases) passed.
builder for '/nix/store/mmhd4mdngkshymnwirvjr0cni7qkmbzl-sysinfo-0.1.1.drv' failed with exit code 1
cannot build derivation '/nix/store/abv36w9dikdzd57fj7wqygnnc1j28f32-ghc-8.6.5-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/5vw5pmr3n57vchbq6ryq54sf7v57xbfh-mkl-2019.3.199.drv', '/nix/store/abv36w9dikdzd57fj7wqygnnc1j28f32-ghc-8.6.5-with-packages.drv', '/nix/store/vmjmm3588z26m5d4h3h1qb9rgffin94p-python3.7-pytorch-1.2.0.drv' failed

@tscholak
Copy link
Member

tscholak commented Sep 2, 2019

Did you do that on a Mac? I had the same problem. I had to override sysinfo with an otherwise identical derivation that skips tests, see #165

@idontgetoutmuch
Copy link

Yes a Mac. Great! I will take a look.

@junjihashimoto
Copy link
Member

@wavewave @tscholak
Thank you for great contribution to make nix package.
There are some PRs for nix-build.
Which should we merge first?

@wavewave
Copy link
Contributor Author

wavewave commented Sep 2, 2019

@junjihashimoto This PR is superseded by @tscholak 's PR and the new PR uses a more modern approach. I am now closing this PR and the nix-shell PR and let us all focus on PR #165

@wavewave wavewave closed this Sep 2, 2019
@stites
Copy link
Member

stites commented Sep 2, 2019

@junjihashimoto @wavewave @tscholak.

In the spirit of all-contributors (but since both parties have pushed code), I'd like to bring this PR back, merge it first, then merge #164. This might require a bandaid or two. Both @wavewave and @tscholak have chipped away at the idiosyncrasies of this build.

I'd like to take a stab at this, but need roughly 2-4 days to wrap up home- and work- transitions.

@tscholak
Copy link
Member

tscholak commented Sep 2, 2019

@stites I couldn't agree more. the work @wavewave did was instrumental in delivering #165, and it should be recognized!

@stites stites mentioned this pull request Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants