-
Notifications
You must be signed in to change notification settings - Fork 131
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
Inconsistant paths in Perl script shabang lines. #141
Comments
On Sun, Mar 24, 2013 at 12:16:07PM -0700, Robert James Clay wrote:
#!/usr/bin/perl should be the standard IMO Marc"A mouse is a device used to point at the xterm you want to type in" - A.S.R. |
Hi Marc, Op 24-mrt.-2013, om 20:17 heeft Marc MERLIN [email protected] het volgende geschreven:
would not be more portable? http://en.wikipedia.org/wiki/Shebang_(Unix)#Portability Kind regards, |
On Sun, Mar 24, 2013 at 12:19:56PM -0700, Lieven Hollevoet wrote:
It would, if there is anyone running any unix where perl isn't But honestly, it's been a very long time since I've seen a unix system (more Either work for me though. Marc"A mouse is a device used to point at the xterm you want to type in" - A.S.R. |
Op 24-mrt.-2013, om 20:23 heeft Marc MERLIN [email protected] het volgende geschreven:
Yes, /usr/bin/perl if you're running the system-provided perl. I'm a big fan of perlbrew that allows you to test with various versions of perl. Result: nessie:hue-perl lieven$ which perl So yes, other paths to perl do exist :-) Regards, |
On Sun, Mar 24, 2013 at 12:27:23PM -0700, Lieven Hollevoet wrote:
Fair enough /usr/bin/env perl if you'd like is fine with me :) Marc"A mouse is a device used to point at the xterm you want to type in" - A.S.R. |
On Debian, the path "/usr/bin/perl" is standard and is required by policy. Therefore, QA tools like Lintian will come up with either errors or warnings if it finds something different (depending on how it's different). So far, It's found 12 files with the issue, most of which it considered as errors. I've fixed those by setting the path to the standard one for Debian (see pull request 142). I also fixed another file in the same way, which didn't have the line at all; reference issue # 139 for that... |
It can't be used in the Debian packaging but if the consensus is to use 'usr/bin/env perl' as the standard shabang path in MisterHouse, I could update the fixes I did to that so that the pull request for those files could be pulled in. |
Hey RJ, I'm certainly no authority on this subject, I was just explaining my method of working. Apparently few other people have an opinion on this subject or they haven't noticed this discussion. Feel free to pick whatever suits you best. Lieven. Op 18-apr.-2013, om 22:41 heeft Robert James Clay [email protected] het volgende geschreven:
|
Merge #209 fixed a bunch of shebangs. Was that all of them? Is this still an open issue? |
On Fri, 31 May 2013 19:35:32 -0700
All that I found then... I'll admit I haven't reviewed every script
That depends... I think there should be some kind of project Robert James Clay |
Hey guys, I guess we need to discuss this further. I hit a problem with the Perl shebangs in the scripts under the 'bin' folder when I try to run MisterHouse on a custom installed Perl version on OS X. E.g. bin/get_email hardcodes the Perl executable to /usr/bin/perl which causes the module search path to go bezerk. For more details see #247 |
I wanted to chime in and say I think this is an important issue to resolve. However, I am not a perl maven so I am not sure I understand all of the ramifications for something like this. @hollie's solution seems reasonable. Good-old perlmonks has some decent posts on the subject that suggest that this may be acceptable. Didn't this originally arise in the porting to debian? Is this allowed in debian packages? |
After reading some more on this: apparently the opinions on hardcoding either /usr/bin/perl or /usr/bin/env perl in scripts are very mixed. The most sane/safe advice I found was that the installer should find out what perl to use and should replace the shebang line with the correct content when installing the script(s). However, since MisterHouse has no installer this is currently not really on option to go for. I think the first mention of this shebang line was indeed when @jame was cleaning out the various shebangs we had for various scripts when packaging for debian, but since the current shebang causes parts of MisterHouse to fail on non-standard installs (i.e. systems that don't use the system-provided Perl) I raised it again. I'm unsure how to proceed but I agree with @krkeegan we need to make a decision on this issue. I'm in favor of /usr/bin/env perl as it allows the user to select what perl to run but before we change we need to know this will not cause problems for others. |
On Mon, 2013-08-26 at 09:50 -0700, Kevin Robert Keegan wrote:
That's where I originally ran across the issue, yes; multiple
Not in official ones; i.e., intended to be uploaded to Debian. By RJ Clay [1] |
On Mon, 2013-08-26 at 14:02 -0700, Lieven Hollevoet wrote:
Indeed...
IIRC, that's configurable in some way, at least with the 'standard'
But perhaps something to plan for?
And for the standard Debian packaging I'm working on; if the path
Non-standard installs are not something I've experimented much with RJ Clay |
On Mon, 2013-08-26 at 14:02 -0700, Lieven Hollevoet wrote:
Having a project wide policy I also think would be best, whatever it
If that's the way it ends up going, then won't we need to ensure that
RJ Clay |
Hey RJ, Op 28-aug.-2013, om 08:19 heeft Robert James Clay [email protected] het volgende geschreven:
I agree.
Yes, sure. When we implement this we should document it.
Windows: would be very usable. There is no /usr/bin/perl on Windows either and it works too due to the binding of .pl files to the Perl interpreter. Kind regards, |
Op 28-aug.-2013, om 08:19 heeft Robert James Clay [email protected] het volgende geschreven:
Yes, if/when I find time I plan to experiment with Dist::Zilla to see how easy it is to integrate the existing codebase into a Dist::Zilla flow. This would bring us automatic dependency checking and lots of possibilities to configure what shebang gets implemented when a user installs the code package. Kind regards, |
Is this issue resolved? If not would it be possible to resolve it soon, before we make the next release? |
There is a proposed fix for the check email script in hollie/misterhouse Regards,
|
Quite frankly, I'm fine with anything consistent that works on Mac/Windows. On linux, it's trivial to make whatever solution work, either because it just does, or with a symlink. |
Hey Marc, I will only have time to merge this after next weekend. There is a branch called fix_get_email in the repo where I applied the fix Could you test this out? If it works then I can apply it for the other Regards,
|
On Mon, Dec 30, 2013 at 03:50:48AM -0800, Lieven Hollevoet wrote:
I'm not at home for a while, so I'd rather not touch my mh tree and Marc"A mouse is a device used to point at the xterm you want to type in" - A.S.R. |
I am not configured to check email via mh. Is there a basic test I can do on linux to validate? I see the main bin/mh script has the hard coded path. I can change that to test if that helps. |
You can see the change I propose here: Basically replace the hard-coded "/usr/bin/perl” shebang with "/usr/bin/env perl" This change allows the user to override the perl binary that is used without having to change symlinks in folders where a normal user does not have access. Kind regards, Op 31-dec.-2013, om 00:00 heeft john- [email protected] het volgende geschreven:
|
There are multiple Perl scripts in the MisterHouse distribution but when a shabang line is actually in the file, there are multiple locations that it might point to. Examples are as follows:
The text was updated successfully, but these errors were encountered: