From: Henri M. <hen...@gm...> - 2020-07-02 00:41:02
|
On 01/07/20, 17:15, Dima Kogan wrote: > Henri Menke <hen...@gm...> writes: > > > The original motivation for this change was that I wanted to build the > > development version on NixOS. In the Nix packaging system you can build > > stuff directly from a git checkout, but because the system emphasizes > > reproducible builds, the build cannot depend on the contents of the .git > > directory because these are actually non-deterministic (due to git gc), > > so two checkouts of the same commit may actually have a different .git > > directory. This will lead to spurious build failures because the output > > hashes differ. > > > > https://github.com/NixOS/nixpkgs/issues/8567 > > https://github.com/NixOS/nixpkgs/issues/20521 > > > > I thought it would be a good idea to upstream the support for this but > > if this is too much of a pain here, I can also patch it locally. > > Thanks for explaining. What would you do if this project was hosted > somewhere that doesn't make these snapshots available? Like github for > instance? > I'm not actually using the snapshot that is generated by SourceForge (on GitHub you can also download snapshots, btw). In my NixOS overlay I'm cloning from the git repo but normally the .git directory is removed for the aforementioned reasons. Below you can see my Nix derivation to build gnuplot from git which currently randomly fails due to git repacking its .git directory which changes the output hash of the derivation (that's how Nix verifies the integrity of packages). Sorry, this might all sound very obscure if you've never used Nix. Kind regards, Henri self: super: { gnuplot_qt = super.gnuplot_qt.overrideAttrs (oldAttrs: { version = "5.5_8685df8"; src = self.fetchgit { url = "https://git.code.sf.net/p/gnuplot/gnuplot-main"; rev = "8685df8e070211f99337bdf69162ab0ca6b4b1e6"; sha256 = "17yv88xxfwgy9r07irbpwf30np8vvgkwy3nd3ngrrqw58ibjlrm6"; # <--- This changes if .git changes leaveDotGit = true; # <--- Fix timestamp.h generation }; nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ self.autoconf self.automake self.git ]; postPatch = '' git checkout -b master # <--- Fix timestamp.h generation ./prepare ${oldAttrs.postPatch} ''; }); } > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta |