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 issues with Conan packages on Windows #3315

Closed
Framnk opened this issue Aug 7, 2018 · 6 comments
Closed

Case sensitivity issues with Conan packages on Windows #3315

Framnk opened this issue Aug 7, 2018 · 6 comments

Comments

@Framnk
Copy link

Framnk commented Aug 7, 2018

Conan doesn't enforce any kind of case sensitivity on packages however this leads to issues on Windows if someone were to attempt to use a package with the same name but a different case due to the way Conan caches the packages in the directory structure on Windows.

For example, if a user were to depend both on a package named "Boost.System/1.64.0@bincrafters/stable" and attempt to use an internally sourced package "boost.system/1.65.0@internal/testing" (for example to test a new/unstable version) Conan would fail to properly handle both packages due to the case differences in the naming.

It doesn't seem quite right for package creators to have to attempt to match their package names up to other similar packages in other repositories for them to work properly...

@lasote
Copy link
Contributor

lasote commented Aug 15, 2018

You are right, we are aware of this issue and we try to limit when a user exports a package with a different case of an already existing package. But I'm not sure what more could we do without breaking everything at this point.

@Framnk
Copy link
Author

Framnk commented Aug 30, 2018

Would it be possible to simply ignore case in the directory structure and have case somehow factor into the package id? So two package with similar names/versions but different case would extract to the same cache folder under different package ids?

@lasote
Copy link
Contributor

lasote commented Aug 30, 2018

Well, the name is used now in the servers too, conan_server, Artifactory, and Bintray. And many users are using (internally in the companies) cased names.

I could think in some (opt-in) feature in the clients to deny the export of recipes based maybe in a regular expression, but for public packages and server technology, I don't think we can do something at this point. As the client config can be distributed with conan config install feature, you could somehow prevent internal packages with forbidden naming.

@Merx
Copy link

Merx commented Jun 25, 2019

Hi, I have the same problem, that I use different package version, which only differ in the case-sensitivity on windows.

I tried to fix it by making the conan folder case-sensitive, but this was not supported and I still get the case-mismatch-error.

Here is how you can enable case sensitivity for windows with a powershell script:

#Requires -Version 4.0
#Requires -RunAsAdministrator

# Enable case sensitive feature
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

# Make conan folder case sensitive
fsutil.exe file setCaseSensitiveInfo "$env:userprofile\.conan\data" enable

I would suggest to add this to conan (if the windows version supports it) and get rid of this case-sensitive issue of conan once and for all, at least for the newer windows versions.

@lasote
Copy link
Contributor

lasote commented Jul 1, 2019

Thanks, we will take a look.
I also would recommend using a conan hook to check that all the references are lower case. A pre-export hook works nicely. Remember that you can distribute/share all the config in a company or organization, including the hooks using the conan config install command.

@memsharded
Copy link
Member

Conan 2.0 is always lowercase, and this has been forced in ConanCenter for years now.

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

No branches or pull requests

4 participants