Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32 specific Win32::IPC dependency missing #40

Closed
rurban opened this issue Jun 7, 2015 · 33 comments
Closed

win32 specific Win32::IPC dependency missing #40

rurban opened this issue Jun 7, 2015 · 33 comments

Comments

@rurban
Copy link

rurban commented Jun 7, 2015

With EUMM it would be trivial to add the required MSWin32 dependency Win32::IPC,
but I have no idea how to add it your build system. Is there only Meta, or is there more?

It fails to build on windows smokers which do not have Win32::IPC installed.
e.g. http://www.cpantesters.org/cpan/report/d3d8beb6-6dbd-1014-9f5e-99bfe3f2b8ca

@wbraswell
Copy link
Contributor

@sisyphus
How can we properly add Win32::IPC as a dependency of Inline::C?
If you just tell me what to do, then I will create a pull request etc.

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 23, 2019 via email

@wbraswell
Copy link
Contributor

Of the 20 failing Win32 tests for Inline::C v0.78, 19 of them are due to the missing Win32::Mutex error:
http://www.cpantesters.org/cpan/report/24fc8586-6bf9-1014-9fd4-c2aa8038f308
http://www.cpantesters.org/cpan/report/01033ab2-6bf6-1014-bc48-f1ee15f2f6ad
http://www.cpantesters.org/cpan/report/fae85659-6ccc-1014-ac47-5aac8038f308
http://www.cpantesters.org/cpan/report/06e666c7-6c52-1014-86c5-018b64ad720a
http://www.cpantesters.org/cpan/report/4e99b992-6d28-1014-85e9-b6b18038f308
http://www.cpantesters.org/cpan/report/3e435fc6-6c15-1014-b528-4657074be7a3
http://www.cpantesters.org/cpan/report/810d4307-6c70-1014-8575-838b271e9b05
http://www.cpantesters.org/cpan/report/1c2c0958-3212-11e8-9cbd-bb4c3e020320
http://www.cpantesters.org/cpan/report/cfc48e66-6c02-1014-a52f-72a58038f308
http://www.cpantesters.org/cpan/report/c54a39a2-bbe5-1014-9183-40e25f496936
http://www.cpantesters.org/cpan/report/1aea1bd9-6c0d-1014-be32-12aa8038f308
http://www.cpantesters.org/cpan/report/e64fe32f-6bfa-1014-bdbe-c0fdc3113a6d
http://www.cpantesters.org/cpan/report/3e06b1b4-6c00-1014-b301-7e76bb4651c1
http://www.cpantesters.org/cpan/report/86ff5c91-6c87-1014-b695-2028cfb58d10
http://www.cpantesters.org/cpan/report/eeed342e-6cad-1014-9744-7aa68038f308
http://www.cpantesters.org/cpan/report/c0e2aa0a-6cd6-1014-a88b-3ee2d5a096b1
http://www.cpantesters.org/cpan/report/52d0a274-6bf5-1014-9acf-88d089f6a4c1
http://www.cpantesters.org/cpan/report/6b044406-6c52-1014-aa86-470c99043735
http://www.cpantesters.org/cpan/report/ff0ea72c-6bf9-1014-9005-4cf2c5b556df

Only 1 of the failing Win32 tests is due to something other than missing Win32::Mutex; it appears to have an old incompatible version of Inline installed which is not related to this issue:
http://www.cpantesters.org/cpan/report/cbf280e9-6bf9-1014-bc51-f8d3665dec09

For Inline::C v0.78, there are 57 total Win32 tests, of which 37 are passing and (as mentioned) 20 are failing. We have 19/57 which is a 33% failure rate due only to missing Win32::Mutex. This seems to indicate that is is a relatively common occurrence that Win32::Mutex is NOT installed in Windows Perl by default, so we SHOULD be explicitly adding it to the Inline::C dependencies.

@sisyphus
Is my reasoning valid here?

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 23, 2019 via email

@wbraswell
Copy link
Contributor

@ingydotnet @perlpunk
Can you please give us the authoritative answer on where we need to put Inline::C dependencies, specifically Win32::Mutex?

@rurban
Copy link
Author

rurban commented Jan 23, 2019 via email

@wbraswell
Copy link
Contributor

Win32::Mutex DOES appear in the following files:

https://github.com/ingydotnet/inline-c-pm/blob/master/Meta#L36-L38 (GitHub only, not on CPAN)

win32:
  requires:
    Win32::Mutex: 1.09

https://st.aticpan.org/source/TINITA/Inline-C-0.78/Makefile.PL (CPAN only, not on GitHub)

if ( $^O eq 'MSWin32' ) {
	$WriteMakefileArgs{PREREQ_PM}{'Win32::Mutex'} = '1.09';
}

Win32::Mutex does NOT appear in the following files:

https://st.aticpan.org/source/TINITA/Inline-C-0.78/META.json (CPAN only, not on GitHub)

https://st.aticpan.org/source/TINITA/Inline-C-0.78/META.yml (CPAN only, not on GitHub)

@rurban @sisyphus
Does this mean there is an error in our CPAN release process which has failed to properly generate the "META.json" and "META.yml" files???

@rurban
Copy link
Author

rurban commented Jan 23, 2019

Exactly. I will look into that later, I'm away.

@perlpunk
Copy link
Collaborator

perlpunk commented Jan 24, 2019

It looks to me like the META.yaml/META.json files are correct.

Win32::Mutex is only needed on Win32, but AFAIK CPAN::Meta currently has no way to express such dynamic dependencies. We can't put it into the static META files because we don't want this on other operating systems.

The only thing you can specify in META is dynamic_config: 1:

"A boolean flag indicating whether a Build.PL or Makefile.PL (or similar) must be executed to determine prerequisites."
https://metacpan.org/pod/CPAN::Meta::Spec#dynamic_config

And the Makefile.PL has the dependency.

Both META.yaml/META.json have dynamic_config: 1, so I wonder why smokers don't adhere to that.
https://metacpan.org/source/TINITA/Inline-C-0.78/META.json#L6
https://metacpan.org/source/TINITA/Inline-C-0.78/META.yml#L16

edit: Interesting is, that the dependency is actually recognized. Look into this report:
http://www.cpantesters.org/cpan/report/99647050-6c1d-1014-ae7a-c367e3863dc7

Prerequisite modules loaded:

requires:

    Module                  Need     Have    
    ----------------------- -------- --------
    ExtUtils::MakeMaker     7.00     7.34    
    File::Spec              0.8      3.47    
    Inline                  0.79     0.80    
    Parse::RecDescent       1.967009 1.967009
    Pegex                   0.58     0.70    
    perl                    5.010000 5.012002
    Win32::Mutex            1.09     1.09    

And it's also in PERL5LIB:
PERL5LIB = C:\strawberry\cpan\build\Win32-IPC-1.11-0/blib/arch;C:\strawberry\cpan\build\Win32-IPC-1.11-0/blib/lib;...

@perlpunk
Copy link
Collaborator

So PERL5LIB correctly contains Win32-IPC. But as we can see from the error message the directories reported in PERL5LIB get lost:

Can't locate Win32/Mutex.pm in @INC
 (@INC contains: C:\strawberry\cpan\build\Inline-0.80-0/blib/lib/
 C:\strawberry\cpan\build\Inline-C-0.79_001-0\blib\lib
 C:\strawberry\cpan\build\Inline-C-0.79_001-0\blib\arch
 C:\strawberry\cpan\build\Inline-0.80-0/blib/arch
 C:\strawberry\cpan\build\Inline-0.80-0/blib/lib
 C:/strawberry/perl/site/lib
 C:/strawberry/perl/site/lib
 C:/strawberry/perl/vendor/lib
 C:/strawberry/perl/lib .) at C:/strawberry/perl/lib/if.pm line 13.

So why does PERL5LIB get lost? I suspect this happens here:
https://metacpan.org/source/TINITA/Inline-C-0.78/lib/Inline/C.pm#L880
as this is the only place where perl calls itself.

@wbraswell
Copy link
Contributor

@perlpunk
Wow great sleuthing! I don't have any way to test this myself, but perhaps @sisyphus or @rurban do?

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 25, 2019 via email

@wbraswell
Copy link
Contributor

@bulk88
Any thoughts on why PERL5LIB is getting lost here???

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 25, 2019 via email

@perlpunk
Copy link
Collaborator

perlpunk commented Jan 25, 2019

@sisyphus interesting.
Maybe this code is somehow broken?
https://metacpan.org/source/INGY/Inline-0.80/lib/Inline.pm#L822

