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

fzf: fix vim plugin patch phase #40136

Merged
merged 1 commit into from May 8, 2018
Merged

fzf: fix vim plugin patch phase #40136

merged 1 commit into from May 8, 2018

Conversation

cript0nauta
Copy link
Contributor

Motivation for this change

During patch phase, the path to the fzf binary is overwritten in the vim plugin source. The sed expression doing this wasn't working because the fzf code changed in this commit: junegunn/fzf@02ceae1 making the patch useless.

Things done

I fixed the sed expression and added a check to verify that the plugin was effectively patched to prevent this to happen in the future.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

During patch phase, the path to the fzf binary is overwritten in the vim
plugin source. The sed expression doing this wasn't working because the fzf
code changed in this commit:
junegunn/fzf@02ceae1
making the patch useless.

I fixed it and added a check to verify that the plugin was effecively
patched to prevent this to happen in the future.
@xeji
Copy link
Contributor

xeji commented May 7, 2018

@GrahamcOfBorg eval

@xeji
Copy link
Contributor

xeji commented May 7, 2018

@GrahamcOfBorg build fzf

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: fzf

Partial log (click to expand)

/nix/store/qpy9nf8pg8yfpv9b26w3i5v96an5z8v2-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/bin/fzf-tmux: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/qpy9nf8pg8yfpv9b26w3i5v96an5z8v2-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/install: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/qpy9nf8pg8yfpv9b26w3i5v96an5z8v2-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/uninstall: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/qpy9nf8pg8yfpv9b26w3i5v96an5z8v2-fzf-0.17.3...
shrinking RPATHs of ELF executables and libraries in /nix/store/va7j3xn5d2lala4j6iffwc5mp5618403-fzf-0.17.3-man
gzipping man pages under /nix/store/va7j3xn5d2lala4j6iffwc5mp5618403-fzf-0.17.3-man/share/man/
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/va7j3xn5d2lala4j6iffwc5mp5618403-fzf-0.17.3-man
checking for references to /build in /nix/store/va7j3xn5d2lala4j6iffwc5mp5618403-fzf-0.17.3-man...
/nix/store/b01hfbyz4kclzjygk44311d208crzm69-fzf-0.17.3-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: fzf

Partial log (click to expand)

/nix/store/xcqs4gvrjmzmay6w9sdagpqapma7riph-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/bin/fzf-tmux: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/bash"
/nix/store/xcqs4gvrjmzmay6w9sdagpqapma7riph-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/install: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/bash"
/nix/store/xcqs4gvrjmzmay6w9sdagpqapma7riph-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/uninstall: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/xcqs4gvrjmzmay6w9sdagpqapma7riph-fzf-0.17.3...
shrinking RPATHs of ELF executables and libraries in /nix/store/45s89kii9vv3synj92jgw60jrcawky92-fzf-0.17.3-man
gzipping man pages under /nix/store/45s89kii9vv3synj92jgw60jrcawky92-fzf-0.17.3-man/share/man/
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/45s89kii9vv3synj92jgw60jrcawky92-fzf-0.17.3-man
checking for references to /build in /nix/store/45s89kii9vv3synj92jgw60jrcawky92-fzf-0.17.3-man...
/nix/store/68vawhhbypnq9f02dr2jd2b9rl8l9q7i-fzf-0.17.3-bin

@xeji
Copy link
Contributor

xeji commented May 7, 2018

Your change looks fine but there seems something else wrong with the install scripts (with or without this PR): $out/share/go/{pkg,src} contain the full go source and build directory. Why should these be packaged?

Can you please check the build outputs (out, bin, man) to make sure their contents make sense.

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: fzf

Partial log (click to expand)

/nix/store/x8dp8j6qknlmk0by271gqd1ww0si44g3-fzf-0.17.3-bin/bin/fzf-tmux: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
strip is /nix/store/kdff2gim6417493yha769kh00n63lnrw-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/wh2vi593nx2jhzcxx3nhzx00mrqd41y3-fzf-0.17.3
/nix/store/wh2vi593nx2jhzcxx3nhzx00mrqd41y3-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/bin/fzf-tmux: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/wh2vi593nx2jhzcxx3nhzx00mrqd41y3-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/install: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/wh2vi593nx2jhzcxx3nhzx00mrqd41y3-fzf-0.17.3/share/go/src/github.com/junegunn/fzf/uninstall: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
gzipping man pages under /nix/store/8saq70n5x99qhfyddx1gpphksc2ja1v6-fzf-0.17.3-man/share/man/
strip is /nix/store/kdff2gim6417493yha769kh00n63lnrw-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/8saq70n5x99qhfyddx1gpphksc2ja1v6-fzf-0.17.3-man
/nix/store/x8dp8j6qknlmk0by271gqd1ww0si44g3-fzf-0.17.3-bin

@Mic92
Copy link
Member

Mic92 commented May 8, 2018

The problem here is that buildGoPackage puts source code into $out. Usually we only care about $bin for go packages.

@Mic92
Copy link
Member

Mic92 commented May 8, 2018

@ehmry @lethalman why do we install go source files?

@xeji
Copy link
Contributor

xeji commented May 8, 2018

The problem here is that buildGoPackage puts source code into $out.

Since that seems to be a separate and more general issue, I'll merge this fix now.

@xeji xeji merged commit 06ef2ec into NixOS:master May 8, 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

5 participants