Skip Menu |

This queue is for tickets about the Time-Piece CPAN distribution.

Report information
The Basics
Id: 83154
Status: resolved
Priority: 0/
Queue: Time-Piece

People
Owner: Nobody in particular
Requestors: bulk88 [...] hotmail.com
Cc: perl5-porters [...] perl.org
steve.m.hay [...] googlemail.com
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.20
Fixed in: 1.26



CC: steve.m.hay [...] googlemail.com, perl5-porters [...] perl.org
Subject: commit "Fix failing Time-Piece tests on Win32" is not WinCE compatible
http://perl5.git.perl.org/perl.git/commit/6e0733998eff7a098d2d21d5602f3eb2a7521e1f?f=cpan/Time-Piece/Piece.xs This commit undefed getenv and putenv. On WinCE most of the clib is macro defined to "xce" clib versions (these are exported dll functions) provided by the 3rd party celib library (it provides a console/normal clib experience). Show quoted text
____________________________________________________________________ ..\..\miniperl.exe "-I..\..\lib" "-I..\..\xlib\wince-x86-hpc-wce300" -ME xtUtils::Mksymlists -e "Mksymlists('NAME'=>\"Time::Piece\", 'DLBASE' => 'Piece' , 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" link -out:..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.dll -dll -libpath:C:\sources\celib-palm-3.0\wince-x86-hpc-wce300-release -nologo -opt:re f,icf -machine:X86 -debug -subsystem:windowsce,2.0 Piece.obj ..\..\xlib\wince- x86-hpc-wce300\CORE\..\..\..\xlib\wince-x86-hpc-wce300\CORE\perl517.lib -nodefau ltlib ws2.lib celib.lib coredll.lib corelibc.lib -def:Piece.def Creating library ..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.lib an d object ..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.exp Piece.obj : error LNK2019: unresolved external symbol _putenv referenced in func tion _fix_win32_tzenv Piece.obj : error LNK2019: unresolved external symbol _getenv referenced in func tion _fix_win32_tzenv ..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.dll : fatal error LNK1120: 2 unresolved externals NMAKE : fatal error U1077: 'link' : return code '0x460' Stop. Unsuccessful make(cpan/Time-Piece): code=512 at ..\make_ext.pl line 494. NMAKE : fatal error U1077: 'C:\p517\ce\win32\..\miniperl.exe' : return code '0x2 ' Stop. C:\p517\ce\win32>
________________________________________________________________ Unlike Desktop Win32 Perl, where win32_getenv is a complex function call that ultimately calls GetEnvironmentVariableA, in WinCE Perl win32_getenv calls xcegetenv (the clib getenv on WinCE) with no logic http://perl5.git.perl.org/perl.git/blob/a820780c62918236069b3b55502640c99a9e812a:/win32/wince.c#l941 . On WinCE there is no GetEnvironmentVariableA since there are no env vars on the OS (google for more). Some FOSS projects use a registry key and get/seting env vars maps to the vals in key. celib provides this
_________________________________________________________________ int XCEAPI XCEGetEnvironmentVariableA(const char *name, char *buf, int len) { char *p; if(buf) buf[0] = 0; if((p = xcegetenv(name)) == NULL) return 0; if(buf == NULL) return strlen(p); strcpy(buf, p); return strlen(buf); }
_________________________________________________________________ but it just calls xcegetenv. So how should this be fixed,
__________________________________________________________________ #ifndef UNDER_CE # undef getenv # undef putenv #endif #undef malloc #undef free static void fix_win32_tzenv(void) {
__________________________________________________________________ like above? That works/compiles, but I'm not sure if it is the best fix. Other ideas are static inline getenv() in wince.h that just called xcegetenv(), or have perl517.dll export a "getenv()" on WinCE only.
Thanks, this was fixed in 1.14 -- rjbs
On Sat Jul 06 11:03:17 2013, RJBS wrote: Show quoted text
> Thanks, this was fixed in 1.14
I dont see any code changes in 1.21 https://metacpan.org/source/RJBS/Time-Piece-1.21/Piece.xs that would make me think this was fixed. The #undefs are still there.
On 2013-07-06 12:23:31, BULKDD wrote: Show quoted text
> On Sat Jul 06 11:03:17 2013, RJBS wrote:
> > Thanks, this was fixed in 1.14
> > I dont see any code changes in 1.21 > https://metacpan.org/source/RJBS/Time-Piece-1.21/Piece.xs that would > make me think this was fixed. The #undefs are still there.
Whoops, thanks. A lot of tickets on Time::Piece today were in the form "please apply this old commit that was in blead already," and I misread this as one of those. -- rjbs
On Wed Feb 06 04:57:33 2013, BULKDD wrote: Show quoted text
> http://perl5.git.perl.org/perl.git/commit/6e0733998eff7a098d2d21d5602f3eb2a7521e1f?f=cpan/Time- > Piece/Piece.xs > This commit undefed getenv and putenv. On WinCE most of the clib is > macro defined to "xce" clib versions (these are exported dll > functions) > provided by the 3rd party celib library (it provides a console/normal > clib experience). > > ____________________________________________________________________ > ..\..\miniperl.exe "-I..\..\lib" > "-I..\..\xlib\wince-x86-hpc-wce300" -ME > xtUtils::Mksymlists -e "Mksymlists('NAME'=>\"Time::Piece\", 'DLBASE' > => > 'Piece' > , 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' > => > []);" > link > -out:..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.dll -dll > -libpath:C:\sources\celib-palm-3.0\wince-x86-hpc-wce300-release > -nologo > -opt:re > f,icf -machine:X86 -debug -subsystem:windowsce,2.0 Piece.obj > ..\..\xlib\wince- > x86-hpc-wce300\CORE\..\..\..\xlib\wince-x86-hpc- > wce300\CORE\perl517.lib > -nodefau > ltlib ws2.lib celib.lib coredll.lib corelibc.lib -def:Piece.def > Creating library > ..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.lib an > d object ..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.exp > Piece.obj : error LNK2019: unresolved external symbol _putenv > referenced > in func > tion _fix_win32_tzenv > Piece.obj : error LNK2019: unresolved external symbol _getenv > referenced > in func > tion _fix_win32_tzenv > ..\..\xlib\wince-x86-hpc-wce300\auto\Time\Piece\Piece.dll : fatal > error > LNK1120: > 2 unresolved externals > NMAKE : fatal error U1077: 'link' : return code '0x460' > Stop. > Unsuccessful make(cpan/Time-Piece): code=512 at ..\make_ext.pl line > 494. > NMAKE : fatal error U1077: 'C:\p517\ce\win32\..\miniperl.exe' : return > code '0x2 > ' > Stop. > > C:\p517\ce\win32> > ________________________________________________________________ > > Unlike Desktop Win32 Perl, where win32_getenv is a complex function > call > that ultimately calls GetEnvironmentVariableA, in WinCE Perl > win32_getenv calls xcegetenv (the clib getenv on WinCE) with no logic > http://perl5.git.perl.org/perl.git/blob/a820780c62918236069b3b55502640c99a9e812a:/win32/wince.c#l941 > . On WinCE there is no GetEnvironmentVariableA since there are no env > vars on the OS (google for more). Some FOSS projects use a registry > key > and get/seting env vars maps to the vals in key. celib provides this > _________________________________________________________________ > int XCEAPI > XCEGetEnvironmentVariableA(const char *name, char *buf, int len) > { > char *p; > if(buf) > buf[0] = 0; > if((p = xcegetenv(name)) == NULL) > return 0; > if(buf == NULL) > return strlen(p); > strcpy(buf, p); > return strlen(buf); > } > _________________________________________________________________ > but it just calls xcegetenv. > > So how should this be fixed, > __________________________________________________________________ > #ifndef UNDER_CE > # undef getenv > # undef putenv > #endif > #undef malloc > #undef free > > static void > fix_win32_tzenv(void) > { > __________________________________________________________________ > like above? That works/compiles, but I'm not sure if it is the best > fix. > > Other ideas are static inline getenv() in wince.h that just called > xcegetenv(), or have perl517.dll export a "getenv()" on WinCE only.
Bump.
On 2013-12-09 22:33:33, BULKDD wrote: Show quoted text
> Bump.
Did I miss a patch? I don't do C, so don't expect any fixes from me. -- rjbs
On Mon Dec 09 22:49:30 2013, RJBS wrote: Show quoted text
> On 2013-12-09 22:33:33, BULKDD wrote:
> > Bump.
> > Did I miss a patch? > > I don't do C, so don't expect any fixes from me.
Since Steve Hay hasn't commented (he wrote the Win32 fix that I need to fix for WinCE http://perl5.git.perl.org/perl.git/commit/6e0733998eff7a098d2d21d5602f3eb2a7521e1f?f=cpan/Time-Piece/Piece.xs ), I'll guess the patch is as I mentioned in the OP ----------------------------------------------------------------- #ifndef UNDER_CE # undef getenv # undef putenv #endif #undef malloc #undef free static void fix_win32_tzenv(void) { ----------------------------------------------------------------- you want a github pull?
On Mon Dec 09 22:49:30 2013, RJBS wrote: Show quoted text
> On 2013-12-09 22:33:33, BULKDD wrote:
> > Bump.
> > Did I miss a patch? > > I don't do C, so don't expect any fixes from me.
Patches at https://github.com/rjbs/Time-Piece/pull/4