Closed p5pRT closed 12 years ago
See patch's message\, and http://www.nntp.perl.org/group/perl.perl5.porters/2012/10/msg194007.html for which there were no responses.
I wonder if it would be better to not bother with the WIN32_NO_SOCKETS option\, and simply always remove sockets for miniperl (only)?
You've worked around the one current place in the build process that required sockets\, so it's really a question of how likely it is for any other such things (but having no easy workaround/alternative) to occur in the future.
Do any other porters with an interest in Windows and/or the build process have an opinion on this?
If it seems sufficiently unlikely then I personally see no point in the WIN32_NO_SOCKETS option since I don't think I'd ever want to build a (full) perl without sockets (and as noted in your patch\, that is not completely implemented anyway).
The RT System itself - Status changed from 'new' to 'open'
On Wed Oct 17 16:16:42 2012\, shay wrote:
I wonder if it would be better to not bother with the WIN32_NO_SOCKETS option\, and simply always remove sockets for miniperl (only)?
You've worked around the one current place in the build process that required sockets\, so it's really a question of how likely it is for any other such things (but having no easy workaround/alternative) to occur in the future.
Do any other porters with an interest in Windows and/or the build process have an opinion on this?
Will it affect minitest?
--
Father Chrysostomos
On Wed\, Oct 17\, 2012 at 4:16 PM\, Steve Hay via RT \perlbug\-followup@​perl\.org wrote:
Do any other porters with an interest in Windows and/or the build process have an opinion on this?
I don't see the point in doing these micro-optimizations for miniperl\, as I never use it for anything but building Perl. But I don't have any objections either as long as miniperl can still build Perl. :)
Cheers\, -Jan
On Wed Oct 17 16:20:22 2012\, sprout wrote:
On Wed Oct 17 16:16:42 2012\, shay wrote:
I wonder if it would be better to not bother with the WIN32_NO_SOCKETS option\, and simply always remove sockets for miniperl (only)?
You've worked around the one current place in the build process that required sockets\, so it's really a question of how likely it is for any other such things (but having no easy workaround/alternative) to occur in the future.
Do any other porters with an interest in Windows and/or the build process have an opinion on this?
Will it affect minitest?
Good question. I guess there's little reason for minitest to be testing anything that isn't done during the build process anyway since miniperl is rarely (if ever?) used for anything other than building perl\, so in theory I think it shouldn't be affected.
However\, in practice (testing that theory out) I've just discovered that minitest is broken anyway (at least on Windows): with or without this patch I get:
cd ..\t && ..\miniperl.exe -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t Can't load module IO\, dynamic loading not available in this perl. (You may need to build a new perl executable which either supports dynamic loading or has the IO module statically linked into it.) at ../lib/IO/Handle.pm line 266. Compilation failed in require at ../lib/IO/Handle.pm line 266. BEGIN failed--compilation aborted at ../lib/IO/Handle.pm line 266. Compilation failed in require at ../lib/TAP/Harness.pm line 8. BEGIN failed--compilation aborted at ../lib/TAP/Harness.pm line 8. Compilation failed in require at harness line 13. BEGIN failed--compilation aborted at harness line 13. NMAKE : fatal error U1077: 'cd' : return code '0xff' Stop.
On Wed Oct 17 16:27:21 2012\, jdb wrote:
On Wed\, Oct 17\, 2012 at 4:16 PM\, Steve Hay via RT \perlbug\-followup@​perl\.org wrote:
Do any other porters with an interest in Windows and/or the build process have an opinion on this?
I don't see the point in doing these micro-optimizations for miniperl\, as I never use it for anything but building Perl. But I don't have any objections either as long as miniperl can still build Perl. :)
Indeed. I think the idea is to try to speed up the build process slightly\, but I suspect the gains are so slight as to not be noticeable. I haven't done any accurate timings\, but my human eye certainly hasn't noticed any difference.
But I agree there's nothing wrong with such changes as long as they don't break the build\, hence my wondering whether removing sockets from miniperl is likely to break anything in the future...
On Wed Oct 17 17:01:43 2012\, shay wrote:
On Wed Oct 17 16:20:22 2012\, sprout wrote:
On Wed Oct 17 16:16:42 2012\, shay wrote:
I wonder if it would be better to not bother with the WIN32_NO_SOCKETS option\, and simply always remove sockets for miniperl (only)?
You've worked around the one current place in the build process that required sockets\, so it's really a question of how likely it is for any other such things (but having no easy workaround/alternative) to occur in the future.
Do any other porters with an interest in Windows and/or the build process have an opinion on this?
Will it affect minitest?
Good question. I guess there's little reason for minitest to be testing anything that isn't done during the build process anyway since miniperl is rarely (if ever?) used for anything other than building perl\, so in theory I think it shouldn't be affected.
However\, in practice (testing that theory out) I've just discovered that minitest is broken anyway (at least on Windows): with or without this patch I get:
cd ..\t && ..\miniperl.exe -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t Can't load module IO\, dynamic loading not available in this perl. (You may need to build a new perl executable which either supports dynamic loading or has the IO module statically linked into it.) at ../lib/IO/Handle.pm line 266. Compilation failed in require at ../lib/IO/Handle.pm line 266. BEGIN failed--compilation aborted at ../lib/IO/Handle.pm line 266. Compilation failed in require at ../lib/TAP/Harness.pm line 8. BEGIN failed--compilation aborted at ../lib/TAP/Harness.pm line 8. Compilation failed in require at harness line 13. BEGIN failed--compilation aborted at harness line 13. NMAKE : fatal error U1077: 'cd' : return code '0xff' Stop.
Interesting. minitest on Windows uses t/harness instead of t/TEST. In fact\, āmake testā also uses harness.
On Unix\, if the one-liner ā./miniperl -w -Ilib -MExporter -e '\<?>'ā fails when making miniperl\, minitest is run automatically. I think the idea is to provide some inside into why miniperl is so badly broken when trying out perl on a not-yet- or vaguely- supported system.
win32/Makefile doesnāt do that. So Iām not so sure that minitest is meaningful on Windows.
--
Father Chrysostomos
On Wed Oct 17 17:03:18 2012\, shay wrote:
On Wed Oct 17 16:27:21 2012\, jdb wrote:
On Wed\, Oct 17\, 2012 at 4:16 PM\, Steve Hay via RT \perlbug\-followup@​perl\.org wrote:
Do any other porters with an interest in Windows and/or the build process have an opinion on this?
I don't see the point in doing these micro-optimizations for miniperl\, as I never use it for anything but building Perl. But I don't have any objections either as long as miniperl can still build Perl. :)
Indeed. I think the idea is to try to speed up the build process slightly\, but I suspect the gains are so slight as to not be noticeable. I haven't done any accurate timings\, but my human eye certainly hasn't noticed any difference.
But I agree there's nothing wrong with such changes as long as they don't break the build\, hence my wondering whether removing sockets from miniperl is likely to break anything in the future...
If the build process ever involves internet connections (e.g.\, for custom builds with CPAN XS modules built statically into perl)\, that might be a problem.
But we could revert the change if that happens.
--
Father Chrysostomos
On Wed Oct 17 17:57:08 2012\, sprout wrote:
If the build process ever involves internet connections (e.g.\, for custom builds with CPAN XS modules built statically into perl)\, that might be a problem.
But we could revert the change if that happens.
There are 4 reasons I made the patch.
1. no sockets is easily turned off with one line if miniperl requires it in the future
2. provide delay loading of winsock to miniperl if sockets are turned back on
3. provide the framework for a no sockets full perl in the future if someone else demands one (business IT security policy) and does the remaining work themselves
4. either delay loading or no sockets at all will speed up the build process\, although it won't be human perceptible\, but is measurable\, atleast the PC is saving CPU power
I think Perl on DOS (DJGPP) compiled without sockets.
On Wed Oct 17 18:32:39 2012\, bulk88 wrote:
On Wed Oct 17 17:57:08 2012\, sprout wrote:
If the build process ever involves internet connections (e.g.\, for custom builds with CPAN XS modules built statically into perl)\, that might be a problem.
But we could revert the change if that happens.
There are 4 reasons I made the patch.
1. no sockets is easily turned off with one line if miniperl requires it in the future
2. provide delay loading of winsock to miniperl if sockets are turned back on
3. provide the framework for a no sockets full perl in the future if someone else demands one (business IT security policy) and does the remaining work themselves
4. either delay loading or no sockets at all will speed up the build process\, although it won't be human perceptible\, but is measurable\, atleast the PC is saving CPU power
I think Perl on DOS (DJGPP) compiled without sockets.
Ok\, I'll accept the WIN32_NO_SOCKETS option\, then: testing PERL_IS_MINIPERL instead would hardly make the patch any simpler anyway\, and would be a little less flexible for the future.
However\, I have a problem with the patch when building with MinGW/gcc: I'm getting three warnings per C file compiled from proto.h\, which don't normally appear:
gcc -c -I.\include -I. -I.. -I..\lib\CORE -DWIN32 -DPERLDLL -DPERL_CORE -s -O2 -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -omini\av.o ..\av.c In file included from ..\perl.h:5043:0\, from ..\av.c:24: ..\proto.h:5229:4: warning: '__malloc__' attribute ignored [-Wattributes] ..\proto.h:5234:4: warning: '__malloc__' attribute ignored [-Wattributes] ..\proto.h:5239:4: warning: '__malloc__' attribute ignored [-Wattributes]
On Fri Oct 19 00:33:26 2012\, shay wrote:
Ok\, I'll accept the WIN32_NO_SOCKETS option\, then: testing PERL_IS_MINIPERL instead would hardly make the patch any simpler anyway\, and would be a little less flexible for the future.
I created a WIN32_NO_SOCKETS specifically so the code isn't mixed with PERL_IS_MINIPERL making a nightmare if sockets must be turned on in the future.
However\, I have a problem with the patch when building with MinGW/gcc: I'm getting three warnings per C file compiled from proto.h\, which don't normally appear:
gcc -c -I.\include -I. -I.. -I..\lib\CORE -DWIN32 -DPERLDLL -DPERL_CORE -s -O2 -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -omini\av.o ..\av.c In file included from ..\perl.h:5043:0\, from ..\av.c:24: ..\proto.h:5229:4: warning: '__malloc__' attribute ignored [-Wattributes] ..\proto.h:5234:4: warning: '__malloc__' attribute ignored [-Wattributes] ..\proto.h:5239:4: warning: '__malloc__' attribute ignored [-Wattributes]
The reason is the functions have an 'a' on them in embed.fnc. See this commit http://perl5.git.perl.org/perl.git/commit/f54cb97a39f1a5849851e77a33524dfca2644cf5?f=embed.fnc . Previously (until my no sockets code) they were macro-ed out because MYSWAP was undef (instead use the native sockets library for local to network address conversion). I can't comment on a fix for the embed.fnc 'a' attribute warning. Since GCC no sockets builds of Perl are so rare\, normal GCC users will never see those warnings because those functions don't exist because ever POSIX OS on Earth has sockets\, right? The warnings should be corrected if someone knows if/how to do it.
On Fri Oct 19 01:13:39 2012\, bulk88 wrote:
On Fri Oct 19 00:33:26 2012\, shay wrote:
However\, I have a problem with the patch when building with MinGW/gcc: I'm getting three warnings per C file compiled from proto.h\, which don't normally appear:
gcc -c -I.\include -I. -I.. -I..\lib\CORE -DWIN32 -DPERLDLL -DPERL_CORE -s -O2 -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -omini\av.o ..\av.c In file included from ..\perl.h:5043:0\, from ..\av.c:24: ..\proto.h:5229:4: warning: '__malloc__' attribute ignored [- Wattributes] ..\proto.h:5234:4: warning: '__malloc__' attribute ignored [- Wattributes] ..\proto.h:5239:4: warning: '__malloc__' attribute ignored [- Wattributes]
The reason is the functions have an 'a' on them in embed.fnc. See this commit
http://perl5.git.perl.org/perl.git/commit/f54cb97a39f1a5849851e77a33524dfca2644cf5?f=embed.fnc . Previously (until my no sockets code) they were macro-ed out because MYSWAP was undef (instead use the native sockets library for local to network address conversion). I can't comment on a fix for the embed.fnc 'a' attribute warning. Since GCC no sockets builds of Perl are so rare\, normal GCC users will never see those warnings because those functions don't exist because ever POSIX OS on Earth has sockets\, right? The warnings should be corrected if someone knows if/how to do it.
I wasn't running a "no sockets perl" build. The warnings appear from the miniperl part of the normal build process...
I will have a look at fixing it myself later\, but I would be very happy if someone beat me to it :-)
On Fri Oct 19 01:19:27 2012\, shay wrote:
I wasn't running a "no sockets perl" build. The warnings appear from the miniperl part of the normal build process...
I will have a look at fixing it myself later\, but I would be very happy if someone beat me to it :-)
I won't be able to\, I didn't understand clearly enough what attribute malloc does or when to or not to use it. I also don't compile the interp with GCC. Also I'm not sure what else was incorrectly marked in that commit\, since if those 3 were tagged incorrectly\, maybe there are dozens more that only an expert would ID.
On Fri Oct 19 01:57:29 2012\, bulk88 wrote:
On Fri Oct 19 01:19:27 2012\, shay wrote:
I wasn't running a "no sockets perl" build. The warnings appear from the miniperl part of the normal build process...
I will have a look at fixing it myself later\, but I would be very happy if someone beat me to it :-)
I won't be able to\, I didn't understand clearly enough what attribute malloc does
Itās a compiler hint that tells it a function allocates stuff\, so the return value should not be ignored\, and possibly other things I donāt know about.
--
Father Chrysostomos
On 19.10.2012 15:30\, Father Chrysostomos via RT wrote:
On Fri Oct 19 01:57:29 2012\, bulk88 wrote:
I won't be able to\, I didn't understand clearly enough what attribute malloc does
Itās a compiler hint that tells it a function allocates stuff\, so the return value should not be ignored\, and possibly other things I donāt know about.
Its main use is to inform the optimizer that the returned pointer cannot reference any other object (i.e. it can't alias anything). There's a separate warn_unused_result for warning about ignored return values.
Lukas
Thanks for the patch\, which is finally now applied in commit 19253ae62c. Thanks also to others for commenting on the __malloc__ attribute warnings. It looks to me like the three functions in question should simply never have had that attribute added in the first place since none of them do (or did) allocate any memory\, so I've changed the "a" to an "R" in embed.fnc in commit cd88b75a7a.
Thanks for the patch\, which is finally now applied in commit 19253ae62c. Thanks also to others for commenting on the __malloc__ attribute warnings. It looks to me like the three functions in question should simply never have had that attribute added in the first place since none of them do (or did) allocate any memory\, so I've changed the "a" to an "R" in embed.fnc in commit cd88b75a7a.
@steve-m-hay - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#115246 (status was 'resolved')
Searchable as RT115246$