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

Add the tychus application #51047

Merged
merged 1 commit into from Nov 29, 2018
Merged

Add the tychus application #51047

merged 1 commit into from Nov 29, 2018

Conversation

dawehner
Copy link
Contributor

@dawehner dawehner commented Nov 25, 2018

Motivation for this change

This PR adds the tychus package which is a really neat go program which restarts servers during development. Its main trick is to keep around http requests as long the server restarts, so "reloads" always work.

Things done
dyld: Library not loaded: @rpath/CoreFoundation.framework/Versions/A/CoreFoundation
  Referenced from: /nix/store/317hbs85qqygc903idn8gvgg2yx9xqbl-go-1.11/bin/go
  Reason: no suitable image found.  Did find:
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation: file system sandbox blocked sta

though.

  • 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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Ma27
Copy link
Member

Ma27 commented Nov 26, 2018

Fails with ... though

I locally built with sandbox enabled on x86_64-linux and it works perfectly fine, but I don't know the darwin build environment well enough to tell if that's a problem.

Sandbox failures mostly happen when the actual build implicitly depends on your setup. The sandbox ensures a pure-as-possible environment (using chroot). But as I said, I don't know if that applies to Darwin and I don't know how to fix the issue you described above :)

Copy link
Contributor

@c0bw3b c0bw3b left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution to nixpkgs.
I left some comment for you to consider.

pkgs/development/tools/tychus/default.nix Show resolved Hide resolved
pkgs/development/tools/tychus/default.nix Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@dawehner
Copy link
Contributor Author

Wow, I'd not expected to get feedback so quickly! Thank you. I'll try to address them later today. Nix is amazing so far

@c0bw3b
Copy link
Contributor

c0bw3b commented Nov 26, 2018

As for the Darwin issue, you might solve it by adding CoreFoundation as an optional build input when building on Darwin.

it would look like:

{ stdenv, fetchFromGitHub, buildGoPackage, CoreFoundation }:
  # blahcode
  buildInputs = stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ];

@dawehner
Copy link
Contributor Author

@c0bw3b Thank you for the suggestions. I tried them out, but it still isn't able to find CoreFoundation

@Ma27
Copy link
Member

Ma27 commented Nov 27, 2018

@dawehner as you only filled out the macOS checkbox I assume that you want to use this package on a macOS with darwin, right? (Otherwise I we could simply disable darwin build for now).

I recommend to ask in #nix-darwin or #nixos channel on freenode, I'm not a macOS user, so I can't help you here, sorry.

@dawehner
Copy link
Contributor Author

@Ma27 Yeah I'm planning to use this on both darwin and on my linux machine (Nix is really nice for this hybrid setup world!).
Your recommendation is great. I'll join the channel once I've next time to work on it.

Copy link
Member

@LnL7 LnL7 left a comment

Choose a reason for hiding this comment

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

Don't worry about sandboxing in this case, darwin + frameworks currently don't work properly when sandboxing is enabled. (Builds that don't depend on those work fine tho)

@LnL7
Copy link
Member

LnL7 commented Nov 29, 2018

@GrahamcOfBorg build tychus

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tychus

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/b8p21f0bp7hvrjclp37jkxayyz1zha8y-tychus-0.6.3-bin
shrinking /nix/store/b8p21f0bp7hvrjclp37jkxayyz1zha8y-tychus-0.6.3-bin/bin/tychus
strip is /nix/store/qjrnv0qw44bw1hc23zhfh26xd1c25dfs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/b8p21f0bp7hvrjclp37jkxayyz1zha8y-tychus-0.6.3-bin/bin
patching script interpreter paths in /nix/store/b8p21f0bp7hvrjclp37jkxayyz1zha8y-tychus-0.6.3-bin
checking for references to /build in /nix/store/b8p21f0bp7hvrjclp37jkxayyz1zha8y-tychus-0.6.3-bin...
strip is /nix/store/qjrnv0qw44bw1hc23zhfh26xd1c25dfs-binutils-2.30/bin/strip
/nix/store/b8p21f0bp7hvrjclp37jkxayyz1zha8y-tychus-0.6.3-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: tychus

Partial log (click to expand)

find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
find: '/nix/store/miqipnpqcp77b34iwivrxkchny3cyql3-tychus-0.6.3': No such file or directory
/nix/store/n3d98xm4w3id75rcc12prhrfyh6h09jl-tychus-0.6.3-bin

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tychus

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/vyr24g7r1xf6dyzp2s5r2gr38190302i-tychus-0.6.3-bin
shrinking /nix/store/vyr24g7r1xf6dyzp2s5r2gr38190302i-tychus-0.6.3-bin/bin/tychus
strip is /nix/store/n4hb93w6j076xcjw5pm09rdmc09s075b-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/vyr24g7r1xf6dyzp2s5r2gr38190302i-tychus-0.6.3-bin/bin
patching script interpreter paths in /nix/store/vyr24g7r1xf6dyzp2s5r2gr38190302i-tychus-0.6.3-bin
checking for references to /build in /nix/store/vyr24g7r1xf6dyzp2s5r2gr38190302i-tychus-0.6.3-bin...
strip is /nix/store/n4hb93w6j076xcjw5pm09rdmc09s075b-binutils-2.30/bin/strip
/nix/store/vyr24g7r1xf6dyzp2s5r2gr38190302i-tychus-0.6.3-bin

@LnL7 LnL7 merged commit c506ad8 into NixOS:master Nov 29, 2018
@dawehner dawehner deleted the tychus branch November 29, 2018 22:13
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

6 participants