mitre / hipcheck

Automatically assess and score software repositories for supply chain risk.
https://mitre.github.io/hipcheck/
Apache License 2.0
73 stars 5 forks source link

feat: add --arch flag to `hc check` subcommand to allow detection override #433

Closed j-lanson closed 1 month ago

j-lanson commented 1 month ago

Resolves #415 .

We had previously encountered problems with cross-compilation to niche-but-valid architectures, where the compile-time target detection would fail, causing CURRENT_ARCH to be () instead of a valid arch enum variant. We changed this field to be type Option<SupportedArch> and also support a user-provided --arch flag to override the detected arch at runtime if the user has good reason to do so.

alilleybrinker commented 1 month ago

Thanks @j-lanson! I think this is part of what we need, and I'm happy to merge as-is. The part that's missing is expanding the SupportedArch enum to reflect more architectures we may not auto-detect, but which we can allow users to specify. In my specific case that would be aarch64-unknown-linux-gnu but there are certainly others we could reflect in the enum.