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

Case Sensitivity Problem with Package names and directories #186

Closed
mattfarina opened this issue Jul 27, 2012 · 34 comments

Comments

@mattfarina
Copy link

commented Jul 27, 2012

Package names are now required to be lowercase. But, this wasn't always the case and I have a few packages that have uppercase letters. This is causing an interesting problem.

Say I have two packages with the names Masterminds/Fortissimo and masterminds/fortissimo-twig. In the vendor directory two directories for masterminds will be created on linux. One with and one without the capital letter. On mac it will just be one directory named Masterminds. Mac seems to be case insensitive. But, generate a phar file and inside that the classes are case sensitive again.

I thought the solution would be to update Masterminds/Fortissimo to be masterminds/fortissimo and did just that. Unfortunately, when getting the package from packagist the directory is still created as Masterminds/Fortissimo rather than the lowercase version. If I point composer to the git repo directly this is not an issue.

So, there appears to be an issue where Packagist is still keeping the uppercase names. This mixed case is creating a problem.

@mattfarina

This comment has been minimized.

Copy link
Author

commented Jul 27, 2012

To make matters more interesting this case sensitivity carries over to the autoloader.

@naderman

This comment has been minimized.

Copy link
Member

commented Jul 30, 2012

Just delete your vendor directory and install again.

@mattfarina

This comment has been minimized.

Copy link
Author

commented Jul 30, 2012

@naderman That works when I specify the repo on github. When It pulls the information from packagist this doesn't work. The old name with uppercase letters is still created. That's why I filed this bug with packagist.

I've tried moving the repo to a new location, having packagist update, and then trying to re-install. I've tried force updating packagist. None of this works.

Each time I do delete the vendor directory so it can be properly regenerated.

@stof

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2012

@naderman Packagist is still sending the uppercased names for the versions: http://packagist.org/packages/masterminds/fortissimo.json

It looks like the package table has been updated for lowercase names automatically by @Seldaek but not the version table (which is the important one in fact)

@harikt

This comment has been minimized.

Copy link

commented Aug 1, 2012

Hey guys ,

We are also facing the same issue

http://packagist.org/packages/Aura/

When you look at old Aura packages its caps, but recently I submitted some other which I am forced to change to small letters is of aura/package

I also did a force update stuffs , but it didn't worked.

@harikt

This comment has been minimized.

Copy link

commented Aug 1, 2012

Yes @stof is correct . You can see the Aura.Router as http://packagist.org/packages/aura/router.json and http://packagist.org/packages/aura/uri.json in different way.

@pmjones

This comment has been minimized.

Copy link

commented Aug 1, 2012

Definitely having this problem with Aura packages on Packagist.

As a side note, why are we requiring package names to lower-case? It seems like the package names should mimic the namespace names.

@henrikbjorn

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2012

@pmjones it is just a convention. Makes it a bit easier to figure out package names if you know they are on packagist.

@pmjones

This comment has been minimized.

Copy link

commented Aug 1, 2012

Sure, I get that it's a convention for Packagist. My question is, why that particular convention tradeoff? In particular, an alternative convention of "the package name maps to the first two levels of the namespace" seems more ... useful, somehow. Certainly it would mean that namespaces and package names would be identical, case-wise.

@stof

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2012

@pmjones package names are case insensitive in composer anyway. It uses them as lowercase internally. So this suggestion will not work

@harikt

This comment has been minimized.

Copy link

commented Aug 1, 2012

@stof as you are mentioning composer is case insensitive can't the packagist allow the Caps also as we have Aura/Router , Aura/Cli and many in caps and the new ones like aura/uri , aura/framework as in small. And when this is getting installed it will be installing in Aura/package and aura/package. So we loved to make it unique for @auraphp .

You can see the packages http://packagist.org/packages/aura/

@stof

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2012

@harikt Packagist enforces the composer best-practice asking to use lowercased names. And @Seldaek said he applied a migrations for packages where only the case was changing as it does not break things in the composer.json (packagist using several words with CamelCase would need to change it to dashes to follow the best practice so it was not possible to change it silently on packagist).
But I suspect that @Seldaek migrated the packages table but forgot the versions table, which is in fact the most concerned by this change (and the reason why you still have some auraphp packages installed in Aura)

@pmjones

This comment has been minimized.

Copy link

commented Aug 1, 2012

@stof: "Packagist enforces the composer best-practice asking to use lowercased names." Yeah, I get that part, and I get that Composer doesn't care (internally) if they're lower or upper case.

But outside Composer, some projects using Composer do care about lower and upper case. So the question remains: how did we come to the decision to force lower case?

@stof

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2012

@pmjones composer also documents that package names should be lowercased (except it accepts other casing to avoid rejecting your packages). The goal was to enforce the documented best practices for people sharing their packages on Packagist.

And to answer your previous suggestion "the package name maps to the first two levels of the namespace", this does not make sense. Package names may not match the namespace (and especially no the first 2 levels). Simply try to apply this to Symfony. All components would then have to be Symfony/Component for composer and all core bundles would become Symfony/Bundle. Another broken case is libraries that use 1 level of namespace (see Monolog or Assetic for instance). It simply cannot work.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Aug 2, 2012

The reason we did it is that we got one request per day from people that wanted to rename their package because of case changes or just not following the common practice and wanting to be in line once they realized it.

No changes have been done to any of the 200-some affected packages yet, but i guess we should do it for the aura ones at least and then look at the rest case by case. I can't do it for another week, but maybe @naderman can.

@pmjones

This comment has been minimized.

Copy link

commented Aug 2, 2012

@Seldaek I would appreciate that, so that at least they are all the same. Thanks!

@harikt

This comment has been minimized.

Copy link

commented Aug 2, 2012

@naderman can you make the necessary changes ?

@stof

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2012

@naderman @Seldaek One of you should simply run UPDATE package_version SET name=LOWER(name) in mysql.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Aug 11, 2012

I lowercased all the aura/* and masterminds/* packages, I'll leave the issue opened for now because other packages should still be taken care of, but it needs more time.

@pmjones

This comment has been minimized.

Copy link

commented Aug 11, 2012

@Seldaek Thanks! In the search/list view, some Aura packages still show up as upper-case (e.g. Aura/Web) but are lower-cased in the detail view (aura/web). I don't know if that's a caching issue, or what.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Aug 11, 2012

Oh that's just because the search result data comes straight out of the
solr index. I started a reindexing, should be fixed in a couple minutes.

@pmjones

This comment has been minimized.

Copy link

commented Aug 11, 2012

Looks fixed now -- thanks for your attention! :-)

@harikt

This comment has been minimized.

Copy link

commented Aug 30, 2012

Hey @Seldaek I was installing the aura packages again today with composer. I can still see the folder names are created as upper .

"require": {
    "aura/session": "dev-master",
    "aura/filter": "dev-master",
    "aura/web": "dev-master"
}


$ ls vendor/
aura  Aura  autoload.php  composer

I wonder what is really happening.

@stof

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2012

@harikt can you check which packages are installed in aura and Aura respectively ?

@harikt

This comment has been minimized.

Copy link

commented Aug 30, 2012

@stof

hari@hari-Vostro1510:/media/Linux/experiments$ls vendor/aura/
default-installer  filter  framework  session
hari@hari-Vostro1510:/media/Linux/experiments$ ls vendor/Aura/
Web
@Seldaek

This comment has been minimized.

Copy link
Member

commented Sep 4, 2012

@harikt if I do a clean install of those requirements I don't get this problem, can you try again after a rm -rf vendor/Aura?

@harikt

This comment has been minimized.

Copy link

commented Sep 4, 2012

I have removed all the Aura related stuffs and tried again . The composer.json I am using is

{
    "minimum-stability": "dev",
    "require": {
        "aura/session": "dev-develop",
        "aura/autoload": "dev-develop",
        "aura/filter": "dev-develop",
        "aura/web": "dev-develop",
        "aura/view": "dev-develop",
        "aura/http": "dev-develop",
        "aura/framework": "dev-develop",
        "crodas/notoj": "dev-master"
    }
}

When I ran composer.phar update , Aura.Web and Aura.Autoload went to vendor/Aura . I wonder why it happens only for me ?

@Seldaek

This comment has been minimized.

Copy link
Member

commented Sep 4, 2012

It's not just you, happens here too now. Trying to see what's up.

@harikt

This comment has been minimized.

Copy link

commented Sep 4, 2012

@Seldaek what I guess is there is someway you are storing the name in json in your server and composer gets the info via it. That particular one is having caps name. I suggest composer to lower case it when trying to install if not added.

@harikt

This comment has been minimized.

Copy link

commented Sep 4, 2012

I have also opened another issue composer/composer#1058 .

@akkie

This comment has been minimized.

Copy link

commented Sep 21, 2012

Hi,

we have the same problem with the packages Ray.Di and Ray.Aop. One gets installed into Ray/Di and one into ray/aop. Please can someone fix this issue because this breaks the usage under windows systems.

@koriym Please can you confirm this.

Cheers,
Christian

@koriym

This comment has been minimized.

Copy link

commented Sep 21, 2012

Yes, I confirmed. I followed the way of Aura team as best practice, then encountered same problem. ;)

@Seldaek

This comment has been minimized.

Copy link
Member

commented Sep 24, 2012

@akkie @koriym I rebuilt the whole package dumps, can you confirm whether the issue is fixed (probably needs a rm -rf vendor/ray vendor/Ray for safety?

@koriym

This comment has been minimized.

Copy link

commented Sep 24, 2012

Confirmed. Thanks ! @Seldaek @akkie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.