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

ipfs-cluster: init at v0.5.0 #45818

Merged
merged 3 commits into from Sep 2, 2018
Merged

ipfs-cluster: init at v0.5.0 #45818

merged 3 commits into from Sep 2, 2018

Conversation

jglukasik
Copy link
Contributor

Motivation for this change

I've been using the ipfs-cluster recently, but there was no nixpkg to build it. This adds the ipfs-cluster nixpkg (which includes the ipfs-cluster-service and ipfs-cluster-ctl binaries).

Longer term, it might be nice to add some of the ipfs-cluster-service functionality to the ipfs NixOS service itself, but I'll until I have more experience using ipfs-cluster to tackle that.

There was only one complication. The ipfs-cluster repo keeps the go imports in the "github.com/" format, but when the GX package manager (called by fetchgx) gets the packages, it stores them in the src/ directory by their IPFS hash in "gx/ipfs". I added a preBuild step to rewrite these paths using the gx-go utility.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

# fetchgx stores packages by their ipfs hash
# this will rewrite github.com/ imports to gx/ipfs/
cd go/src/${goPackagePath}
${gx-go}/bin/gx-go rewrite
Copy link
Contributor

Choose a reason for hiding this comment

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

This reference is incorrect when cross-building because we need gx-go to run during build.
Instead, please add nativeBuildInputs = [ gx-go ]; above and just write gx-go here (no absolute path).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your help @xeji , addressed in 314d1fc

@xeji
Copy link
Contributor

xeji commented Sep 1, 2018

@GrahamcOfBorg build ipfs-cluster

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: ipfs-cluster

Partial log (click to expand)

Building Go cmd/dist using /nix/store/29gizw0x73zc6zwgpxsiqcgid7sq57wx-go-bootstrap/share/go.
# _/nix/store/mm8wbc2ybpzy7azlxylv3wsl0c65hj6k-go-1.11/share/go/src/cmd/dist
2018/09/01 23:20:56 Invalid GOARM value. Must be 5, 6, or 7.
builder for '/nix/store/cp2bhq8gjfwggzi5zl2glx0jqdpb81bn-go-1.11.drv' failed with exit code 2
cannot build derivation '/nix/store/cdk4nrzq5lykcpv41n7gwydn6wrqv5ii-govers-20150109-3b5f175.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/jpm5zgd4n6vkryvs6c8ja32jdgky1wgl-gx-0.12.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/kbhsjvsaafblsm6fi9k8ajkjflv6r2wj-gx-go-1.5.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/kyxj885h7wg0x26v64rss00hhd15c7zb-ipfs-cluster-0.5.0-gxdeps.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/jk48ni2xqpv2jr0nqrhmv1gm7q2cm314-ipfs-cluster-0.5.0.drv': 4 dependencies couldn't be built
error: build of '/nix/store/jk48ni2xqpv2jr0nqrhmv1gm7q2cm314-ipfs-cluster-0.5.0.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ipfs-cluster

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/649p6k8iy514d8l6qzxpbimk32ys3np1-ipfs-cluster-0.5.0-bin
shrinking /nix/store/649p6k8iy514d8l6qzxpbimk32ys3np1-ipfs-cluster-0.5.0-bin/bin/ipfs-cluster-service
shrinking /nix/store/649p6k8iy514d8l6qzxpbimk32ys3np1-ipfs-cluster-0.5.0-bin/bin/ipfs-cluster-ctl
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/649p6k8iy514d8l6qzxpbimk32ys3np1-ipfs-cluster-0.5.0-bin/bin
patching script interpreter paths in /nix/store/649p6k8iy514d8l6qzxpbimk32ys3np1-ipfs-cluster-0.5.0-bin
checking for references to /build in /nix/store/649p6k8iy514d8l6qzxpbimk32ys3np1-ipfs-cluster-0.5.0-bin...
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
/nix/store/649p6k8iy514d8l6qzxpbimk32ys3np1-ipfs-cluster-0.5.0-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ipfs-cluster

Partial log (click to expand)

find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
find: '/nix/store/rz6h5j14z77laxziwl2lgc7gjrx15g9k-ipfs-cluster-0.5.0': No such file or directory
/nix/store/zka2pglgmi7k6mf7ayy4v7bz1cbp2p8s-ipfs-cluster-0.5.0-bin

@xeji
Copy link
Contributor

xeji commented Sep 2, 2018

aarch64 failure is unrelated (in a dependency).

@xeji xeji merged commit 6a7cd78 into NixOS:master Sep 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants