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

fetch-kde-qt: Store downloaded files directly in nix/store #40987

Closed
wants to merge 1 commit into from

Conversation

bkchr
Copy link
Contributor

@bkchr bkchr commented May 23, 2018

Motivation for this change

Prevents redownloading files :)

@ttuegel

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • 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.

@ttuegel
Copy link
Member

ttuegel commented May 24, 2018

An older version of the script did this, but it turned out not to be a good idea. It is possible to generate URLs with the script that nobody else can download. If we store the pre-fetched files, then whoever is running the update script will not realize the problem. I have myself uploaded broken updates this way. Is there some way we can address this problem while also storing the pre-fetched files?

@bkchr
Copy link
Contributor Author

bkchr commented May 24, 2018

Are the urls working for the same person twice? Or could we just check a second time that the url is valid?

@ttuegel
Copy link
Member

ttuegel commented May 25, 2018

Are the urls working for the same person twice? Or could we just check a second time that the url is valid?

Well, it's not really checking a second time, it's that with Nixpkgs' mirror:// syntax, the URL used by the script is not necessarily the same as the URL used by Nix. If the download is cached in the store, the download is never made by Nix.

@bkchr
Copy link
Contributor Author

bkchr commented May 25, 2018

Yeah I know that it is currently not loaded a second time. That was the "solution", I thought of.
Any idea why an url is generated in the first run, that does not work? Maybe we can fix it that way.

@ttuegel
Copy link
Member

ttuegel commented May 25, 2018

Any idea why an url is generated in the first run, that does not work? Maybe we can fix it that way.

wget needs the full URL, but fetchurl takes the trailing part of the URL and appends it to mirror://kde/. If wget understood the mirror:// syntax, it would not be a problem; we could use exactly the same URLs for both. We cannot use curl like fetchurl does because it does not know how to recursively download directories (AFAIK).

@bkchr bkchr closed this Mar 11, 2019
@bkchr bkchr deleted the fetch_kde_qt branch March 11, 2019 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants