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

Publish asc.tar as build product #580

Merged
merged 6 commits into from
Jul 22, 2019
Merged

Publish asc.tar as build product #580

merged 6 commits into from
Jul 22, 2019

Conversation

FloorLamp
Copy link
Contributor

@FloorLamp FloorLamp commented Jul 17, 2019

This doesn't work on Mac since we don't have a darwin build set up for this repo yet

default.nix Outdated Show resolved Hide resolved
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
Copy link
Collaborator

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)

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Collaborator

@nomeata nomeata Jul 19, 2019

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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.

(ocaml/dune#144 (comment))

Maybe we should have written the compiler in Haskell, there I know how to cross- and statically-compile :-)

Copy link
Contributor Author

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 .
Copy link
Contributor

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

Copy link
Contributor

@matthewhammer matthewhammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FloorLamp FloorLamp merged commit 6468c7e into master Jul 22, 2019
@FloorLamp FloorLamp deleted the hydra-asc branch July 22, 2019 16:55
@nomeata nomeata mentioned this pull request Sep 15, 2021
dfinity-bot added a commit that referenced this pull request Sep 6, 2023
## 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))
mergify bot pushed a commit that referenced this pull request Sep 7, 2023
## 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))
dfinity-bot added a commit that referenced this pull request Oct 31, 2024
## 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))
mergify bot pushed a commit that referenced this pull request Oct 31, 2024
## 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))
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

Successfully merging this pull request may close these issues.

3 participants