public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: Virtual for awk implementation
@ 2012-05-30  0:11 Christoph Junghans
  2012-05-30 18:29 ` Florian Philipp
  2012-06-04  2:09 ` [gentoo-dev] " Christoph Junghans
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Junghans @ 2012-05-30  0:11 UTC (permalink / raw
  To: gentoo-dev

Hi,

recently I stumbled across a problem with mawk, which is apprearly
Ubuntu's default awk interpreter.
This brought the idea to my mind of adding a virtual for awk. Beside
the fact that we already have 3 awk interpreters in gx86 (gawk, mawk
and busybox awk), there are other ones like nawk and awka.

I had some discussions with spanKY on that topic in bug #415689, which
summarizes in the following:

Advantages:
- mawk is faster - useful for scientific purposes
- busybox awk could replace gawk on minimal systems
- more POSIX conform systems

Disadvantages:
- some awk code in the tree and portage is probably using GNU
extensions without executing gawk explicitly
- gray zone of Posix 1003.2  (e.g. substr() function and an index of 0)

What we would need:
- virtual/awk
- app-admin/eselect-awk (version available in cj-overlay)
and
- testing and migration of existing packages using gawk
<http://qa-reports.gentoo.org/output/genrdeps/rindex/sys-apps/gawk>
and
<http://qa-reports.gentoo.org/output/genrdeps/dindex/sys-apps/gawk>
to name a few.

I have tested mawk as default interpreter for a while on my x86 boxes
and didn't observed any problems so far.

Cheers,

Christoph

-- 
Christoph Junghans
http://dev.gentoo.org/~ottxor/



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

* Re: [gentoo-dev] RFC: Virtual for awk implementation
  2012-05-30  0:11 [gentoo-dev] RFC: Virtual for awk implementation Christoph Junghans
@ 2012-05-30 18:29 ` Florian Philipp
  2012-05-30 18:39   ` Florian Philipp
  2012-06-04  2:09 ` [gentoo-dev] " Christoph Junghans
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Philipp @ 2012-05-30 18:29 UTC (permalink / raw
  To: gentoo-dev

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

Am 30.05.2012 02:11, schrieb Christoph Junghans:
> Hi,
> 
> recently I stumbled across a problem with mawk, which is apprearly
> Ubuntu's default awk interpreter.
> This brought the idea to my mind of adding a virtual for awk. Beside
> the fact that we already have 3 awk interpreters in gx86 (gawk, mawk
> and busybox awk), there are other ones like nawk and awka.
> 
> I had some discussions with spanKY on that topic in bug #415689, which
> summarizes in the following:
> 
> Advantages:
> - mawk is faster - useful for scientific purposes
> - busybox awk could replace gawk on minimal systems
> - more POSIX conform systems
> 
> Disadvantages:
> - some awk code in the tree and portage is probably using GNU
> extensions without executing gawk explicitly
> - gray zone of Posix 1003.2  (e.g. substr() function and an index of 0)
> 
[...]
>
> I have tested mawk as default interpreter for a while on my x86 boxes
> and didn't observed any problems so far.
> 
> Cheers,
> 
> Christoph
> 

An easy easy way to crash mawk is opening many different files.

mkdir -p mkdir /tmp/foo; find "$HOME" -type f -printf '%f %s\n' | \
	gawk '{ print $2 > "/tmp/foo/" $1 }'

--> Fills /tmp/foo with small files

mkdir -p mkdir /tmp/foo; find "$HOME" -type f -printf '%f %s\n' | \
	mawk '{ print $2 > "/tmp/foo/" $1 }'

--> Crashes with error 'mawk: cannot open "/tmp/foo/7B090d01" for output
(Too many open files)'

Probably not the cleverest approach to this but just a reminder that
there are still subtle differences.

That being said, +1 for giving the choice.

Regards,
Florian Philipp


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* Re: [gentoo-dev] RFC: Virtual for awk implementation
  2012-05-30 18:29 ` Florian Philipp
@ 2012-05-30 18:39   ` Florian Philipp
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Philipp @ 2012-05-30 18:39 UTC (permalink / raw
  To: gentoo-dev

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

Am 30.05.2012 20:29, schrieb Florian Philipp:
> 
> mkdir -p mkdir /tmp/foo; find "$HOME" -type f -printf '%f %s\n' | \
> 	gawk '{ print $2 > "/tmp/foo/" $1 }'
> 
> --> Fills /tmp/foo with small files
> 
> mkdir -p mkdir /tmp/foo; find "$HOME" -type f -printf '%f %s\n' | \
> 	mawk '{ print $2 > "/tmp/foo/" $1 }'
> 
> --> Crashes with error 'mawk: cannot open "/tmp/foo/7B090d01" for output
> (Too many open files)'
> 
> Probably not the cleverest approach to this but just a reminder that
> there are still subtle differences.
> 
> That being said, +1 for giving the choice.
> 
> Regards,
> Florian Philipp

s/mkdir -p mkdir/mkdir -p/g



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* [gentoo-dev] Re: RFC: Virtual for awk implementation
  2012-05-30  0:11 [gentoo-dev] RFC: Virtual for awk implementation Christoph Junghans
  2012-05-30 18:29 ` Florian Philipp
@ 2012-06-04  2:09 ` Christoph Junghans
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Junghans @ 2012-06-04  2:09 UTC (permalink / raw
  To: gentoo-dev

No objections and 2x +1, so I will commit  virtual/awk to ~arch and
app-admin/eselect-awk to ~arch & masked for testing.

Please port packages to virtual/awk (if possible) and make bug reports
block on the awk porting tracker (bug #418473).

2012/5/29 Christoph Junghans <ottxor@gentoo.org>:
> Hi,
>
> recently I stumbled across a problem with mawk, which is apprearly
> Ubuntu's default awk interpreter.
> This brought the idea to my mind of adding a virtual for awk. Beside
> the fact that we already have 3 awk interpreters in gx86 (gawk, mawk
> and busybox awk), there are other ones like nawk and awka.
>
> I had some discussions with spanKY on that topic in bug #415689, which
> summarizes in the following:
>
> Advantages:
> - mawk is faster - useful for scientific purposes
> - busybox awk could replace gawk on minimal systems
> - more POSIX conform systems
>
> Disadvantages:
> - some awk code in the tree and portage is probably using GNU
> extensions without executing gawk explicitly
> - gray zone of Posix 1003.2  (e.g. substr() function and an index of 0)
>
> What we would need:
> - virtual/awk
> - app-admin/eselect-awk (version available in cj-overlay)
> and
> - testing and migration of existing packages using gawk
> <http://qa-reports.gentoo.org/output/genrdeps/rindex/sys-apps/gawk>
> and
> <http://qa-reports.gentoo.org/output/genrdeps/dindex/sys-apps/gawk>
> to name a few.
>
> I have tested mawk as default interpreter for a while on my x86 boxes
> and didn't observed any problems so far.
>
> Cheers,
>
> Christoph
>
> --
> Christoph Junghans
> http://dev.gentoo.org/~ottxor/



-- 
Christoph Junghans
http://dev.gentoo.org/~ottxor/



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

end of thread, other threads:[~2012-06-04  2:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30  0:11 [gentoo-dev] RFC: Virtual for awk implementation Christoph Junghans
2012-05-30 18:29 ` Florian Philipp
2012-05-30 18:39   ` Florian Philipp
2012-06-04  2:09 ` [gentoo-dev] " Christoph Junghans

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