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

rambox: 0.6.6 -> 0.6.7 #60769

Merged
merged 1 commit into from May 7, 2019
Merged

rambox: 0.6.6 -> 0.6.7 #60769

merged 1 commit into from May 7, 2019

Conversation

andywhite37
Copy link
Contributor

Motivation for this change

Patch update to rambox messaging app.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@alyssais
Copy link
Member

alyssais commented May 2, 2019

@GrahamcOfBorg build rambox

@JohnAZoidberg
Copy link
Member

Doesn't build for me:

$ nix build --no-link --keep-going --max-jobs 8 --option build-use-sandbox true -f /home/zoid/.cache/nix-review/pr-60769/build.nix
hash mismatch in fixed-output derivation '/nix/store/6r6k2hw1lax5zisjlgcbzcy2srmlzmx8-node_modules':
  wanted: sha256:0ifk0fzw4zhi4195jlmiq5k57bdmf912372r4bwa4z500wipikq3
  got:    sha256:0qsgr8cq81yismal5sqr02skakqpynwwzk5s98dr5bg91y361fgy
cannot build derivation '/nix/store/nphslij4mwc175vl1bpws6h2bk6vdg6b-rambox-bare-0.6.7.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/qgvb3cydq6bqknlq52p1aj10iwi5sb0z-Rambox.desktop.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/r167x3rxg3wwxqzm70lh4rqc8g7dxyvw-rambox-0.6.7.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/wbf026q52yvkfvkvh395kkdypy0px3fp-env.drv': 1 dependencies couldn't be built

@andywhite37
Copy link
Contributor Author

Sorry, this was my first attempt at a contribution to nixpkgs, I'm still trying to figure out exactly how one tests a change like this locally. I suspect there is another sha256 that needs to be updated - I'll take another stab at it - thanks for posting the command you ran!

@JohnAZoidberg
Copy link
Member

Sorry, this was my first attempt at a contribution to nixpkgs, I'm still trying to figure out exactly how one tests a change like this locally.

You ticked the boxes for building it locally and testing the binaries - (how) did you do that?

I suspect there is another sha256 that needs to be updated - I'll take another stab at it - thanks for posting the command you ran!

Yeah, you correctly updated the src.sha256 but the one of node_modules depends on that, so you have to update that as well. I don't know how to check that via commandline so I'd just copy the correct hash from the error message.

Then you can do (from the top level of the nixpkgs repo):

$ nix-build -A rambox
$ ./result/bin/rambox

Seems to run fine for me, when I update the other hash, too :)

@andywhite37
Copy link
Contributor Author

andywhite37 commented May 6, 2019

I was following the guide here https://nixos.wiki/wiki/Nixpkgs - I believe I did run nix-build -A rambox and I could have sworn I ran ./result/bin/rambox. The app came up and the About page said 0.6.7, so I assumed it was good. That's why I checked those boxes, but I wasn't 100% clear on whether to check those boxes, so I probably shouldn't have.

I rebased my branch on master, and am trying to build again with nix-build -A rambox, but it is succeeding b/c I already have the output paths in my /nix/store. I tried rm result && nix-store --delete <paths> where paths are various paths I see when I try to build, including the main path: /nix/store/97yqbyyipqis3fzqibcir9wach11b049-rambox-0.6.7. Each time I try to delete something and try again, it doesn't ever seem to try to re-download the remote .tar.gzs and re-check the sha256s.

I've tried nix-build --repair -A rambox in hopes of rebuilding it again from scratch, but I get repairing is not supported when building through the Nix daemon.

Is there any easy way to force it to rebuild the package from scratch? Or run the build without using cached artifacts? I've searched the Nix wiki and google a bit for answers, but I'm not clear on what to do. Thank you for any help!

@andywhite37
Copy link
Contributor Author

andywhite37 commented May 6, 2019

@JohnAZoidberg - I updated the other sha256, and when I re-ran nix-build -A rambox it worked. Let me know if it's now working for you, and if you have any other tips! I'm still unsure why it worked for me locally, and not for you, and how best to try re-running the build from scratch. I suppose it could have worked for me the first time locally if I happened to already have that node_modules path in my /nix/store from a previous install of this app - in that case, maybe it didn't re-download the package and re-check the sha? Thanks again.

@JohnAZoidberg
Copy link
Member

JohnAZoidberg commented May 6, 2019

Yep, this worked. Hmmm, really weird that you could build it before changing the hash.

Yup, works like this! The app launches. I trust that you checked whether it actually does the right thing.

Usually you can do nix-build -A rambox --check. But here it doesn't do what you want because rambox is a derivation that wraps the derivation you're interested in rebuilding. And --check doesn't recursively rebuild everything, because that would rebuild your entire system ;)

So what you can do is:

  1. Delete the wrapper: rm result && nix-store --delete /nix/store/zqrz9nccn43rz0wbpi1i8k4ph2jwwjfq-rambox-0.6.7
  2. Figure out what the actual derivation is (hint: it's called rambox-bare and mentioned in result/bin/rambox)
  3. Remove that: nix-store --delete /nix/store/pcg93blibcf6qb3d0xjwhqcbdmpaq0vf-rambox-bare-0.6.7
  4. Rebuild rambox nix-build -A rambox

@andywhite37
Copy link
Contributor Author

Ok, got it - thank you for taking the time to write down this info - I really appreciate it!

@JohnAZoidberg
Copy link
Member

You're welcome!

By the way: If you're on NixOS later than 18.09 you have sandboxing enabled. And if not, you can enable it very easyily: https://youtu.be/ULqoCjANK-I?t=550 (first PR tickbox).

@Lassulus
Copy link
Member

Lassulus commented May 7, 2019

tested with nix-review, started and added a whatsapp account.

@Lassulus Lassulus merged commit c0abf3c into NixOS:master May 7, 2019
@andywhite37 andywhite37 deleted the rambox branch May 7, 2019 21:26
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

5 participants