public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] rfc: bash arrays in OpenRC
@ 2011-07-12  0:38 William Hubbs
  2011-07-12  3:27 ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: William Hubbs @ 2011-07-12  0:38 UTC (permalink / raw
  To: gentoo development

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

Hi all,

this bug was filed against OpenRc today [1]. The issue was that the user
was attempting to use bash arrays, which, as far as I knew are not
supported in OpenRc. The migration guide and net.example both do not use
them, so if the user followed all of the migration steps, they wouldn't be
using them either. That is why I marked this bug invalid.

Further research lead me to find that we have an undocumented way of
supporting bash arrays for some variables in OpenRc, but not others. I
have opened this bug to discuss the topic [2].

bash arrays are not documented anywhere as far as OpenRc  is concerned.
All of the examples in net.example and the
baselayout/openrc migration guide do not use them. Also, this is not a
posix feature, so supporting it technically goes against OpenRc's
design.

I guess what I'm trying to figure out is, what is the technical
advantage for bash arrays as compared to using strings the way things
are shown in net.example?

If there isn't one, would there be a lot of objections to me removing
this code?

Thoughts?

William

[1] http://bugs.gentoo.org/show_bug.cgi?id=374821
[2] http://bugs.gentoo.org/show_bug.cgi?id=374875


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-12  0:38 [gentoo-dev] rfc: bash arrays in OpenRC William Hubbs
@ 2011-07-12  3:27 ` Mike Frysinger
  2011-07-12  4:54   ` William Hubbs
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2011-07-12  3:27 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: Text/Plain, Size: 1387 bytes --]

On Monday, July 11, 2011 20:38:49 William Hubbs wrote:
> this bug was filed against OpenRc today [1]. The issue was that the user
> was attempting to use bash arrays, which, as far as I knew are not
> supported in OpenRc.

they've been supported to ease migration from existing configs.

> bash arrays are not documented anywhere as far as OpenRc  is concerned.

yes, but very little has been historically documented in openrc, so i wouldnt 
take that as a suggestion of intent.

> Also, this is not a posix feature, so supporting it technically goes against
> OpenRc's design.

i dont think this logic follows.  openrc's design is to be usable on top of 
POSIX shells, but not as a requirement.  if you search the mailing list 
archives, i recall Roy having a thread on the topic of bash arrays.

> I guess what I'm trying to figure out is, what is the technical
> advantage for bash arrays as compared to using strings the way things
> are shown in net.example?
> 
> If there isn't one, would there be a lot of objections to me removing
> this code?

i dont think we've had openrc in stable long enough to force people to 
migrate.  so i'd keep the code putting along for now, and add a note to the 
feature removal schedule only after we have checks in the openrc ebuild that 
to catch upgrade paths (and perhaps even do the migration for users).
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-12  3:27 ` Mike Frysinger
@ 2011-07-12  4:54   ` William Hubbs
  2011-07-12  5:09     ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: William Hubbs @ 2011-07-12  4:54 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

Hi Mike,

On Mon, Jul 11, 2011 at 11:27:59PM -0400, Mike Frysinger wrote:
> i dont think we've had openrc in stable long enough to force people to 
> migrate.  so i'd keep the code putting along for now, and add a note to the 
> feature removal schedule only after we have checks in the openrc ebuild that 
> to catch upgrade paths (and perhaps even do the migration for users).

We don't try at all to migrate /etc/conf.d/net; we tell the user to read
/usr/share/doc/openrc-*/net.example and do the migration themselves. Are
you suggesting automating that step? I think it would be tricky to do
that at best since there could be so many different configurations.

Is it possible to use eerror inside the _flatten_array and _get_array
functions some how so that they will complain when they are used to
parse bash arrays?

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-12  4:54   ` William Hubbs
@ 2011-07-12  5:09     ` Mike Frysinger
  2011-07-12 11:12       ` Rich Freeman
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2011-07-12  5:09 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: Text/Plain, Size: 1387 bytes --]

On Tuesday, July 12, 2011 00:54:02 William Hubbs wrote:
> On Mon, Jul 11, 2011 at 11:27:59PM -0400, Mike Frysinger wrote:
> > i dont think we've had openrc in stable long enough to force people to
> > migrate.  so i'd keep the code putting along for now, and add a note to
> > the feature removal schedule only after we have checks in the openrc
> > ebuild that to catch upgrade paths (and perhaps even do the migration
> > for users).
> 
> We don't try at all to migrate /etc/conf.d/net; we tell the user to read
> /usr/share/doc/openrc-*/net.example and do the migration themselves. Are
> you suggesting automating that step? I think it would be tricky to do
> that at best since there could be so many different configurations.

it would be nice to come up with some level of automated conversion.  no 
matter how much we say "read the docs", there will always be people who do 
not.  i think the reason the openrc upgrade has gone so smooth thus far is 
because how much we've done to auto-migrate settings.

> Is it possible to use eerror inside the _flatten_array and _get_array
> functions some how so that they will complain when they are used to
> parse bash arrays?

you can add an ewarn now while continuing to parse the code.  but the same 
issue as above ... there are many systems which are headless where these will 
not generally be seen.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-12  5:09     ` Mike Frysinger
@ 2011-07-12 11:12       ` Rich Freeman
  2011-07-12 14:23         ` William Hubbs
  2011-07-12 15:54         ` Mike Frysinger
  0 siblings, 2 replies; 10+ messages in thread
From: Rich Freeman @ 2011-07-12 11:12 UTC (permalink / raw
  To: gentoo-dev

On Tue, Jul 12, 2011 at 1:09 AM, Mike Frysinger <vapier@gentoo.org> wrote:
>
> it would be nice to come up with some level of automated conversion.  no
> matter how much we say "read the docs", there will always be people who do
> not.  i think the reason the openrc upgrade has gone so smooth thus far is
> because how much we've done to auto-migrate settings.
>

True, but wouldn't any further improvement in migration be essentially
fixing the barn doors after the horses have left?  What percentage of
our users are still running baselayout-1 now?  The fact that things
have gone fairly smoothly suggests to me that further investment in
migration code isn't going to yield much benefit.  I'd just leave it
all alone for a few months or whatever to let people finish migrating
and then start triggering deprecation warnings.  In fact, there is no
reason to not generate deprecation warnings now - when openrc
migration is still fresh in everybody's minds.

Rich



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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-12 11:12       ` Rich Freeman
@ 2011-07-12 14:23         ` William Hubbs
  2011-07-12 15:54         ` Mike Frysinger
  1 sibling, 0 replies; 10+ messages in thread
From: William Hubbs @ 2011-07-12 14:23 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]

On Tue, Jul 12, 2011 at 07:12:45AM -0400, Rich Freeman wrote:
> On Tue, Jul 12, 2011 at 1:09 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> >
> > it would be nice to come up with some level of automated conversion.  no
> > matter how much we say "read the docs", there will always be people who do
> > not.  i think the reason the openrc upgrade has gone so smooth thus far is
> > because how much we've done to auto-migrate settings.
> >
> 
> True, but wouldn't any further improvement in migration be essentially
> fixing the barn doors after the horses have left?  What percentage of
> our users are still running baselayout-1 now?  The fact that things
> have gone fairly smoothly suggests to me that further investment in
> migration code isn't going to yield much benefit.

I tend to agree with this angle. I do not see any reason to change the
migration code; we should have done that before we took OpenRc stable if
we were going to imho.

> I'd just leave it
> all alone for a few months or whatever to let people finish migrating
> and then start triggering deprecation warnings.  In fact, there is no
> reason to not generate deprecation warnings now - when openrc
> migration is still fresh in everybody's minds.

I agree more with this than attempting to do a migration. I will look
into getting deprecation warnings into the code.

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-12 11:12       ` Rich Freeman
  2011-07-12 14:23         ` William Hubbs
