If sysctl is not found at all, let the usual exception propogate
so that the user can fix their env. If it fails because of the
permissions required to read the property then print a warning
and continue.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I found this running lit tests on a Mac that doesn't have sysctl available. Not very familiar with it so I'm not sure why that is the case for our particular machine.
So this change is me assuming the intention was to just print and carry on if "sysctl" fails.
LGTM. Could you maybe update the message something like warning: calling sysctl failed, defaulting to no fma3
I would be excessively concerned about why a Mac doesn't have sysctl available. I'm not actually sure we should continue running tests if it is missing. sysctl is a fundamental unix tool that ships with macOS, for it to be missing your OS install is likely broken. If the command is failing (but not missing) that may be masking a different issue. Sandboxing or user permissions can limit which keys sysctl can interrogate.
Turns out I didn't have /usr/sbin on my PATH (due to some machine hopping).
In light of that I think it makes more sense to allow "file not found" to be raised normally, then if sysctl returns non zero print the warning that was suggested.