Skip to content
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

default-crate-overrides.nix: prevent git fetch #224893

Merged
merged 2 commits into from Apr 9, 2023
Merged

default-crate-overrides.nix: prevent git fetch #224893

merged 2 commits into from Apr 9, 2023

Conversation

ghost
Copy link

@ghost ghost commented Apr 5, 2023

The build.rs script shipped with evdev-sys attempts to detect cross compilation and uses a completely different codepath which does a git fetch inside the build script. This doesn't work in nixpkgs.

This PR adds a touch libevdev/.git to trick the build.rs into thinking that it is not necessary to do a git fetch.

Thanks to @figsoda for finding this more-elegant solution to the problem (my original solution needed to patch build.rs):

#224893 (review)

Tested on:

  • aarch64-linux (cross from x86_64-linux)

@ofborg ofborg bot added 6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Apr 5, 2023
@ghost ghost marked this pull request as draft April 6, 2023 20:00
@ghost ghost changed the title default-crate-overrides.nix: skip crate-specific cross detection default-crate-overrides.nix: prevent git fetch Apr 6, 2023
The build.rs script shipped with evdev-sys attempts to detect cross
compilation and uses a completely different codepath which does a
`git fetch` inside the build script.  This doesn't work in nixpkgs.

This PR adds a `touch libevdev/.git` to trick the `build.rs` into
thinking that it is not necessary to do a `git fetch`.

Thanks to @figsoda for finding this more-elegant solution to the
problem (my original solution needed to patch `build.rs`):

  #224893 (review)

Tested on:
- [x] `aarch64-linux` (cross from `x86_64-linux`)
@ghost ghost requested a review from figsoda April 6, 2023 20:13
@ghost ghost marked this pull request as ready for review April 6, 2023 20:13
@ghost ghost requested a review from figsoda April 6, 2023 20:50
@figsoda figsoda merged commit ce0ee58 into NixOS:master Apr 9, 2023
@ghost ghost deleted the pr/crate-overrides/evdev-sys branch April 11, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: rust 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant