-
Notifications
You must be signed in to change notification settings - Fork 1k
Ensure we're correct on case insensitivity (for github...?) #433
Comments
I'll try to summarize the discussion that happened in Slack: Sam detailed the following solution:
|
The following was also proposed:
|
The issue I found with these solutions is that the solver will select 2 (most likely different) versions for each of The issue I see here is not orchestrating the source gateways but ensuring that the solver understands that |
I'm not sure if the compiler is case-sensitive wrt import paths, but I'd assume it relies on the file system for that. We can consider the lower-case path the canonical import path for packages on Github (and other sources with the same issue) but the compiler will still expect to find 2 directories This introduces another issue, ensuring that the package is vendored twice on case-sensitive file systems (for both cases). An alternative is to just fail when a package is detected with 2 different paths (different letter-casing). This is not a solution, but it's the simplest thing we can do for the time being. 😞 |
aaaghhhh... yes, good point. we'd still need to record both/all casings in the lock, then determine at vendor write time whether the fs is case sensitive, and if it is, write them all instead of just the canonical lowercase one. that potentially breaks other parts of the model, too - particularly related to vendor verification. so yeah, the simplest thing right now probably is detecting the situation and erroring out earlier 😢 |
@ibrasho hmm...they could probably rely on the same code, but this case is narrower, as we wouldn't be constructing a whole |
I just discovered some things:
Correction: We are using glide's aliasing feature to automatically rewrite imports in vendor using the old casing to the new one. It's not clear how to solve this in dep without rewriting vendor package imports. Anyone else have insights/experimental results? |
What I did (not proud of it): Added a
Edit: What we actually ended up with:
|
thanks for the added info, @edrex!
😱 😱 😱 💥 💥 💀
honestly, i'm not even sure if this makes it worse or better. probably better, but it's still kind of horrifying. i need to ponder some more. |
OK, I've mused on this now, and it's clear to me that there's just no way we can fix this without directly rewriting import paths. That's something we won't do. However, the current situation creates totally worthless errors - panics, even - and needs to be improved. That, we CAN do. First, for context - confirming what @edrex discovered, the go toolchain disallows having two imports in a single program that differ only by case. While it's not actually in the spec, the toolchain disallowing it is good enough for me to treat it as a rule. To treat it as a rule, we need to enforce it in the solver itself. That means this is going to be a fairly tricky, or at least arduous, implementation. Here's a quick sketch of what I think will be needed:
There's also some things to do in the |
Since we can't rely on sub-packages of logrus, just define a plausible-enough null logger for benchmarks.
Since we can't rely on sub-packages of logrus, just define a plausible-enough null logger for benchmarks.
Since we can't rely on sub-packages of logrus, just define a plausible-enough null logger for benchmarks.
From @sdboyer on December 13, 2016 0:31
GitHub thinks
github.com/Sirupsen/logrus
is the same asgithub.com/sirupsen/logrus
. We need to make sure we handle this...correctly. Ish. Sort of. Ugh.Copied from original issue: sdboyer/gps#116
The text was updated successfully, but these errors were encountered: