-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
linux/diagnostic: add check for versioned GCC linkage #13639
Conversation
Review period will end on 2022-08-04 at 13:00:15 UTC. |
As before, I still need to test this. But this is the proof-of-concept. |
@@ -139,6 +139,34 @@ def check_linuxbrew_bottle_domain | |||
e.g. by using homebrew instead). | |||
EOS | |||
end | |||
|
|||
def check_gcc_dependent_linkage |
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.
This could be very slow. On the other hand, brew doctor
isn't run all that often.
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.
@carlocab Would be good to benchmark how much slower it ends up being?
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.
@Homebrew/linux would appreciate help with testing and benchmarking. Using Docker on macOS is not fun 😅
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.
Ok, this may take me a bit, but the exercise I plan to do is to install 100 randomly selected GCC dependents:
brew ruby <<EOS | xargs brew install
require 'formula'
gcc_dependents = Formula.all.select { |f| f.deps.map(&:name).include? "gcc" }
puts gcc_dependents.sample(100)
EOS
and then test brew doctor
against this branch and against master
.
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.
Assuming I did this correctly, brew doctor
benchmarks should be in the markdown summary on this page in about an hour or so: https://github.com/carlocab/workflow-test/actions/runs/2804210379
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.
System.IO.IOException: No space left on device : '/home/runner/runners/2.294.0/_diag/Worker_20220805-142208-utc.log'
Oops.
paths = binary.rpath.split(":") | ||
versioned_linkage = paths.any? { |path| path.match?(%r{lib/gcc/\d+$}) } | ||
unversioned_linkage = paths.any? { |path| path.match?(%r{lib/gcc/current$}) } | ||
|
||
versioned_linkage && !unversioned_linkage |
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.
What I should be doing here is checking that the current
directory precedes the versioned directory whenever the versioned directory is found, but I'm still thinking of the right way to do that.
In any case, if this check is something we want to do, then this is still an improvement over not checking, and we can iterate on this later. But, suggestions very much welcome.
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.
Approach seems reasonable. Perhaps worth doing a benchmark and maybe checking on the setting that should have migrated all of these?
Is this for the scenario where the user doesn't use |
I'll admit to not having thought too carefully about failure modes yet: my motivation is that it would be good to provide as many paths to Something like this (omitting the |
Review period ended. |
Before
After
This is on a system with about ~430 formulae installed, which is pretty extreme. This means |
Yeh, I think that's too slow to run for everyone every time 😭. |
Running some slightly more comprehensive benchmarks here: https://github.com/carlocab/workflow-test/actions/runs/2805207136/attempts/1#summary-7696068383 One of the runs is still going, but the ones that finished are a bit all over the place. I'm ok to leave this be for now. We can reconsider it depending on the number of users who report issues that might be helped by this. |
Shouldn't this be handled automatically by |
Let's ship this and revert if it's causing issues/too slow. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This complements my other two GCC-on-Linux PRs (#13631, #13633), however
they are both reliant on bottles eventually being (re-)poured.
Let's try to speed that up by returning an error message from
brew doctor
whenever a user has formulae installed that would benefit from a
brew reinstall
.