support universal (fat) mach-o binary files#4278
Conversation
Signed-off-by: Joseph Shapiro <joeyashapiro@gmail.com>
Signed-off-by: Joseph Shapiro <joeyashapiro@gmail.com>
Signed-off-by: Joseph Shapiro <joeyashapiro@gmail.com>
24f0864 to
29d6cc1
Compare
|
the static analysis says to rewrite my if-else to a switch. but I can't see how it can be rewritten as a switch statement. |
|
@JoeyShapiro you can make a switch statement like: |
Signed-off-by: Joseph Shapiro <joeyashapiro@gmail.com>
|
ah I see. how is this? I didn't know a switch statement could do that. |
|
Golang We have some handling of universal binaries already, the UnionReader, for example. Maybe it would be simpler to use that? |
Signed-off-by: Joseph Shapiro <joeyashapiro@gmail.com>
|
ok, how does this look. it seems quite a bit cleaner. but I'm wondering if it isn't as obvious that it is working on universal binaries. If that even matters |
|
It might be good to have some indication about the file being a universal binary, but it seems to me that returning information about all the libraries used, existence of entrypoint, etc. is more important, where we may have been missing some of this information before. We can always add the universal binary indicator later. |
kzantow
left a comment
There was a problem hiding this comment.
LGTM, thanks @JoeyShapiro 👍
|
ok cool. thanks for the help |
* main: chore(deps): update tools to latest versions (#4302) chore(deps): bump github.com/github/go-spdx/v2 from 2.3.3 to 2.3.4 (#4301) chore(deps): bump github/codeql-action from 4.30.8 to 4.30.9 (#4299) support universal (fat) mach-o binary files (#4278) chore(deps): bump sigstore/cosign-installer from 3.10.0 to 4.0.0 (#4296) chore(deps): bump anchore/sbom-action from 0.20.7 to 0.20.8 (#4297) convert posix path back to windows (#4285) Remove duplicate image source providers (#4289) chore(deps): bump anchore/sbom-action from 0.20.6 to 0.20.7 (#4293) feat: add option to fetch remote licenses for pnpm-lock.yaml files (#4286) Add PDM parser (#4234) chore(deps): update tools to latest versions (#4291) fix: panic during java archive maven resolution (#4290) Extract zip archive with multiple entries (#4283) chore: update to use old configuration on new cosign (#4287) chore(deps): update anchore dependencies (#4282) chore(deps): bump github.com/mholt/archives from 0.1.3 to 0.1.5 (#4280) add docs to configs (#4281)
Description
This change adds support for Mach-o Universal (Fat) binaries. This was a
TODOin the code that I ran across while using the package. I have made a few changes that handle fat files differently and I am not sure if this is the best way, so I wanted someone to check and see if they wanted a different way.HasExportsorHasEntrypoint.Type of change