Opened 5 years ago

Closed 4 years ago

Last modified 4 months ago

#9057 closed task (fixed)

Remove /usr/bin/… references

Reported by: Fuuzetsu Owned by:
Priority: low Milestone: 7.10.1
Component: Build System (make) Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D237
Wiki Page:


The use of /usr/bin/perl in sync-all makes it difficult to work with on distros which don't store binaries in /usr/bin, such as NixOS.

A more portable solution would be to use /usr/bin/env perl. It'd be very nice if someone turned such shebangs to use env rather than direct reference.

Change History (10)

comment:1 Changed 5 years ago by Joachim Breitner <mail@…>

In 34db5ccf52ec2a1b5e953c282d0c52a7fc82c02a/ghc:

Replace all #!/usr/bin/perl with #!/usr/bin/env perl

As suggested in #9057.

comment:2 Changed 5 years ago by nomeata

Resolution: fixed
Status: newclosed

Quite right; fixed.

comment:3 Changed 5 years ago by Fuuzetsu

Ah, while I did say /usr/bin/perl, I should have perhaps said /usr/bin/anything.

./distrib/cross-port:#! /bin/bash
./configure:  echo '#! /bin/cat
./utils/count_lines/count_lines.lprl:#! /usr/bin/perl
./utils/pvm/debugger.emacs:#!/bin/csh -f
./utils/pvm/debugger2:#!/bin/csh -f
./compiler/count_bytes:#! /usr/local/bin/perl
./autom4te.cache/output.1:  echo '#! /bin/cat
./autom4te.cache/output.0:  echo '#! /bin/cat

Should I create a separate ticket for above? There are some in ./libraries so I should probably be filing with them, but many aren't.

comment:4 Changed 5 years ago by nomeata

Resolution: fixed
Status: closednew

I’ve reopened the ticket. You can also create a patch (or branch on your github fork) if you feel like it.

How should arguments like in /bin/csh -f be treated?

comment:5 Changed 5 years ago by Fuuzetsu

Priority: normallow

As far as I can tell, there's no way to pass such flags to programs while using env and these flags have to be accomodated for on script-by-script basis. So for example #!/usr/bin/perl -w becomes #!/usr/bin/env perl and use warnings; should be set instead of using -w.

I'll look into patching out the paths I mentioned in the following few days if I get some time. It is of no high priority to me at the moment as during the build process my distro's tools patch up the shebangs anyway but it's a matter of principle.

comment:6 Changed 4 years ago by thomie

Differential Rev(s): Phab:D237
Status: newpatch

All fixed, except:

  • libraries are maintained on github
  • configure and autom4te.cache are created are by autotools

comment:7 Changed 4 years ago by Austin Seipp <austin@…>

In d5e4874833054f1789289c433be292ae3e9bd7d0/ghc:

Change all hashbangs to /usr/bin/env (#9057)

git grep -l '#!' | xargs sed -i 's|#!.*/bin/\([^ ]*\)$|#!/usr/bin/env \1|'
and some manual tweaking

Test Plan: harbormaster

Reviewers: austin

Subscribers: hvr, simonmar, ezyang, carter

Differential Revision:

GHC Trac Issues: #9057

comment:8 Changed 4 years ago by thomie

Milestone: 7.10.1
Resolution: fixed
Status: patchclosed

comment:9 Changed 4 years ago by Austin Seipp <austin@…>

In d997ca85a33f34f9f461096eb1b25d5f25b53072/ghc:

Don't use absolute paths for perl in validate

Summary: This will *not* work on NixOS for example.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:

GHC Trac Issues: #9057

comment:10 Changed 4 months ago by bgamari

Component: Build SystemBuild System (make)

The new Hadrian build system has been merged. Relabeling the tickets concerning the legacy make build system to prevent confusion.

Note: See TracTickets for help on using tickets.