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

dfhack is mysteriously the wrong version #36819

Closed
NickHu opened this issue Mar 11, 2018 · 3 comments
Closed

dfhack is mysteriously the wrong version #36819

NickHu opened this issue Mar 11, 2018 · 3 comments

Comments

@NickHu
Copy link
Contributor

NickHu commented Mar 11, 2018

Issue description

dfhack obtained from the binary cache, and built by myself, is at version 0.44.05-alpha1 despite its nix-expression indicating it should be at version 0.44.05-r2:

let
  dfVersion = "0.44.05";
  version = "${dfVersion}-r2";
  rev = "refs/tags/${version}";
  sha256 = "1hr3qsx7rd36syw7dfp4lh8kpmz1pvva757za2yn34hj1jm4nh52";

is in <nixpkgs>/pkgs/games/dwarf-fortress/dfhack/default.nix.
I don't think this is a bug on my machine alone, and I have no idea what is causing it.

A workaround is to change the rev and sha256 above:

diff --git a/pkgs/games/dwarf-fortress/dfhack/default.nix b/pkgs/games/dwarf-fortress/dfhack/default.nix
index ca64045b185..c6e6c7f354f 100644
--- a/pkgs/games/dwarf-fortress/dfhack/default.nix
+++ b/pkgs/games/dwarf-fortress/dfhack/default.nix
@@ -6,8 +6,8 @@
 let
   dfVersion = "0.44.05";
   version = "${dfVersion}-r2";
-  rev = "refs/tags/${version}";
-  sha256 = "1hr3qsx7rd36syw7dfp4lh8kpmz1pvva757za2yn34hj1jm4nh52";
+  rev = "0e7ab27850821993ebc317bed9dc0135f030a3e5";
+  sha256 = "1cwifdhi48a976xc472nf6q2k0ibwqffil5a4llcymcxdbgxdcc9";
 
   # revision of library/xml submodule
   xmlRev = "2794f8a6d7405d4858bac486a0bb17b94740c142";

(This really ought not to fix things though because the revs should be the same!)

Steps to reproduce

In a nixpkgs checkout, at version cc4677c (currently where nixos-unstable points to):

 ❯ nix-build -A dwarf-fortress-packages.dfhack
/nix/store/fpr89xjrh0f0ll817ylkvwnckslb1q77-dfhack-0.44.05-r2

 ❯ nix-build -A dwarf-fortress-packages.dfhack --check
checking outputs of '/nix/store/9ci9ym0arqfcyqi77kgc7nbsdjk2kc3d-dfhack-0.44.05-r2.drv'...
unpacking sources
unpacking source archive /nix/store/byg9jvvdr8w02pjk5m8af03wbbivw2jc-dfhack
source root is dfhack
patching sources
applying patch /nix/store/g3rhdrcw6y8lafibyxlan9k4yh7qyk78-fix-stonesense.patch
…

Then observe the version information in /nix/store/byg9jvvdr8w02pjk5m8af03wbbivw2jc-dfhack/CMakeLists.txt indicates the source is outdated:

 ❯ grep DFHACK_RELEASE /nix/store/byg9jvvdr8w02pjk5m8af03wbbivw2jc-dfhack/CMakeLists.txt
set(DFHACK_RELEASE "alpha1")
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.15.7, NixOS, 18.03pre130932.cc4677c36ee (Impala)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.0
  • channels(root): "nixos"
  • channels(nick): "nixpkgs-18.03pre130569.7a04c2ca296"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@pbogdan
Copy link
Member

pbogdan commented Mar 11, 2018

It looks like the commit that updated the package to r2 didn't change the checksum of the source - 00ad7c0? (so Nix doesn'tt bother downloading a fresh copy and uses the older source). /cc @abbradar

@abbradar
Copy link
Member

Fixed in master (will be closed automatically)! Sorry for this -- seems I've cherry-picked a commit without a fixup. Just in case tested it again, seems to work.

abbradar added a commit that referenced this issue Mar 12, 2018
Fixes #36819.

(cherry picked from commit 2dfbef2)
@pbogdan
Copy link
Member

pbogdan commented Mar 12, 2018

Thanks!

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

No branches or pull requests

3 participants