@ 2011-07-12 15:54         ` Mike Frysinger
  2011-07-13 17:36           ` Ed W
  1 sibling, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2011-07-12 15:54 UTC (permalink / raw
  To: gentoo-dev

On Tue, Jul 12, 2011 at 07:12, Rich Freeman wrote:
> On Tue, Jul 12, 2011 at 1:09 AM, Mike Frysinger wrote:
>> it would be nice to come up with some level of automated conversion.  no
>> matter how much we say "read the docs", there will always be people who do
>> not.  i think the reason the openrc upgrade has gone so smooth thus far is
>> because how much we've done to auto-migrate settings.
>>
>
> True, but wouldn't any further improvement in migration be essentially
> fixing the barn doors after the horses have left?  What percentage of
> our users are still running baselayout-1 now?

baselayout-1 vs openrc isnt the issue.  it's bash array support vs
flat strings.  the former is supported in baselayout-1, and should be
supported in openrc.  William is talking about dropping support from
openrc and i've laid out the way to get from here to there.
-mike



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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-12 15:54         ` Mike Frysinger
@ 2011-07-13 17:36           ` Ed W
  2011-07-13 18:19             ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Ed W @ 2011-07-13 17:36 UTC (permalink / raw
  To: gentoo-dev

On 12/07/2011 16:54, Mike Frysinger wrote:
> baselayout-1 vs openrc isnt the issue.  it's bash array support vs
> flat strings.  the former is supported in baselayout-1, and should be
> supported in openrc.  William is talking about dropping support from
> openrc and i've laid out the way to get from here to there.
> -mike

The original vision for OpenRC was that it should be posix compliant.
Please don't revert to using bash features because it creates a
dependency on bash that then makes it hard to support "small" platforms
such as busybox

At present OpenRC works very nicely on a minimal (embedded) system using
uclibc/busybox in a couple of MB.  Its also decently fast and "oldnet"
actually seems to work quite nicely for a headless, but heavily dynamic
environment like a router with USB things getting plugged/unplugged

Thanks for listening...

Ed W



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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-13 17:36           ` Ed W
@ 2011-07-13 18:19             ` Mike Frysinger
  2011-07-13 18:32               ` Ed W
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2011-07-13 18:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: Text/Plain, Size: 704 bytes --]

On Wednesday, July 13, 2011 13:36:29 Ed W wrote:
> On 12/07/2011 16:54, Mike Frysinger wrote:
> > baselayout-1 vs openrc isnt the issue.  it's bash array support vs
> > flat strings.  the former is supported in baselayout-1, and should be
> > supported in openrc.  William is talking about dropping support from
> > openrc and i've laid out the way to get from here to there.
> 
> The original vision for OpenRC was that it should be posix compliant.
> Please don't revert to using bash features because it creates a
> dependency on bash that then makes it hard to support "small" platforms
> such as busybox

please read the thread (again?).  no one is talking about requiring bash.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-dev] rfc: bash arrays in OpenRC
  2011-07-13 18:19             ` Mike Frysinger
@ 2011-07-13 18:32               ` Ed W
  0 siblings, 0 replies; 10+ messages in thread
From: Ed W @ 2011-07-13 18:32 UTC (permalink / raw
  To: gentoo-dev

On 13/07/2011 19:19, Mike Frysinger wrote:
> On Wednesday, July 13, 2011 13:36:29 Ed W wrote:
>> On 12/07/2011 16:54, Mike Frysinger wrote:
>>> baselayout-1 vs openrc isnt the issue.  it's bash array support vs
>>> flat strings.  the former is supported in baselayout-1, and should be
>>> supported in openrc.  William is talking about dropping support from
>>> openrc and i've laid out the way to get from here to there.
>>
>> The original vision for OpenRC was that it should be posix compliant.
>> Please don't revert to using bash features because it creates a
>> dependency on bash that then makes it hard to support "small" platforms
>> such as busybox
> 
> please read the thread (again?).  no one is talking about requiring bash.
> -mike

Fair enough.  I misunderstood "we should support bash arrays" as meaning
"bash will become required"...

Openrc works very nicely - many thanks to all who built and maintain it!

Ed W



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

end of thread, other threads:[~2011-07-13 18:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-12  0:38 [gentoo-dev] rfc: bash arrays in OpenRC William Hubbs
2011-07-12  3:27 ` Mike Frysinger
2011-07-12  4:54   ` William Hubbs
2011-07-12  5:09     ` Mike Frysinger
2011-07-12 11:12       ` Rich Freeman
2011-07-12 14:23         ` William Hubbs
2011-07-12 15:54         ` Mike Frysinger
2011-07-13 17:36           ` Ed W
2011-07-13 18:19             ` Mike Frysinger
2011-07-13 18:32               ` Ed W

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox