-
Notifications
You must be signed in to change notification settings - Fork 7
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
Build fails on Windows 10 using Cygwin tool chain #9
Comments
I think this is related to a recent change in File::Find. See simonwistow/Module-Pluggable#24 |
Thanks for alerting me to this. Given the discussion in Perl/perl5#20008, I think there are two possible solutions:
I would prefer going for 1) as it is the more simple solutions. Any comments, @sisyphus, @xenu? |
Symlink creation fails in certain Windows environments (and of course if respective permissions are not available). t/07-symlinks.t now checks for successful creation of the necessary symlink and skips tests if that failed. Addresses issue #9.
The devil is firstly that you have to allow for the possibility that calling symlink() will throw an exception and abort the test script. You could perhaps avoid that third consideration. I suppose that if 0 was returned you could just skip the tests in 07-symlinks.t on the assumption that they are going to be un-runnable irrespective of the actual cause of the failure. I would prefer @xenu's approach because it's more broadly applicable, and avoids using eval.
But use of symlink() is do-able, if you prefer that approach. I should point out that I haven't actually tested the above patch in an environment that enables creation of symlinks. Cheers, |
Thanks for the quick feedback, @sisyphus! My issue with @xenu's approach is twofold: First, Module::Find has been around for a really long time and I aim to be backwards compatible with older Perl versions where feasible. Second, the solution depends on some details of Perl on Windows systems that I am not able to test myself (lacking access to suitable systems). OTOH, if the test file fails to create the symlink, the tests will fail anyway. The fact that so far I didn't check the result of |
Yep - that should be fine for your purposes, and tests ok for me. I've tested @xenu's approach on Windows as far back as perl-5.8.8, and it works fine. I even tested Module-Find-0.15 on Windows perl-5.6.2. It failed quite a few tests.
But that would better be looked at in a new issue if you're wanting to pursue it. Note that, with @xenu's approach, Win32::IsSymlinkCreationAllowed() will only ever be called if it's available - which is on Windows perl-5.34 and later. Otherwise, on Windows, his anonymous sub will always return a false value because $Config{d_symlink} is false. It's a pity that Strawberry Perl development has been in hiatus since perl-5.32.1 was released. If not for that, we would have found out about this issue well over a year ago. Cheers, |
I'm still trying to keep up with all this, but I think the problem may be a little deeper than just the tests. When I run the one-liner:
on perl 5.32, I get a list of DBI modules. When I run the same one-liner on 5.36, I get nothing. If I change the line in Module-Find:
to
then I get the same list of modules. This is on Windows 10 with Module-Find built by short-circuiting 07-symlinks.t. Again, this seems to be pointing the finger at File-Find. |
Thanks for investigating, @blues1875. Did you use the stock This matches the weirdness I am seeing in my test results: In 5.32, @sisyphus: I bumped the minimum version required to 5.8.1. Thanks for catching that. 5.6.1 support was broken for a while. I guess it could be made to work if really necessary. |
Good point! That was using the stock |
0.16, 2022-08-01 Fixes an issue where symlink tests failed on systems that do not support creation of symlinks. The issue appears on Windows systems due to changed behaviour in "File::Find" described in perl5/issue #19995 <Perl/perl5#19995> Symlink tests were previously skipped if symlink() is not available, and now also if creation of a symlink is not possible. Fixes issue #9 <crenz/Module-Find#9>. Note that on Windows system, the patch to "File::Find" from perl5/PR #20008 <Perl/perl5#20008> will be required for proper operation.
I recently built perl 5.36 on Windows 10 using the tool chain from Strawberry Perl 5.32. On building Module-Find 0.15, I see the following errors:
The module builds with no problem using Strawberry Perl 5.32. Dependant module versions were:
The text was updated successfully, but these errors were encountered: