-
Notifications
You must be signed in to change notification settings - Fork 97
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
Publish asc.tar as build product #580
Conversation
wrapProgram $out/bin/asc \ | ||
--set-default ASC_RTS "$out/rts/as-rts.wasm" | ||
mkdir -p $out/nix-support | ||
echo "file bin $out/asc.tar" >> $out/nix-support/hydra-build-products |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The asc
is dynamically linked. Do we want to ship a dynamically linked binary? Or find out if we can statically link it:
~/dfinity/actorscript $ ldd /nix/store/2bqvpayc1cs8kmhj34n2fii2zanm6p8i-asc-bin/bin/asc
linux-vdso.so.1 (0x00007fff563b8000)
libm.so.6 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libm.so.6 (0x00007f92dd28c000)
libdl.so.2 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libdl.so.2 (0x00007f92dd287000)
libc.so.6 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6 (0x00007f92dd0d1000)
/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f92dd424000)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want a static binary for both linux and darwin, would you know how to set that up @nomeata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for static linking; but I also don't know how to do it and would have to research it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is pkgsStatic
(NixOS/nixpkgs#48803, not sure if there is any documentation about it), but I don't know if it works with ocaml code. I wonder if we can send such questions to the Tweak guys. Also about building for Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick test with using nixpkgs.pkgsStatic.ocaml-ng.ocamlPackages_4_07
as the Ocaml package source failed. I expect that building statically will face similar challenges as cross-building for windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is support for cross-compilation planned for the compiler itself in two phases for OCaml 4.10 later this year and 4.11 early next year, but there are no issues/PRs to track at this stage.
Maybe we should have written the compiler in Haskell, there I know how to cross- and statically-compile :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an attribute asc-tar-x86_64-darwin
in ci.nix for now
@@ -339,7 +349,7 @@ rec { | |||
''; | |||
installPhase = '' | |||
mkdir -p $out | |||
tar -rf $out/stdlib-doc.tar doc | |||
tar -rf $out/stdlib-doc.tar -C doc . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! here's what man
says about tar -C
, just for any future readers:
-C directory
In c and r mode, this changes the directory before adding the following files. In x
mode, change directories after opening the archive but before extracting entries from
the archive.
This change simplifies the paths in the tar
file a lot, and makes the unpacking code in dfx
simpler.
thanks @FloorLamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
## Changelog for motoko-base: Branch: next-moc Commits: [dfinity/motoko-base@1f52c6b8...1b116fe9](dfinity/motoko-base@1f52c6b...1b116fe) * [`1b116fe9`](dfinity/motoko-base@1b116fe) feat: `Region.mo` library offering isolated regions of IC stable memory ([dfinity/motoko-base#580](https://github.com/dfinity/motoko-base/issues/580))
## Changelog for motoko-base: Branch: next-moc Commits: [dfinity/motoko-base@1f52c6b8...1b116fe9](dfinity/motoko-base@1f52c6b...1b116fe) * [`1b116fe9`](dfinity/motoko-base@1b116fe) feat: `Region.mo` library offering isolated regions of IC stable memory ([dfinity/motoko-base#580](https://github.com/dfinity/motoko-base/issues/580))
## Changelog for candid: Branch: master Commits: [dfinity/candid@171a58dd...6313d973](dfinity/candid@171a58d...6313d97) * [`6313d973`](dfinity/candid@6313d97) bump ic-agent ([dfinity/candid#580](https://github.com/dfinity/candid/issues/580))
## Changelog for candid: Branch: master Commits: [dfinity/candid@171a58dd...6313d973](dfinity/candid@171a58d...6313d97) * [`6313d973`](dfinity/candid@6313d97) bump ic-agent ([dfinity/candid#580](https://github.com/dfinity/candid/issues/580))
This doesn't work on Mac since we don't have a darwin build set up for this repo yet