Skip to content

Commit

Permalink
Problem: windows bundle release script is not complete (#987)
Browse files Browse the repository at this point in the history
Solution:
- adapt the pieces from cronos
  • Loading branch information
yihuang authored Jun 9, 2023
1 parent eb48f30 commit 41a1076
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
8 changes: 6 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
--owner=0 --group=0 --mode=u+rw,uga+r --hard-dereference . \
| gzip -9 > $out
'';
bundle-win-exe = drv: final.callPackage ./nix/bundle-win-exe.nix { cronosd = drv; };
bundle-win-exe = drv: final.callPackage ./nix/bundle-win-exe.nix { chain-maind = drv; };
} // (with final;
let
matrix = lib.cartesianProductOfSets {
Expand All @@ -94,7 +94,11 @@
chain-maind = callPackage ./. {
inherit rev network;
};
bundle = bundle-exe chain-maind;
bundle =
if stdenv.hostPlatform.isWindows then
bundle-win-exe chain-maind
else
bundle-exe chain-maind;
in
if pkgtype == "bundle" then
bundle
Expand Down
35 changes: 35 additions & 0 deletions nix/bundle-win-exe.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ runCommand
, windows
, stdenv
, rocksdb
, bzip2
, lz4
, snappy
, zstd
, zlib
, chain-maind
}:
runCommand "tarball-${chain-maind.name}"
{
# manually enumerate the runtime dependencies of chain-maind on mingwW64
deps = [
"${rocksdb}/bin/librocksdb-shared.dll"
"${snappy}/bin/libsnappy.dll"
"${lz4.out}/lib/liblz4.dll"
"${bzip2.bin}/bin/libbz2-1.dll"
"${zlib}/bin/zlib1.dll"
"${zstd.bin}/bin/libzstd.dll"
"${windows.mingw_w64_pthreads}/bin/libwinpthread-1.dll"
"${windows.mcfgthreads}/bin/mcfgthread-12.dll"
"${stdenv.cc.cc}/x86_64-w64-mingw32/lib/libgcc_s_seh-1.dll"
"${stdenv.cc.cc}/x86_64-w64-mingw32/lib/libstdc++-6.dll"
];
} ''
mkdir -p $out
for so in $deps
do
cp $so $out/
done
cp ${chain-maind}/bin/${chain-maind.meta.mainProgram} $out/
''

0 comments on commit 41a1076

Please sign in to comment.