-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
freeze due to name collision in module loading on case-insensitive filesystems #9007
Comments
Okay, one oddness less: |
Assuming you are using NTFS, my understanding is that whether file-access is case-sensitive depends upon the filesystem API we are using. Since libuv uses the Win32 API, it is case-insensitive. In contrast, Linux (and other traditional Unix) filesystems are always case-sensitive. (Note that Mac filesystems are also case-insensitive by default. I actually had the same problem recently where |
Oh I wouldn't have expected that... Changing images.jl to Images.jl actually does introduce the same behaviour on Ubuntu... |
I don't think it's practical to abstract this away (except by making every system act case-insensitive), when it can be an intrinsic property of the filesystem (e.g. in MacOS or Windows FAT). |
Well, it'd be nice to just have one way of doing this, even if that means its case sensitive everywhere. After all, one has to program this way anyways, as your scripts are supposed to run cross-platform with Julia. So opening files on windows ignoring cases is not really an option, if you want to share your code. |
This arises in just about every programming language, not just Julia. The usual advice is to be consistent in what capitalization you use when referring to a file, and to avoid having two files that differ only in their capitalization. I don't think it's possible to make things case sensitive everywhere, because the case is lost when you store the file on a case-insensitive filesystem like FAT; on the other hand, you can theoretically still access the case on case-preserving case-insensitive filesystems (like Mac and Windows). It would be technically possible to make Julia case insensitive everywhere, but then this is both ugly and potentially slow (because you have to walk the filesystem directory yourself, and decide how to resolve case conflicts). Actually, on case-insensitive case-preserving systems (such as MacOS and Windows NTFS/Win32), it sounds like Python actually does walk the directory path itself to enforce case-sensitivity in module loading. See Python PEP 235. I suppose we could do this too. |
I was afraid so... |
One possible approach migh be to open the file via the fs api and then once it's open check its name and see if that name matches the expected case. This is slow but would be ok in the specific case of loading code. |
That sounds like a good solution for "high risk" areas. |
@StefanKarpinski, what you suggest used to be what Python did, but then they changed it in PEP 235. I think the issue is that this "open then check" approach depends on which file happens to appear first in the path. It doesn't seem like a bad compromise to me, but it might be worth looking back at the Python discussions circa 2001 for why they opted to walk the directory path instead. |
Closed by #13542 |
@jakebolewski, I don't think this is fully resolved. The issue above was about If we want to fully address this, we need a followup PR that uses |
Maybe this can be closed? My feeling is that we should be case-sensitive (i.e. ignore the filesystem semantics) in things like On the other hand, in a function like The original issue here, with an |
Fine by me ;) My concern from this issue is fixed after all! |
Very weird bug I found and I couldn't work out a minimal version to reproduce it.
It happens on windows, but not linux :
and
Its about GLPlot and runtest.jl which I could reduce to only one line, namely
using GLPlot
.I'm using GLPlot, GLAbstraction, ModernGL, GLText, GLWindow and Reactive on master.
When I run runtest.jl either via Pkg.test("GLPlot"), or directly with julia runtests.jl, it hangs in ~95% of the cases at:
Images/src/libmagicwand.jl/
line 11import Images: (@Dict)
or in ~5% of the cases at:
ModernGL/src/glconstants.jl
line 1@GenEnums begin
If I put the file
runtest.jl
anywhere but thetest
folder, it works in 99.9% of the cases. I don't know where it stops in 0.1% of the cases, since it didn't hang anywhere else since I started investigating.This behavior is known to me since approximately Mai, but it hardly happened, so I assumed it's a bug from my side...
The text was updated successfully, but these errors were encountered: