Skip to content

Comments

fix: removes unwraps from build.rs #222

Open
dgramop wants to merge 5 commits intoa1ien:masterfrom
dgramop:dg/no_fatal_sw_vers
Open

fix: removes unwraps from build.rs #222
dgramop wants to merge 5 commits intoa1ien:masterfrom
dgramop:dg/no_fatal_sw_vers

Conversation

@dgramop
Copy link
Contributor

@dgramop dgramop commented Jun 20, 2025

When building inside a nix environment with crane, for maximum reproducibility, binaries like "sw_vers" are not necessarily available.

If for some reason sw_vers doesn't exist on the system (or, while unlikely, its format changes), return None (instead of panicking)

It seems like few people would be affected by this code path - I think it would be anyone with libusb1 in their dependency tree that is building through nix on a Mac. This may also affect cross-compilation. I think the best of both worlds is to fail softly if the sw_version isn't found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant