-
Notifications
You must be signed in to change notification settings - Fork 380
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
When searching for packages, rule out incompatible TTC versions #3444
Conversation
1b25039
to
d2be25c
Compare
This feels like it could have counter-intuitive results. |
Yeah logging is a good call. I wonder if this shouldn't even be a warning -- to have some packages only installed as incompatible binaries. Definitely already surprising prior to this PR to wonder why such a library simply isn't working. |
@gallais do you have a preference on warning vs. log message here before I get to the point of modifying tests to reflect the change? I like the warning because (a) it is formatted more boldly and (b) it gets logged unconditionally instead of only upon request. That said, if a warning feels too strong, I'm open to just logging it. Of course this is a sufficiently edge-case situation only occurring at most when the Idris compiler is updated without reinstalling existing packages so that also factors into my opinion of warning being a good fit. |
I wasn't asked here, but still I feel warning to be good here |
Prior to this change, the first package matching version requirements would be used by the compiler -- if that package was only installed with an incompatible TTC version, it simply cannot be used. After this change, we skip package directories with only incompatible TTC versions which allows the compiler to find a farther down option (if one exists) in some other directory that does have a compatible TTC vesrion.
5ea58dd
to
01c0440
Compare
01c0440
to
c3c9d8b
Compare
Description
Prior to this change, the first package matching version requirements would be used by the compiler -- if that package was only installed with an incompatible TTC version, it simply cannot be used. After this change, we skip package directories with only incompatible TTC versions which allows the compiler to find a farther down option (if one exists) in some other directory that does have a compatible TTC vesrion.
For example, if you've got an incompatible package named
foo
at~/.idris2/idris2-0.7.0/foo-0/12345
and a compatible package at~/extra/idris2/foo-0/56789
this PR allows the compiler to succeed given~/extra/idris2
is inIDRIS2_PACKAGE_PATH
. Prior to this PR, that would not have worked.When a package is passed over due to incompatible TTC version, you see the following warning:
Note that for successful dependency resolution (not for dependency resolution failures) this warning is currently output twice. That's not great, but it's better than 0 warnings. The cause is two calls to the code that resolves package dependecies in two different parts of the build process. It's not trivial to squash because we only want the warning to emit when a dependency is used, so we don't want to cache/warn only on first crawl of a depedency directory (which may not be when we need a particular dependency), but that would be the easiest place to cache something. This isn't an unsolvable problem, just not one I am going to spend the time on at this moment for a warning that is pretty edge-case to begin with.
Should this change go in the CHANGELOG?
implementation, I have updated
CHANGELOG_NEXT.md
(and potentially alsoCONTRIBUTORS.md
).