Giter Club home page Giter Club logo

Comments (6)

ap avatar ap commented on September 25, 2024

Oh… my… goodness.

The TestApp view class modules have the correctly camel-cased name in my source tree:

$ ll t/lib/MyApp/View
total 40
-rw-r--r--  1 ap  staff  226 24 Oct 20:14 AltContentType.pm
-rw-r--r--  1 ap  staff  145 24 Oct 20:14 AppConfig.pm
-rw-r--r--  1 ap  staff  852 24 Oct 20:14 DynamicPath.pm
-rw-r--r--  1 ap  staff  234 24 Oct 20:14 PkgConfig.pm
-rw-r--r--  1 ap  staff  241 24 Oct 20:16 TemplateClass.pm

But that’s not what Git sees:

$ git ls t/lib/MyApp/View
t/lib/MyApp/View/AltContentType.pm
t/lib/MyApp/View/Appconfig.pm
t/lib/MyApp/View/DynamicPath.pm
t/lib/MyApp/View/Pkgconfig.pm
t/lib/MyApp/View/TemplateClass.pm

Note the difference in casing! PkgConfig.pm vs Pkgconfig.pm.

Here’s what happened:

  1. My machine is a Mac. Its filesystem is case-preserving but case-insensitive.

  2. I used the test suite from Catalyst::View::TT as a starting point. In there are files called Pkgconfig.pm and Appconfig.pm. Of course I committed these.

  3. I refactored the test suite a bunch. And then some. And some more. One of my changes was to capitalise the C in “Config” in the names of these classes – changing all the mentions in code as well as renaming the files.

  4. Because the filesystem is case-insensitive, Git could still find the same files under their old names, so it didn’t notice I had renamed the files. And I in turn didn’t notice that Git didn’t notice that anything had changed. So the rename was never recorded by Git.

  5. My release process is just perl Makefile.PL && make dist. Part of my Makefile.PL is to generate MANIFESTfrom Git. EUMM then reads MANIFEST to collect the files to put in the dist dir. And because the filesystem is case-insensitive, just as Git succeeds when it goes looking for those files using their old names, so succeeds EUMM. So it creates a tarball that contains the files under their non-camel-cased names. And even though I carefully inspect tarballs on release, this was a flaw too subtle for me to pick up on by eye.

  6. This broken tarball works on my machine! It installed on another perl just fine. That’s because the names in the Perl code all use the camel-cased names: both the references to the classes and their package statements use the same casing. And because the filesystem is case-insensitive, when perl tries to find the files under their camel-cased names… even though the filenames are wrong… it succeeds! So to a perl on my system, everything checks out.

That’s the story of how I shipped a broken tarball to CPAN.

Thank you very much for reporting this. I’ve not yet gotten my (blood red) daily CPAN Testers report.

P.S.: The story apparently doesn’t actually end there, because Windows also has a case-preserving case-insensitive filesystem, and yet the Windows-based CPAN Testers reports are all FAILs just like the Linux- and BSD-based ones. More intriguingly, I get the same failure myself now if I start with a fresh tarball. In one of my perls. That’s not making sense to me right now – the story I had above seemed airtight. So I checked and I’m not hallucinating that it installed fine in the other perl – that really happened. I don’t yet know what’s going on.

from catalyst-view-template.

ap avatar ap commented on September 25, 2024

(Also, 👋 long time no talk.)

from catalyst-view-template.

ap avatar ap commented on September 25, 2024

Fixed in 51aa08b, which is winding its way to CPAN as we speak.

from catalyst-view-template.

szabgab avatar szabgab commented on September 25, 2024

Lack of sleep? 😄 lack of ☕ ?

from catalyst-view-template.

ap avatar ap commented on September 25, 2024

🙂 Lack of sleep always applies. 🙁 But I don’t know how I would have caught this, frankly. I wasn’t even on the lookout for the issue. (The simple answer is obviously that I need to be working out of a case-sensitive filesystem…)

from catalyst-view-template.

szabgab avatar szabgab commented on September 25, 2024

from catalyst-view-template.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.