{"action":"created","issue":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3485","repository_url":"https://api.github.com/repos/input-output-hk/cardano-sl","labels_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3485/labels{/name}","comments_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3485/comments","events_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3485/events","html_url":"https://github.com/input-output-hk/cardano-sl/issues/3485","id":353979394,"node_id":"MDU6SXNzdWUzNTM5NzkzOTQ=","number":3485,"title":"Issues building from source on NixOS: ignoring untrusted substituter, attribute 'cardano-sl-static' not found, URLs 404","user":{"login":"jglukasik","id":6445082,"node_id":"MDQ6VXNlcjY0NDUwODI=","avatar_url":"https://avatars3.githubusercontent.com/u/6445082?v=4","gravatar_id":"","url":"https://api.github.com/users/jglukasik","html_url":"https://github.com/jglukasik","followers_url":"https://api.github.com/users/jglukasik/followers","following_url":"https://api.github.com/users/jglukasik/following{/other_user}","gists_url":"https://api.github.com/users/jglukasik/gists{/gist_id}","starred_url":"https://api.github.com/users/jglukasik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglukasik/subscriptions","organizations_url":"https://api.github.com/users/jglukasik/orgs","repos_url":"https://api.github.com/users/jglukasik/repos","events_url":"https://api.github.com/users/jglukasik/events{/privacy}","received_events_url":"https://api.github.com/users/jglukasik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-25T03:34:20Z","updated_at":"2018-11-16T13:39:59Z","closed_at":null,"author_association":"NONE","body":"Hey folks, I've been trying to build cardano-sl from source, on NixOS. I've ran into three small issues so far:\r\n\r\n### 1. I had issues setting up the binary cache.\r\nFirst, the [build docs](https://github.com/input-output-hk/cardano-sl/blob/master/docs/how-to/build-cardano-sl-and-daedalus-from-source-code.md) for adding the binary cache are slightly off for NixOS, where you're discouraged from editing `/etc/nix/nix.conf` manually. Instead, `man nix.conf` explains how a user can set their own config at `~/.config/nix/nix.conf`, so I put those two build-cache configuration lines in there.\r\n\r\nBut then, I get the following error:\r\n```\r\nwarning: ignoring untrusted substituter 'https://cache.nixos.org'\r\nwarning: ignoring untrusted substituter 'https://hydra.iohk.io'\r\n```\r\nThere is some discussion of this problem on https://github.com/cachix/cachix/issues/26 , with workarounds given. I tried to follow those, but wasn't successful. The contents of my `~/.config/nix/nix.conf` are:\r\n```\r\njgl@n3: ~/cardano-sl $ cat ~/.config/nix/nix.conf \r\nbinary-caches            = https://cache.nixos.org https://hydra.iohk.io\r\nbinary-cache-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=\r\ntrusted-substituters     = https://cache.nixos.org https://hydra.iohk.io\r\ntrusted-users            = root jgl\r\n```\r\nI kept going, just building things straight from source without the binary cache. That lead to the next two issues:\r\n\r\n### 2. `cardano-sl-static` doesn't seem to be a build target anymore?\r\n\r\nThe docs give the nix-build command as:\r\n```\r\n    $ nix-build -A cardano-sl-static --cores 0 --max-jobs 2 --no-build-output --out-link master\r\n```\r\nbut that errors with:\r\n```\r\n    error: attribute 'cardano-sl-static' in selection path 'cardano-sl-static' not found\r\n```\r\nLooking in [default.nix](https://github.com/input-output-hk/cardano-sl/blob/develop/default.nix#L62), it looks like this is now called `cardano-sl-node-static`. Using that attribute seems to work.\r\n\r\n(nit pick, why does this command specify the cores/max-jobs flags?  I've been forgoing those for faster builds, personally. Maybe that follows some internal IOHK convention, but it seems weird to include in the public docs)\r\n\r\n### 3.   The requested URL returned error: 404 Not Found\r\n\r\nI hit 404's for two URLs:\r\nhttps://anonscm.debian.org/cgit/collab-maint/ca-certificates.git/plain/mozilla/certdata2pem.py?h=debian/20170717\r\n https://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/intltool/debian/patches/perl5.22-regex-fixes?revision=47258&view=co&pathrev=47258\r\n(example output in [this gist](https://gist.github.com/jglukasik/3c4d487df8665b2d8ebdd1de9ee6eaf7) )\r\n\r\nLooks like this is fallout from Debian migrating anonscm.debian.org, there is some discussion here https://github.com/NixOS/nixpkgs/issues/39927\r\n\r\nThe first 404 i was able to get past by running `nix-prefetch-url https://salsa.debian.org/debian/ca-certificates/raw/debian/20170717/mozilla/certdata2pem.py ` (from here https://github.com/cachix/cachix/issues/25 ) \r\n\r\nI haven't been able to get past the second 404 though. The new URL for that patch seems to be https://sources.debian.org/data/main/i/intltool/0.51.0-5/debian/patches/perl5.26-regex-fixes.patch\r\n , but the contents have changed, so the hash is different. So even if i `nix-prefetch-url`, it'll have anew hash, which means that `nix-build` will still try and pull the old version from the URL that 404s.\r\n\r\nHowever, as I was digging into this, I found that this specific issue has [already been fixed in nixpkgs](https://github.com/NixOS/nixpkgs/commit/203c8c4534c166406dac460f1b01c410a4159ffb). So I think the real issue here, is that whatever nixpkg that cardano-sl is using that has intltool as a dependency, is being pinned to version that is too old.\r\n\r\nI tried to grok how pinning of nixpkgs is happening here, but didn't get too far before i gave up (for example, whats the difference between `cardano-sl/fetch-nixpkgs.nix` and `cardano-sl/fetchNixpkgs.nix`?)\r\n\r\n---\r\n(btw, thanks for open sourcing all of this! its been a fun way to dive deeper into Nix :slightly_smiling_face:)"},"comment":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/comments/439395722","html_url":"https://github.com/input-output-hk/cardano-sl/issues/3485#issuecomment-439395722","issue_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3485","id":439395722,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTM5NTcyMg==","user":{"login":"rvl","id":1019641,"node_id":"MDQ6VXNlcjEwMTk2NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/1019641?v=4","gravatar_id":"","url":"https://api.github.com/users/rvl","html_url":"https://github.com/rvl","followers_url":"https://api.github.com/users/rvl/followers","following_url":"https://api.github.com/users/rvl/following{/other_user}","gists_url":"https://api.github.com/users/rvl/gists{/gist_id}","starred_url":"https://api.github.com/users/rvl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvl/subscriptions","organizations_url":"https://api.github.com/users/rvl/orgs","repos_url":"https://api.github.com/users/rvl/repos","events_url":"https://api.github.com/users/rvl/events{/privacy}","received_events_url":"https://api.github.com/users/rvl/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T13:39:59Z","updated_at":"2018-11-16T13:39:59Z","author_association":"MEMBER","body":"Hi @jglukasik, thanks for your interest!\r\n\r\nIn the `develop` branch we have updated the nixpkgs pin and fixed the `fetchNixpkgs.nix` thing. If you're interested in playing with the code then the `develop` branch is better than `master`.\r\n\r\nI very strongly recommend using the binary cache.\r\n\r\nI added docs for NixOS in #3860.\r\n"}}
{"actor":{"display_login":"rvl"}}