-
Notifications
You must be signed in to change notification settings - Fork 162
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
Improve info if needed dep for a package does not exist #3322
base: master
Are you sure you want to change the base?
Improve info if needed dep for a package does not exist #3322
Conversation
Print the "dependency XYZ is not satisfied" info message with warning level PACKAGE_WARNING instead of PACKAGE_INFO. This seems to be more in line with what the manual promises, namely: > PACKAGE_WARNING should be used whenever GAP has detected a reason why a > package cannot be loaded, and where the message describes how to solve > this problem, for example if a package binary is missing. So if a package cannot be loaded because one of its needed dependencies is not the name of any known package, that certainly is something the user would like to know. Before this change: gap> SetInfoLevel( InfoPackageLoading, PACKAGE_WARNING ); gap> LoadPackage("pkg_with_missing_dep"); fail After this change: gap> SetInfoLevel( InfoPackageLoading, PACKAGE_WARNING ); gap> LoadPackage("pkg_with_missing_dep"); #I pkg_with_missing_dep: PackageAvailabilityInfo: dependency 'missing_pkg' is not satisfied fail
So if A has B as suggested and B has C as needed, then loading A will trigger a warning saying that B can not be loaded, since C is missing, isn't it? |
Ah, indeed. But I think that can be fixed with some moderate effort. |
OK, I had a closer look at this whole package dependency resolution code, and it is a bit ... complex. Not sure how much of that is necessary complexity, and how much not; I'd rather reserve judgement on that for now, as I am pretty sure there are more pitfalls and corner cases I am not actively aware of which might necessitate that complexity. For the error / warning message at hand, here is what I think when a user should or shouldn't see it by "default". Meaning: at least on on info level PACKAGE_WARNING; but actually, I'd rather see more of these at the default info level; I know this was a controversial topic so far, but I think that's mostly because the current system makes it hard to show those messages only "when appropriate". So I am hoping that by improving this, we can simultaneously resolve the issue at hand, but also make it more palatable to lower some of these warning levels... So, when should the "X could not be loaded dependency 'Y' is not satisfied" message be shown?
Some ideas on how to tackle that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this 1-line change is already an improvement, so I think it should be merged.
I agree with what you wrote just above in #3322 (comment) @fingolfin, including agreeing that it could get fiddly and some of it might not be worth doing. Perhaps we could have a short discussion about this at the GAP Days?
@fingolfin Do you want this PR to be merged, or do you want to wait for a more thorough solution, along the lines you indicated above? I'm happy to merge it if you are. |
@wilfwilson problem is that while this PR improves one situations, it (arguably) makes another worse, namely the one @alex-konovalov described... |
Print the "dependency XYZ is not satisfied" info message with
warning level PACKAGE_WARNING instead of PACKAGE_INFO. This seems
to be more in line with what the manual promises, namely:
So if a package cannot be loaded because one of its needed dependencies
is not the name of any known package, that certainly is something the
user would like to know.
Before this change:
After this change:
Motivated by issue #3306