my @_inc = map { "-I$_" }
($inline,
 grep {(-d File::Spec->catdir($_,"Inline") or
 -d File::Spec->catdir($_,"auto","Inline") or 
 -e File::Spec->catdir($_,"Parse/RecDescent.pm"))} @INC);
system $perl, @_inc, "-MInline=_CONFIG_", "-e1", "$dir"
...

As far as I can see this should actually replace the need for using PERL5LIB, but maybe Mutex.pm ends up somewhere else?
Does it work if you add "Win32/Mutex.pm" to that grep?

Edit: but I also don't see why one would delete PERL5LIB and then use only specific directories from @INC.
@ingydotnet any idea?

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 25, 2019 via email

@mohawk2
Copy link
Collaborator

mohawk2 commented Jan 25, 2019

I expect Inline doesn't rely on PERL5LIB in case the build stage gets run later, with different environment. However, there is no earthly reason why it's doing the grep it's doing: it should capture the whole of @INC. @sisyphus, disagree?

@wbraswell
Copy link
Contributor

@sisyphus @perlpunk
great job with this fix!

Out of curiosity, why do we have the strategy of making case-by-case exceptions such as "Parse/RecDescent.pm" or "Win32/Mutex.pm", instead of just NOT clobbering PERL5LIB in the first place?

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 26, 2019 via email

@wbraswell
Copy link
Contributor

@sisyphus
Yes I believe that is approximately what I am saying, although I do not know if this is actually correct or not...

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 26, 2019 via email

@wbraswell
Copy link
Contributor

@sisyphus
Okay sorry I got confused with the mixed up messages. :-P
I vote for releasing the File::Spec->catdir($_,"Win32/Mutex.pm") code now on CPAN to see if it solves all the Win32 failures w/out causing any other unexpected failures.
If all goes well, we could then try another CPAN testers release with the experimental generic my @_inc = map { "-I$_" } @inc; code, which could in theory cause unforeseen issues because we are disabling all the grep behavior w/out really understanding why.
(Either way, we are already due for another CPAN dev release to test the latest fix for the still-pending include dir issue #72)

@perlpunk
Copy link
Collaborator

perlpunk commented Jan 26, 2019

Yes, this was also my question. Why don't we keep @INC completely and perform a grep?
But just releasing the Win32::Mutex fix would help us now going forward with Inline::C, I agree.

@ingydotnet do you want me to do a release of Inline? Or who should & can do one? I would need a commit bit and CPAN comaint.
I see there have been two dev releases in 2018 without a following regular release.
We need a regular release so that smokers of Inline::C install it. Any reasons not to do one?

@perlpunk
Copy link
Collaborator

I just released 0.79_002. I guess it will take some more time until we can get an Inline.pm release out.

@wbraswell
Copy link
Contributor

wbraswell commented Jan 26, 2019

@sisyphus Do you still have a CPAN commit bit for Inline? If so, can you please make a CPAN dev release of Inline v0.80_03 w/ your latest commit ingydotnet/inline-pm@3b4ea7b ?
(I assume it is preferred to make a CPAN dev release first to make sure the "Win32::Mutex" code does not accidentally break anything, then we can make a full CPAN release in a day or two if all is well.)

@sisyphus
Copy link
Collaborator

sisyphus commented Jan 27, 2019 via email

@wbraswell
Copy link
Contributor

Inline v0.81 has been released, which includes this commit:
ingydotnet/inline-pm@3b4ea7b

@sisyphus says "Inline-0.81 looking fine here - and enabling Win32::Mutex to be found via PER5LIB on Windows."
#72 (comment)

Does this mean we can close this issue as being correctly resolved? How do we know for sure if the issue is actually solved?

@sisyphus
Copy link
Collaborator

sisyphus commented Feb 27, 2019 via email

@wbraswell
Copy link
Contributor

@sisyphus
Okay sounds like a good plan! :-)

@mohawk2
Copy link
Collaborator

mohawk2 commented Apr 2, 2019

Can this be closed?

@wbraswell
Copy link
Contributor

I think the plan is to keep this issue open until Inline::C 0.79 is fully released on CPAN and we have waited a sufficient period of time for CPAN testers to report errors.

@perlpunk
Copy link
Collaborator

Ok, so I think it can be closed :)

@wbraswell
Copy link
Contributor

Yes I agree this issue can be closed for now, so far all Win32 tests are passing for Inline 0.80:
http://matrix.cpantesters.org/?dist=Inline-C%200.80;os=mswin32;reports=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants