URL:
  <https://savannah.gnu.org/bugs/?68798>

                 Summary: allow determination of posix-shell-ness to be
dynamically configurable
                   Group: make
               Submitter: boyski
               Submitted: Mon 19 Oct 2026 12:26:12 PM UTC
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Unlocked
       Component Version: SCM
        Operating System: None
           Fixed Release: None
           Triage Status: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 19 Oct 2026 12:26:12 PM UTC By: David Boyce <boyski>
In some cases, specifically .ONESHELL mode, make needs to determine whether
the current value of $(SHELL) behaves similarly to the POSIX shell. It's
always bothered me that it does so by consulting a hardcoded list of known
shell names (ash, bash, dash, sh, etc) in the is_bourne_compatible_shell()
function. That's a conceptual problem, in the sense that there may be an
unknown set of other potentially compatible shells out there. Also, at any
point a new one could be written and it would take many years for it to be
mainstreamed into make. But there's also an immediate issue which is where I
ran into it:

I have a tool called mdsh which wraps /bin/sh while collecting debug/analysis
data before and after. To all intents and purposes it IS /bin/sh, since that's
what does the work, but since the name "mdsh" isn't on the list it doesn't get
recognized which changes make's behavior. When your debugger changes the
behavior of the thing it's debugging, that's bad. I don't think mdsh or
anything like it belongs on the default list but allowing it to be added
locally seems like a feature.

It's not entirely clear to me what the var name should be: the function is
called is_bourne_compatible_shell so I went with .BOURNE_COMPATIBLE_SHELLS
though of course Bourne isn't the reference standard, POSIX is. But Linux (and
Bourne?) don't claim to be literally POSIX, just POSIX-like, so maybe
.POSIX_COMPATIBLE_SHELLS would imply something GNU doesn't want to claim?
Maybe .POSIX_LIKE_SHELLS? Anyway, that's up for discussion but I've gone with
BOURNE for now.

The patch also has a trivial change to .gitignore to ignore .*.swp files
created by vim. That slipped in by mistake :-). Keep or drop.

Disclosure: in keeping with my understanding of GNU rules, I wrote the code
and doc text myself but asked Claude to generate the test case.







    _______________________________________________________
File Attachments:

Name: bourne_compatible_shells.patch Size: 11KiB

<https://file.savannah.gnu.org/file/bourne_compatible_shells.patch?file_id=59112>



    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-008698919f826f0fb06bcafffba4902404c2a7d0.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68798>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to