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

nixopsUnstable: don't depend on external URLs #31869

Closed
wants to merge 1 commit into from

Conversation

basvandijk
Copy link
Member

Motivation for this change

Upgrading nixopsUnstable is currently difficult because you have to generate a tarball, put it somewhere online and point the derivation to it (for example we currently use https://static.domenkozar.com/nixops-1.5.1pre2169_8f4a67c.tar.bz2).

Ideally, we only have to specify a git revision and sha256.

Things done

Instead of downloading a tarball from an external URL we build the tarball ourself by downloading nixops's source code from GitHub and importing the release.nix file.

  • 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.

@domenkozar ping.

@domenkozar
Copy link
Member

I've just pushed another impurity fix: NixOS/nixops@f1ffb53

@domenkozar
Copy link
Member

There seem to be many more: https://gist.github.com/2f8f115d4737b00a2a2dc36706002f02

@domenkozar
Copy link
Member

@basvandijk needs nixops bump, otherwise +1 :)

Instead of downloading a tarball from https://static.domenkozar.com we
build the tarball ourself by downloading nixops's source code from
GitHub and importing the release.nix file.
@basvandijk
Copy link
Member Author

@domenkozar good stuff on the impurity fixes. I bumped nixops.

version = "2017-05-22";
src = fetchurl {
# Sadly hydra doesn't offer download links
url = "https://static.domenkozar.com/nixops-1.5.1pre2169_8f4a67c.tar.bz2";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! Nice improvement!

@domenkozar
Copy link
Member

I didn't chose this path because it uses import-from-derivation, will this work on Hydra?

@basvandijk
Copy link
Member Author

Hi Domen, is import-from-derivation frowned upon? Why wouldn't this work on hydra? Note that the following works nix-build -A nixopsUnstable --option build-use-sandbox true.

@domenkozar
Copy link
Member

In Nix 1.12, there is allow-import-from-derivation setting flag, I'd assume Hydra sets it to false.

It's because it makes the evaluator build, defeating the purpose of evaluation/build separation and making the whole process happen in one bang on the Hydra master.

@basvandijk
Copy link
Member Author

basvandijk commented Nov 21, 2017

Maybe I can partially answer my own question: hydra separates Nix evaluation from building (i.e. hydra-evaluator and hydra-queue-runner). When we import from a derivation we perform evaluation during building (this should be: building during evaluation.) and that might be bad for some reason.

@basvandijk
Copy link
Member Author

I just noticed your answer. Thanks.

That's a bummer though. It means we can't easily upgrade nixopsUnstable.

@domenkozar
Copy link
Member

Actuall we can, since Hydra got support of serving S3 files.

https://hydra.nixos.org/build/64518294 -> https://hydra.nixos.org/build/64518294/download/2/nixops-1.6pre2276_9203440.tar.bz2

@basvandijk
Copy link
Member Author

Sweet!

Then I'll close this PR and we can create a new one based on the tarball on hydra.

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.

None yet

3 participants