Skip to content

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

Merged
figsoda merged 2 commits intomasterfrom
unknown repository
Apr 9, 2023
Merged

default-crate-overrides.nix: prevent git fetch#224893
figsoda merged 2 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@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)

@ghost ghost requested review from figsoda, winterqt and zowoq as code owners April 5, 2023 22:50
@github-actions github-actions bot added the 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. label Apr 5, 2023
@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 on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 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 General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant