Re: [perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-08-22 Thread Reini Urban
This is where I stand now, and as it is in the 0.7.0 cygwin package.

It works fine, but slow.
There's a new installed key in the config hash, and the code to check this in
library.c is ifdef'ed out as it generates a VM out of memory error.


2008/8/9 Reini Urban <[EMAIL PROTECTED]>:
> Reini Urban schrieb:
>>
>> Reini Urban schrieb:
>>>
>>> Geoffrey Broadwell via RT schrieb:

 On Sun, 2008-07-27 at 13:13 +0200, Reini Urban wrote:
>
> +stat $I0, conf_file, 0
> +if $I0 goto conf
> ++# If installed into /usr/lib/parrot, not /usr/runtime/parrot
> +# This logic has to be reversed when installed versions should
> run faster
> +# than source builds.

 Reverse it now; we'll never remember to get back to this in the future.

> +conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
> +conf_file .= "/lib/parrot/include/config.fpmc"
> +conf:

> +name = interpinfo .INTERPINFO_RUNTIME_PREFIX
> +concat name, "lib/parrot/dynext/"
> concat name, request

 Since we're using PIR in both places, we should probably use the .=
 sugar in both places.  Yes, I know the second file has some 'concat's in
 it already.  Here's an opportunity to fix that.  :-)
>>>
>>> Ok. concat to .= is easy.
>>>
>>> Why I don't want to fix that as you suggest is that I wait for feedback
>>> how it was designed to be. This patch is just a intermediate hack. Someone
>>> like particle or Allison should comment on that.
>>>
>>> It is fine for benchmarks that the source build uses
>>> runtime/parrot/include/config.fpmc.
>>> But the installed version either should NOT need to load the frozen
>>> config file when it is already linked in, or check with some global or
>>> interpinfo magic and look up the right prefix then.
>>> No useless stats please.
>>
>> My current plan is this:
>>
>> Source builds should be allowed to access
>> runtime/parrot/include/config.fpmc and the various other config fpmc's, but
>> the installable version, linked to install_config.fpmc must change its
>> lib_path to allow only FHS-compliant paths,
>> i.e remove runtime/parrot and runtime/parrot/include in favor of
>> lib/parrot and lib/parrot/include.
>>
>> This must be fixed in config.pir, parrotlib.pir and src/library.c with
>> this ticket. (Hope I forgot no other file)
>> I'll work on that, but I have a business trip for the next two weeks.
>>
>> An optimization for another ticket would be to remove the run-time access
>> to include/config.pir for linked installable's, where the frozen config.fpmc
>> is already linked. There the sub _config should use some config detection
>> logic (suggestion: new config key 'installed') to omit .include
>> "library/config.pir"
>> See the ticket perl #57418 [TODO] optimize _config to omit .include
>> "library/config.pir" on installables
>
> Attached is an improved version with a fix in src/library.c, to decide
> between installed and not installed configs.
> This solves at least the /usr/runtime problem.
>
> However config.pir still unnecessarily tries to access some runtime files,
> esp. "interpinfo.pasm" to get the index of .INTERPINFO_RUNTIME_PREFIX
> I'm toying with the idea to fill that macro in parrotlib.pir and config.pir
> with config/gen/parrot_include.pm.

-- 
Reini Urban
http://phpwiki.org/ http://murbreak.at/
Remove stats to /usr/runtime/parrot at installed versions
("/usr" being the prefix).
Check the config_hash for the installed key and the 
interpreter INTERPINFO_RUNTIME_PREFIX or CONFIG_HASH if present.

The library.c code is not working yet with ENABLE_PARROT_LIBRARY_INSTALLED
Parrot VM: PANIC: Out of mem!
Not enough tuits yet to fix and debug it.

Index: parrot-svn/runtime/parrot/library/config.pir
===
--- parrot-svn.orig/runtime/parrot/library/config.pir
+++ parrot-svn/runtime/parrot/library/config.pir
@@ -48,12 +48,28 @@ undefined values) is undefined, and may 
 .sub _config
 .local pmc CONF
 .local string conf_file
+
+#unless find_sub('_config') goto runtime
+#$P0 = _config()
+#.return( $P0 )
+
+runtime:
+# conf_file = Parrot_locate_runtime_file_str(interp, "config.fpmc", 2)
 conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
 conf_file .= "/runtime/parrot/include/config.fpmc"
+stat $I0, conf_file, 0
+if $I0 goto conf
 
+# If installed into /usr/lib/parrot, not /usr/runtime/parrot
+# This logic has to be reversed when installed versions should run faster
+# than source builds.
+conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
+conf_file .= "/lib/parrot/include/config.fpmc"
+conf:
 open CONF, conf_file, "<"
 $I0 = defined CONF
 if $I0 goto ok1
+
 printerr "Can't read '"
 printerr conf_file
 printerr "': "
Index: parrot-svn/runtime/parrot/library/parrotlib.pir
===
--- parrot-svn.orig/run

Re: [perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-08-09 Thread Reini Urban

Reini Urban schrieb:

Reini Urban schrieb:

Geoffrey Broadwell via RT schrieb:

On Sun, 2008-07-27 at 13:13 +0200, Reini Urban wrote:

+stat $I0, conf_file, 0
+if $I0 goto conf
++# If installed into /usr/lib/parrot, not /usr/runtime/parrot
+# This logic has to be reversed when installed versions should
run faster
+# than source builds.


Reverse it now; we'll never remember to get back to this in the future.


+conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
+conf_file .= "/lib/parrot/include/config.fpmc"
+conf:



+name = interpinfo .INTERPINFO_RUNTIME_PREFIX
+concat name, "lib/parrot/dynext/"
 concat name, request


Since we're using PIR in both places, we should probably use the .=
sugar in both places.  Yes, I know the second file has some 'concat's in
it already.  Here's an opportunity to fix that.  :-)


Ok. concat to .= is easy.

Why I don't want to fix that as you suggest is that I wait for 
feedback how it was designed to be. This patch is just a intermediate 
hack. Someone like particle or Allison should comment on that.


It is fine for benchmarks that the source build uses 
runtime/parrot/include/config.fpmc.
But the installed version either should NOT need to load the frozen 
config file when it is already linked in, or check with some global or 
interpinfo magic and look up the right prefix then.

No useless stats please.


My current plan is this:

Source builds should be allowed to access 
runtime/parrot/include/config.fpmc and the various other config fpmc's, 
but the installable version, linked to install_config.fpmc must change 
its lib_path to allow only FHS-compliant paths,
i.e remove runtime/parrot and runtime/parrot/include in favor of 
lib/parrot and lib/parrot/include.


This must be fixed in config.pir, parrotlib.pir and src/library.c with 
this ticket. (Hope I forgot no other file)

I'll work on that, but I have a business trip for the next two weeks.

An optimization for another ticket would be to remove the run-time 
access to include/config.pir for linked installable's, where the frozen 
config.fpmc is already linked. There the sub _config should use some 
config detection logic (suggestion: new config key 'installed') to omit 
.include "library/config.pir"
See the ticket perl #57418 [TODO] optimize _config to omit .include 
"library/config.pir" on installables


Attached is an improved version with a fix in src/library.c, to decide 
between installed and not installed configs.

This solves at least the /usr/runtime problem.

However config.pir still unnecessarily tries to access some runtime 
files, esp. "interpinfo.pasm" to get the index of .INTERPINFO_RUNTIME_PREFIX
I'm toying with the idea to fill that macro in parrotlib.pir and 
config.pir with config/gen/parrot_include.pm.

--
Reini Urban
http://phpwiki.org/  http://murbreak.at/
Remove stats to /usr/runtime/parrot at installed versions
("/usr" being the prefix).
Check the config_hash for the installed key and the 
interpreter INTERPINFO_RUNTIME_PREFIX or CONFIG_HASH if present.

Index: parrot-svn/runtime/parrot/library/config.pir
===
--- parrot-svn.orig/runtime/parrot/library/config.pir
+++ parrot-svn/runtime/parrot/library/config.pir
@@ -48,12 +48,28 @@ undefined values) is undefined, and may 
 .sub _config
 .local pmc CONF
 .local string conf_file
+
+#unless find_sub('_config') goto runtime
+#$P0 = _config()
+#.return( $P0 )
+
+runtime:
+# conf_file = Parrot_locate_runtime_file_str(interp, "config.fpmc", 2)
 conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
 conf_file .= "/runtime/parrot/include/config.fpmc"
+stat $I0, conf_file, 0
+if $I0 goto conf
 
+# If installed into /usr/lib/parrot, not /usr/runtime/parrot
+# This logic has to be reversed when installed versions should run faster
+# than source builds.
+conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
+conf_file .= "/lib/parrot/include/config.fpmc"
+conf:
 open CONF, conf_file, "<"
 $I0 = defined CONF
 if $I0 goto ok1
+
 printerr "Can't read '"
 printerr conf_file
 printerr "': "
Index: parrot-svn/runtime/parrot/library/parrotlib.pir
===
--- parrot-svn.orig/runtime/parrot/library/parrotlib.pir
+++ parrot-svn/runtime/parrot/library/parrotlib.pir
@@ -24,8 +24,13 @@ parrotlib's interface functions.
 .local pmc includes
 .local string root
 
+# TODO: update INTERPINFO_RUNTIME_PREFIX from include/parrot/resources.h
+# via config/gen/parrot_include.pm
+# get root from INTERPINFO_RUNTIME_PREFIX	21
+#root = interpinfo 21
+#length $I0, root
+#if $I0 > 0 goto OKAY
 
-# XXX todo: get root from config
 $P0 = new 'Env'
 root = $P0["PARROT_RUNTIME_ROOT"]
 length $I0, root
@@ -143,8 +148,19 @@ Returns the location of a dynamic extens
 stat $I0, name, 0
 if $I0 goto EN

Re: [perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-07-30 Thread Reini Urban

Reini Urban schrieb:

Geoffrey Broadwell via RT schrieb:

On Sun, 2008-07-27 at 13:13 +0200, Reini Urban wrote:

+stat $I0, conf_file, 0
+if $I0 goto conf
++# If installed into /usr/lib/parrot, not /usr/runtime/parrot
+# This logic has to be reversed when installed versions should
run faster
+# than source builds.


Reverse it now; we'll never remember to get back to this in the future.


+conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
+conf_file .= "/lib/parrot/include/config.fpmc"
+conf:



+name = interpinfo .INTERPINFO_RUNTIME_PREFIX
+concat name, "lib/parrot/dynext/"
 concat name, request


Since we're using PIR in both places, we should probably use the .=
sugar in both places.  Yes, I know the second file has some 'concat's in
it already.  Here's an opportunity to fix that.  :-)


Ok. concat to .= is easy.

Why I don't want to fix that as you suggest is that I wait for feedback 
how it was designed to be. This patch is just a intermediate hack. 
Someone like particle or Allison should comment on that.


It is fine for benchmarks that the source build uses 
runtime/parrot/include/config.fpmc.
But the installed version either should NOT need to load the frozen 
config file when it is already linked in, or check with some global or 
interpinfo magic and look up the right prefix then.

No useless stats please.


My current plan is this:

Source builds should be allowed to access 
runtime/parrot/include/config.fpmc and the various other config fpmc's, 
but the installable version, linked to install_config.fpmc must change 
its lib_path to allow only FHS-compliant paths,
i.e remove runtime/parrot and runtime/parrot/include in favor of 
lib/parrot and lib/parrot/include.


This must be fixed in config.pir, parrotlib.pir and src/library.c with 
this ticket. (Hope I forgot no other file)

I'll work on that, but I have a business trip for the next two weeks.

An optimization for another ticket would be to remove the run-time 
access to include/config.pir for linked installable's, where the frozen 
config.fpmc is already linked. There the sub _config should use some 
config detection logic (suggestion: new config key 'installed') to omit 
.include "library/config.pir"
See the ticket perl #57418 [TODO] optimize _config to omit .include 
"library/config.pir" on installables


--
Reini Urban
http://phpwiki.org/  http://murbreak.at/


Re: [perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-07-28 Thread Reini Urban

Geoffrey Broadwell via RT schrieb:

On Sun, 2008-07-27 at 13:13 +0200, Reini Urban wrote:

+stat $I0, conf_file, 0
+if $I0 goto conf
+
+# If installed into /usr/lib/parrot, not /usr/runtime/parrot

+# This logic has to be reversed when installed versions should
run faster
+# than source builds.


Reverse it now; we'll never remember to get back to this in the future.


+conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
+conf_file .= "/lib/parrot/include/config.fpmc"
+conf:



+name = interpinfo .INTERPINFO_RUNTIME_PREFIX
+concat name, "lib/parrot/dynext/"
 concat name, request


Since we're using PIR in both places, we should probably use the .=
sugar in both places.  Yes, I know the second file has some 'concat's in
it already.  Here's an opportunity to fix that.  :-)


Ok. concat to .= is easy.

Why I don't want to fix that as you suggest is that I wait for feedback 
how it was designed to be. This patch is just a intermediate hack. 
Someone like particle or Allison should comment on that.


It is fine for benchmarks that the source build uses 
runtime/parrot/include/config.fpmc.
But the installed version either should NOT need to load the frozen 
config file when it is already linked in, or check with some global or 
interpinfo magic and look up the right prefix then.

No useless stats please.
--
Reini Urban
http://phpwiki.org/  http://murbreak.at/


Re: [perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-07-27 Thread Geoffrey Broadwell
On Sun, 2008-07-27 at 13:13 +0200, Reini Urban wrote:
> +stat $I0, conf_file, 0
> +if $I0 goto conf
> +
> +# If installed into /usr/lib/parrot, not /usr/runtime/parrot
> +# This logic has to be reversed when installed versions should
> run faster
> +# than source builds.

Reverse it now; we'll never remember to get back to this in the future.

> +conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
> +conf_file .= "/lib/parrot/include/config.fpmc"
> +conf:

> +name = interpinfo .INTERPINFO_RUNTIME_PREFIX
> +concat name, "lib/parrot/dynext/"
>  concat name, request

Since we're using PIR in both places, we should probably use the .=
sugar in both places.  Yes, I know the second file has some 'concat's in
it already.  Here's an opportunity to fix that.  :-)


-'f




Re: [perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-07-27 Thread Reini Urban

Reini Urban (via RT) schrieb:

Remove
   /usr/runtime/parrot/include
   /usr/runtime/parrot
   /usr
paths from the .include searchpath.
I found this out via strace on cygwin.


Attached patch tries at least /usr/lib/parrot when /usr/runtime/parrot 
fails. As soon as installed versions should run faster than source 
builds the logic has to be reversed.


--
Reini Urban
http://phpwiki.org/  http://murbreak.at/
difforig runtime/parrot/library/config.pir runtime/parrot/library/parrotlib.pir

diff -u runtime/parrot/library/config.pir.orig runtime/parrot/library/config.pir
--- runtime/parrot/library/config.pir.orig	2008-07-05 10:04:43.0 +
+++ runtime/parrot/library/config.pir	2008-07-27 11:06:40.84375 +
@@ -50,10 +50,19 @@
 .local string conf_file
 conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
 conf_file .= "/runtime/parrot/include/config.fpmc"
-
+stat $I0, conf_file, 0
+if $I0 goto conf
+
+# If installed into /usr/lib/parrot, not /usr/runtime/parrot
+# This logic has to be reversed when installed versions should run faster
+# than source builds.
+conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
+conf_file .= "/lib/parrot/include/config.fpmc"
+conf:
 open CONF, conf_file, "<"
 $I0 = defined CONF
 if $I0 goto ok1
+
 printerr "Can't read '"
 printerr conf_file
 printerr "': "
diff -u runtime/parrot/library/parrotlib.pir.orig runtime/parrot/library/parrotlib.pir
--- runtime/parrot/library/parrotlib.pir.orig	2008-02-23 18:27:07.0 +
+++ runtime/parrot/library/parrotlib.pir	2008-07-27 11:07:12.734375000 +
@@ -143,8 +143,19 @@
 stat $I0, name, 0
 if $I0 goto END
 
-name = "runtime/parrot/dynext/"
+concat name, ext
+stat $I0, name, 0
+if $I0 goto END
+
+# This logic has to be reversed when installed versions should run faster
+# than source builds.
+.include "interpinfo.pasm"
+name = interpinfo .INTERPINFO_RUNTIME_PREFIX
+concat name, "lib/parrot/dynext/"
 concat name, request
+stat $I0, name, 0
+if $I0 goto END
+
 concat name, ext
 stat $I0, name, 0
 if $I0 goto END


Re: [perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-07-16 Thread Geoffrey Broadwell
On Wed, 2008-07-16 at 10:04 -0700, Reini Urban wrote:
> Remove
>/usr/runtime/parrot/include
>/usr/runtime/parrot
>/usr
> paths from the .include searchpath.

+1 for not adding these to the searchpath by default.

(We shouldn't do something messed up like adding them in one place, and
then removing them in another.)


-'f




[perl #56996] [TODO] remove non FHS-compliant searchpaths

2008-07-16 Thread via RT
# New Ticket Created by  Reini Urban 
# Please include the string:  [perl #56996]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=56996 >


---
osname= cygwin
osvers= 1.5.25(0.15642)
arch=   cygwin-thread-multi-64int
cc= gcc
---
Flags:
 category=core
 severity=medium
 ack=no
---
Remove
   /usr/runtime/parrot/include
   /usr/runtime/parrot
   /usr
paths from the .include searchpath.
I found this out via strace on cygwin.

---
Summary of my parrot 0.6.3 (r28667) configuration:
   configdate='Sun Jul  6 00:26:20 2008 GMT'
   Platform:
 osname=cygwin, archname=cygwin-thread-multi-64int
 jitcapable=1, jitarchname=i386-cygwin,
 jitosname=CYGWIN, jitcpuarch=i386
 execcapable=1
 perl=/usr/bin/perl5.10.0.exe
   Compiler:
 cc='gcc', ccflags='-U__STRICT_ANSI__  -pipe -I/usr/local/include
-DHASATTRIBUTE_CONST  -DHASATTRIBUTE_DEPRECATED  -DHASATTRIBUTE_MALLOC
-DHASATTRIBUTE_NONNULL  -DHASATTRIBUTE_NORETURN  -DHASATTRIBUTE_PURE
-DHASATTRIBUTE_UNUSED  -DHASATTRIBUTE_WARN_UNUSED_RESULT
-falign-functions=16 -maccumulate-outgoing-args -W -Wall
-Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment
-Wdisabled-optimization -Wendif-labels -Wextra -Wformat
-Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k
-Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces
-Wno-missing-format-attribute -Wpacked -Wparentheses -Wpointer-arith
-Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare
-Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default
-Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wwrite-strings
-Wbad-function-cast -Wdeclaration-after-statement
-Wimplicit-function-declaration -Wimplicit-int -Wmain
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull
-DDISABLE_GC_DEBUG=1 -DNDEBUG -O3 -DHAS_GETTEXT',
   Linker and Libraries:
 ld='gcc', ldflags=' -Wl,--enable-auto-import
-Wl,--export-all-symbols -Wl,--stack,8388608
-Wl,--enable-auto-image-base -L/usr/local/lib',
 cc_ldflags='',
 libs='-ldl -lcrypt -lgmp -lreadline -lpcre -lglut32 -lglu32
-lopengl32 -lcrypto -lintl'
   Dynamic Linking:
 share_ext='.dll', ld_share_flags='-shared',
 load_ext='.dll', ld_load_flags='-shared'
   Types:
 iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
 ptrsize=4, ptr_alignment=1 byteorder=1234,
 nv=double, numvalsize=8, doublesize=8

---
Environment:
 CYGWIN =server
 HOME =/home/rurban
 LANG  (unset)
 LANGUAGE  (unset)
 LD_LIBRARY_PATH  (unset)
 LOGDIR  (unset)
 PATH
=/usr/src/perl/parrot/parrot-0.6.3-1/build/blib/lib:~/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/usr/bin:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Programme/ATI
 

Technologies/ATI.ACE/Core-Static:/usr/local/bin:/usr/lib/gstreamer-0.8:/usr/lib/lapack
 SHELL  (unset)