dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Dash commit 46d3c1a (in 0.5.8+) breaks BSD make
@ 2016-03-04 14:06 Martin Lucina
  2016-03-04 14:24 ` Antti Kantee
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Lucina @ 2016-03-04 14:06 UTC (permalink / raw)
  To: dash; +Cc: rumpkernel-users

Hi,

Commit 46d3c1a ([VAR] Sanitise environment variable names on entry)
restricts exported environment variables actually set by dash on entry to
those reported as valid by endofname(). While this is technically correct
and matches IEEE Std 1003.1, it breaks BSD make which uses '.' as a
separator in variables exported via the environment to a sub-make.

Upstream bug report: https://github.com/rumpkernel/rumprun/issues/38

I'm not sure what the correct fix is here. While we (rumprun) could
possibly patch our version of NetBSD make to not use '.' in exported names,
this problem would continue to hit other users of BSD-derived make.

Would the dash maintainers consider replacing 46d3c1a with a fix that
performs the name validity check at "export -p" time instead? If yes, I can
try my hand at a patch.

Based on my reading of reading of Std 1003.1 section 8.1...

    "Other characters may be permitted by an implementation; applications
    shall tolerate the presence of such names."

... preserving "invalid" but exported environment variables would still be
compliant behaviour.

Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dash commit 46d3c1a (in 0.5.8+) breaks BSD make
  2016-03-04 14:06 Dash commit 46d3c1a (in 0.5.8+) breaks BSD make Martin Lucina
@ 2016-03-04 14:24 ` Antti Kantee
  2016-03-04 15:48   ` Martin Lucina
  0 siblings, 1 reply; 3+ messages in thread
From: Antti Kantee @ 2016-03-04 14:24 UTC (permalink / raw)
  To: dash, rumpkernel-users

On 04/03/16 14:06, Martin Lucina wrote:
> Commit 46d3c1a ([VAR] Sanitise environment variable names on entry)
> restricts exported environment variables actually set by dash on entry to
> those reported as valid by endofname(). While this is technically correct
> and matches IEEE Std 1003.1, it breaks BSD make which uses '.' as a
> separator in variables exported via the environment to a sub-make.

I wouldn't go so far as to say it breaks BSD make.  Rather, it breaks a 
rare pattern where variables containing "." (where "." follows a certain 
convention) are passed to submakes via the shell (i.e. ".export" in the 
Makefile).

> Would the dash maintainers consider replacing 46d3c1a with a fix that
> performs the name validity check at "export -p" time instead? If yes, I can
> try my hand at a patch.

There are probably enough deployments of dash with this behaviour so 
that we need in any case need to remove the use of variables containing 
"." coupled with ".export" from Makefiles.  Changing dash doesn't sound 
useful to me.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dash commit 46d3c1a (in 0.5.8+) breaks BSD make
  2016-03-04 14:24 ` Antti Kantee
@ 2016-03-04 15:48   ` Martin Lucina
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Lucina @ 2016-03-04 15:48 UTC (permalink / raw)
  To: dash, rumpkernel-users

On Friday, 04.03.2016 at 14:24, Antti Kantee wrote:
> On 04/03/16 14:06, Martin Lucina wrote:
> >Commit 46d3c1a ([VAR] Sanitise environment variable names on entry)
> >restricts exported environment variables actually set by dash on entry to
> >those reported as valid by endofname(). While this is technically correct
> >and matches IEEE Std 1003.1, it breaks BSD make which uses '.' as a
> >separator in variables exported via the environment to a sub-make.
> 
> I wouldn't go so far as to say it breaks BSD make.  Rather, it breaks a rare
> pattern where variables containing "." (where "." follows a certain
> convention) are passed to submakes via the shell (i.e. ".export" in the
> Makefile).
> 
> >Would the dash maintainers consider replacing 46d3c1a with a fix that
> >performs the name validity check at "export -p" time instead? If yes, I can
> >try my hand at a patch.
> 
> There are probably enough deployments of dash with this behaviour so that we
> need in any case need to remove the use of variables containing "." coupled
> with ".export" from Makefiles.  Changing dash doesn't sound useful to me.

You're right -- I spoke too soon and thought this behaviour was a general
property of nbmake rather than our specific usage of it. Still, the
maintainers may want to note in dash documentation that sanitizing exported
variables can cause some applications depending on the non-POSIX behaviour
to fail.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-04 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-04 14:06 Dash commit 46d3c1a (in 0.5.8+) breaks BSD make Martin Lucina
2016-03-04 14:24 ` Antti Kantee
2016-03-04 15:48   ` Martin Lucina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).