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

provide static builds of master branch for macos #1089

Closed
ghost opened this Issue Jun 9, 2018 · 14 comments

Comments

Projects
None yet
5 participants
@ghost

ghost commented Jun 9, 2018

https://ziglang.org/download/
says one should use master, but homebrew provides the last released version only

maybe release builds can be proved for Mac OS for the master branch as well?
I just wanted to play around a bit and look at the examples but cannot without a more recent zig binary and do not really fancy building myself
¯ _(ツ)_/¯

I searched the issues and found nothing matching but quite possibly I missed something.

... exited to see what Andrew is up to now when he has even more time for zig !

@andrewrk andrewrk added this to the 0.4.0 milestone Jun 9, 2018

@andrewrk andrewrk changed the title from Mac binary of master maybe ? to provide static builds of master branch for macos Jun 9, 2018

@ghost

This comment has been minimized.

ghost commented Jun 9, 2018

I thought this was not a hard question because you already have travis set up, but the hell wanted flag suggests something else.
is there anything major or just someone needs to do it?

@andrewrk

This comment has been minimized.

Member

andrewrk commented Jun 9, 2018

I believe that right now the travis script uses homebrew and builds a dynamically linked binary. So we would need a more advanced travis script, potentially downloading a pre-built static build of llvm and clang.

@ghost

This comment has been minimized.

ghost commented Jun 9, 2018

I'm actually not sure we/ I'd need a statically linked binary.
Maybe the dynamically linked one would work just fine for the time being and the 90% case.

I could at least check that, but I could just not yet find a place with build artifacts.

YMMV

@BraedonWooding

This comment has been minimized.

Contributor

BraedonWooding commented Jun 10, 2018

Perhaps we could look into something like bintray for hosting the binaries? It can be setup to do nightly builds via a travis like script.

@bnoordhuis

This comment has been minimized.

Member

bnoordhuis commented Jun 10, 2018

Perhaps we could look into something like bintray for hosting the binaries?

If you check them into git and tag them, you can use github to host them using this: https://developer.github.com/v3/repos/releases/#create-a-release

I'd do that in a separate repository though.

@ghost

This comment has been minimized.

ghost commented Jun 10, 2018

so I was just curious enough to build zig.
I think the instructions need an update cause brew does not ship llvm@6, llvm@6 is actually just llvm.

and I'd like to have a note what make install does in this case. I do not really like makefiles instilling stuff all over my computer.
so I tried simple make without arguments but then get

./zig build --build-file ../build.zig test
Unable to find zig lib directory
@isaachier

This comment has been minimized.

Contributor

isaachier commented Jun 10, 2018

The default install is into the build folder. It won't be installed to root directories in the system.

@ghost

This comment has been minimized.

ghost commented Jun 10, 2018

ok so I'll give it another try
btw. llvm@6 is somewhat weird, so brew search turns up:

brew search llvm
==> Searching local taps...
llvm ✔           llvm@5 ✔         llvm@3.7         llvm@3.9         llvm@4

but you can still brew install llvm@6 but at least on my system cmake only worked using cmake .. -DCMAKE_PREFIX_PATH=/usr/local/opt/llvm

@xtian

This comment has been minimized.

Contributor

xtian commented Sep 10, 2018

Not a static build, but as of Homebrew/homebrew-core@36d3bdc you can install from master using

brew install zig --HEAD
@ghost

This comment has been minimized.

ghost commented Sep 10, 2018

now I think if zig was to tag like weekly releases homebrew could actually build the binaries themselve

@andrewrk

This comment has been minimized.

Member

andrewrk commented Sep 27, 2018

I just created https://github.com/ziglang/zig/wiki/Building-Static-Zig-on-MacOS. I'm waiting for LLVM (and then clang) to build using this guide and I'll see if it works. Using the system compiler (clang) I was able to get it down to just libSystem and libc++, but clang doesn't support -static-libstdc++, and so let's see if compiling everything with gcc gets it down to only libSystem.

If this works I can at least provide a static MacOS binary for 0.3.0. And then for automatic builds, it's just a matter of either getting caching working or having more time in our macos CI server (see #835)

@ghost

This comment has been minimized.

ghost commented Sep 27, 2018

was there a specific issue why you chose gcc-7 instead of gcc-8 which is the current version in home-brew? I don't think this will improve performance or anything in a meaningful way and maybe you chose it because there were some warning issues with gcc-8 (which I think are resolved?), but in case there was no particular reason I'd wanted to point this out.

Thanks for your effort, looking forward to using them 👍

@andrewrk

This comment has been minimized.

Member

andrewrk commented Sep 27, 2018

screen shot 2018-09-27 at 6 29 02 pm

it worked!

was there a specific issue why you chose gcc-7 instead of gcc-8

no, I probably just have a slightly outdated homebrew. I'm sure gcc-8 will work. Well, that and I've been building with gcc 7.3 on linux. better to keep the number of variables small when testing something.

@andrewrk

This comment has been minimized.

Member

andrewrk commented Nov 2, 2018

With 1554dd9 and c7b7928 we now have automatic static builds of master branch for macos, same as we have for linux.

When azure finishes building master branch (in about 50 min) I will update ziglang.org with the new url and close this issue.

A future improvement that can be made, if we move travis&appveyor into azure, would be having a job that gets triggered after any other successful job completion, which actually updates the url, shasum, file size, etc on the download page.

@andrewrk andrewrk closed this Nov 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment