Skip to content

Fake wget #17392

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

Closed
wants to merge 3 commits into from
Closed

Fake wget #17392

wants to merge 3 commits into from

Conversation

chris-martin
Copy link
Contributor

Motivation for this change

I found myself needing a mock wget executable for a new package I'm working on to get its configure script working, and I discovered that several ad-hoc solutions for this already exist in the preConfigure phases of a few derivations in nixpkgs.

Having a package for this removes a bit of duplicated code, but I think more significantly it makes life a little easier for authors of future packages that may find this useful (as I do in the package I'm currently working on), and provides a place to document the technique.

Future work

There is a slightly more complex variant of this in xen which, instead of just failing, implements wget in a mock way that copies files from a local cache. It may be useful to expand this at some point to include a behavior along those lines.

Things done
  • Tested using sandboxing
    (nix.useChroot on NixOS,
    or option build-use-chroot in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
dtzWill Will Dietz

Verified

This commit was signed with the committer’s verified signature. The key has expired.
dtzWill Will Dietz

Verified

This commit was signed with the committer’s verified signature. The key has expired.
dtzWill Will Dietz
@mention-bot
Copy link

@chris-martin, thanks for your PR! By analyzing the annotation information on this pull request, we identified @wmertens, @mirrexagon and @7c6f434c to be potential reviewers

@joachifm joachifm added the 9.needs: reporter feedback This issue needs the person who filed it to respond label Jul 31, 2016
@rasendubi
Copy link
Member

rasendubi commented Aug 1, 2016

The behaviour of wgets in textadept and handbrake is different -- one of them always succeeds and another one always fails.

@edolstra
Copy link
Member

edolstra commented Aug 1, 2016

👎 on this. It seems to ad hoc to be generally useful. Probably in most cases where you need a mock wget, you would need it to return some fake data as well.

@chris-martin
Copy link
Contributor Author

@rasendubi I think they both ought to fail, though. This is illustrative of why I think we'd be better off with a shared utility rather than ad-hoc solutions.

@chris-martin chris-martin deleted the fake-wget branch December 31, 2016 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.needs: reporter feedback This issue needs the person who filed it to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants