Page MenuHomePhabricator

Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk
ClosedPublic

Authored by haampie on Jan 21 2021, 12:16 AM.

Details

Summary

Allow users to use a non-system version of perl, python and awk, which is useful in certain package managers.

Diff Detail

Event Timeline

haampie created this revision.Jan 21 2021, 12:16 AM
haampie requested review of this revision.Jan 21 2021, 12:16 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptJan 21 2021, 12:16 AM

@JDevlieghere, would you care to review? This is another instance of moving away from system binaries to whatever the user / package manager wants the build to use.

#!/usr/bin/env perl -w (2 arguments) unfortunately does not work on Linux and many other systems.

Several llvm/utils/ scripts can probably just be removed.

JDevlieghere accepted this revision.Jan 27 2021, 4:18 PM

#!/usr/bin/env perl -w (2 arguments) unfortunately does not work on Linux and many other systems.

Not sure if there's a similar thing for awk, but I think use warnings is preferred nowadays over perl -w.

This revision is now accepted and ready to land.Jan 27 2021, 4:18 PM
JDevlieghere requested changes to this revision.Jan 27 2021, 4:18 PM

Oops, didn't mean to accept.

This revision now requires changes to proceed.Jan 27 2021, 4:18 PM
haampie updated this revision to Diff 319871.Jan 28 2021, 8:02 AM

I dropped the awk bits, since there's no portable way to do it there, and replaced all perl -w with perl and use warnings.

JDevlieghere accepted this revision.Jan 28 2021, 11:27 AM

LGTM, unless @MaskRay has any other concerns.

This revision is now accepted and ready to land.Jan 28 2021, 11:27 AM
MaskRay accepted this revision.Jan 28 2021, 4:50 PM

Should this be merged?

Should this be merged?

Do you have commit access? If not I can land this for you.

I don't have commit access, would be great if you could do that for me!