Mach stub is broken on Debian-based Linux distros. #1890

Closed
opened 3 months ago by athenian200 · 3 comments
Collaborator

People have apparently been changing the first line from /bin/sh to /bin/bash to work around this and not reporting it as an issue for the most part because they are used to broken scripts. I just confirmed it on Linux Mint while checking on something unrelated, though.

The mach stub as written only works fully with bash, and well enough with ksh to not error out unless you actually try creating a source tarball. And it completely breaks in dash, which is unfortunately installed as /bin/sh on Mint, Ubuntu, and Debian.

I know how to fix the non-working parts of the script for ksh (though I've never needed to), but no idea what dash needs. There is a much easier fix that I am leaning towards, though...

Just remove all of the source tarball creation junk, and then it magically works on everything. The source tarball creation in the mach stub only works properly on some Linux distros that ship bash as /bin/sh, and I am not sure we need this to create source tarballs anyway.

If I'm being honest, the script seems overly complicated and dependent on Bash-specific logic and GNU utilities, and more specifically is dependent on the way RedHat-like distros are setup (even within Linux). If we want a script like this, it would be much easier to create something that copies over the entire directory to a temporary staging area, removes anything unwanted from the tarball, then uses tar and xz to archive the whole thing, and then just removes the staging area and preserves the tarball.

It just seems to me like this was poorly done and not as necessary as it once was, given that we are back to public repos and tagged releases. It also seems like there are better and more portable ways to do this overall.

People have apparently been changing the first line from `/bin/sh` to `/bin/bash` to work around this and not reporting it as an issue for the most part because they are used to broken scripts. I just confirmed it on Linux Mint while checking on something unrelated, though. The mach stub as written only works fully with bash, and well enough with ksh to not error out unless you actually try creating a source tarball. And it completely breaks in dash, which is unfortunately installed as `/bin/sh` on Mint, Ubuntu, and Debian. I know how to fix the non-working parts of the script for ksh (though I've never needed to), but no idea what dash needs. There is a much easier fix that I am leaning towards, though... Just remove all of the source tarball creation junk, and then it magically works on everything. The source tarball creation in the mach stub only works properly on some Linux distros that ship bash as /bin/sh, and I am not sure we need this to create source tarballs anyway. If I'm being honest, the script seems overly complicated and dependent on Bash-specific logic and GNU utilities, and more specifically is dependent on the way RedHat-like distros are setup (even within Linux). If we want a script like this, it would be much easier to create something that copies over the entire directory to a temporary staging area, removes anything unwanted from the tarball, then uses tar and xz to archive the whole thing, and then just removes the staging area and preserves the tarball. It just seems to me like this was poorly done and not as necessary as it once was, given that we are back to public repos and tagged releases. It also seems like there are better and more portable ways to do this overall.
Owner

Well we both know who to blame for this. I wonder if he'll get triggered by this considering it's just more poorly done code we ultimately just don't need and wasn't necessary as a mach command to begin with (I packed manually with tar for a few even after he added it to mach and was upset I didn't use it...)

We no longer need cathedral style source tarballs, so by all means, feel free to rip it out.

Well we both know who to blame for this. I wonder if he'll get triggered by this considering it's just more poorly done code we ultimately just don't need and wasn't necessary as a mach command to begin with (I packed manually with tar for a few even after he added it to mach and was upset I didn't use it...) We no longer need cathedral style source tarballs, so by all means, feel free to rip it out.
Moonchild added the
Code Cleanup
label 3 months ago
Poster
Collaborator

This is done. Seems to work on every platform. Wasn't too difficult to leave the essential functionality in place while removing all the other stuff. :)

I just happened to be removing it from my application while testing on Linux and thought it might be desirable here as well. Anyway, closing this.

This is done. Seems to work on every platform. Wasn't too difficult to leave the essential functionality in place while removing all the other stuff. :) I just happened to be removing it from my application while testing on Linux and thought it might be desirable here as well. Anyway, closing this.
athenian200 closed this issue 3 months ago
Owner

Uplifted to release so people have a smoother time using the new milestone. Thanks!

Uplifted to release so people have a smoother time using the new milestone. Thanks!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: MoonchildProductions/Pale-Moon#1890
Loading…
There is no content yet.