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

verilator: fix Perl shebangs #23631

Merged
merged 1 commit into from Mar 9, 2017
Merged

verilator: fix Perl shebangs #23631

merged 1 commit into from Mar 9, 2017

Conversation

edef1c
Copy link
Member

@edef1c edef1c commented Mar 8, 2017

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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.

@mention-bot
Copy link

@edef1c, thanks for your PR! By analyzing the history of the files in this pull request, we identified @globin and @thoughtpolice to be potential reviewers.

@edef1c
Copy link
Member Author

edef1c commented Mar 8, 2017

without this fix, it relies on bash interpreting things without a shebangs as bash scripts, which not only breaks under non-bash shells, but also breaks anything just execing it

edef@cheetah ~> head -n3 /nix/store/i47ipbl3qk1512m9bppacksw48qnzvik-verilator-3.900/bin/verilator
: # -*-Mode: perl;-*- use perl, wherever it is
eval 'exec perl -wS $0 ${1+"$@"}'
  if 0;

@@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
buildInputs = [ perl flex_2_6_1 bison ];

postInstall = ''
sed -i -e '3a\#!/usr/bin/env perl' -e '1,3d' $out/bin/{verilator,verilator_coverage,verilator_profcfunc}
Copy link
Member

@Mic92 Mic92 Mar 9, 2017

Choose a reason for hiding this comment

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

would

 sed -i -e '3a\#!/${pkgs}/bin/perl' -e '1,3d' $out/bin/{verilator,verilator_coverage,verilator_profcfunc}

also work here?

Copy link
Member Author

Choose a reason for hiding this comment

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

the fixup phase handles this already, the /usr/bin/env usage never makes it into the final build

@Mic92 Mic92 merged commit 4d13b5d into NixOS:master Mar 9, 2017
@Mic92
Copy link
Member

Mic92 commented Mar 9, 2017

Thanks!

@edef1c edef1c deleted the verilator-shebang branch March 9, 2017 14:05
@Mic92
Copy link
Member

Mic92 commented Mar 9, 2017

I guess we have the same bug in our release-17.03 branch?

@edef1c
Copy link
Member Author

edef1c commented Mar 9, 2017

Probably. This should cherry-pick cleanly though?

@Mic92
Copy link
Member

Mic92 commented Mar 9, 2017

done

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

3 participants