{"action":"created","issue":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1855","repository_url":"https://api.github.com/repos/Project-OSRM/osrm-backend","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1855/labels{/name}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1855/comments","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1855/events","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/1855","id":124984363,"number":1855,"title":"Experimental: reproducible development environment via nix-shell","user":{"login":"daniel-j-h","id":527241,"avatar_url":"https://avatars.githubusercontent.com/u/527241?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-j-h","html_url":"https://github.com/daniel-j-h","followers_url":"https://api.github.com/users/daniel-j-h/followers","following_url":"https://api.github.com/users/daniel-j-h/following{/other_user}","gists_url":"https://api.github.com/users/daniel-j-h/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-j-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-j-h/subscriptions","organizations_url":"https://api.github.com/users/daniel-j-h/orgs","repos_url":"https://api.github.com/users/daniel-j-h/repos","events_url":"https://api.github.com/users/daniel-j-h/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-j-h/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-05T15:04:49Z","updated_at":"2016-02-24T23:51:30Z","closed_at":"2016-02-24T23:51:30Z","pull_request":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/1855","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/1855","diff_url":"https://github.com/Project-OSRM/osrm-backend/pull/1855.diff","patch_url":"https://github.com/Project-OSRM/osrm-backend/pull/1855.patch"},"body":"This adds a basix `shell.nix` file (similar to requirements.txt for\r\nPython's pip), for reliable and reproducible builds.\r\n\r\nEnter the environment:\r\n\r\n    nix-shell\r\n\r\nOr enter the environment without system binaries available:\r\n\r\n    nix-shell --pure\r\n\r\nThis is similar to a negation of `pyvenv --system-side-packages`.\r\n\r\nOn first invocation all dependencies (i.e. compiler, build system,\r\ndependencies) are downloaded by means of resolving a dependency tree\r\ndown to libc. Because this tree can be hashed at nodes, binary packages\r\ncan be fetched for the common packages and verified against hashes.\r\n\r\nIn case we have ABI mismatches, e.g. because we want to use gcc5 with\r\nits stdlib, we can override the dependencies' environment. Nix then looks\r\nfor binary caches for those packages with the gcc5 stdlib and if they\r\nare not available, builds the dependency tree with the new environment.\r\n\r\n    buildInputs = map (pkg: pkg.override { stdenv = overrideCC stdenv gcc5; }) [ gcc5 cmake .. ];\r\n\r\nNote: this is a first try in providing a development environment that\r\nallows for reproducible builds. Building osrm-backend works, but I did\r\nnot (yet?) add all dependencies e.g. for the tools (gdal etc.).\r\n\r\nTo test it yourself, either enter the dev environment via `nix-shell`,\r\nor run the build command once inside the env:\r\n\r\n    nix-shell --run 'mkdir build && cd build && cmake .. && cmake --build .'\r\n\r\nIf you ever used Gentoo, it's like a modern and better Portage with\r\noptional binary caches. Currently the Haskell community uses nix\r\nin order to get out of cabal and dependency hell.\r\n\r\nPlease see the quickstart guide below, and give it a try.\r\n\r\nResources:\r\n\r\n- http://nixos.org/nix/\r\n- https://nixos.org/nix/manual/#chap-quick-start\r\n- https://nixos.org/nixpkgs/manual/\r\n\r\n/cc @springmeyer @danpat @TheMarex "},"comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments/188523795","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/1855#issuecomment-188523795","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1855","id":188523795,"user":{"login":"TheMarex","id":606968,"avatar_url":"https://avatars.githubusercontent.com/u/606968?v=3","gravatar_id":"","url":"https://api.github.com/users/TheMarex","html_url":"https://github.com/TheMarex","followers_url":"https://api.github.com/users/TheMarex/followers","following_url":"https://api.github.com/users/TheMarex/following{/other_user}","gists_url":"https://api.github.com/users/TheMarex/gists{/gist_id}","starred_url":"https://api.github.com/users/TheMarex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheMarex/subscriptions","organizations_url":"https://api.github.com/users/TheMarex/orgs","repos_url":"https://api.github.com/users/TheMarex/repos","events_url":"https://api.github.com/users/TheMarex/events{/privacy}","received_events_url":"https://api.github.com/users/TheMarex/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T23:51:30Z","updated_at":"2016-02-24T23:51:30Z","body":"Not actionable, closing for now."}}