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

Allow for using docker with macOS #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cculianu
Copy link

Hi, I have been using gitian builder on macOS with some success. It only works with the docker vm mechanism, obviously. I found I needed to modify the script that generates the Dockerfile though, to not use a local debian cache in the 'Darwin' case. This MR is my modification. With this modification it 100% works on docker.

This is by no means an exhaustive set of changes -- perhaps some usage patterns will still fail on macos -- but with this at least it works for 1 path -- building the container and running the builder.

@cculianu cculianu requested a review from devrandom as a code owner August 26, 2021 11:32
We remove the local debian cache stuff since it doesn't work on a docker
container running on a macOS host.
@cculianu cculianu force-pushed the macos_support_no_debian_cache branch from 959966e to ff8d247 Compare August 26, 2021 11:53
@devrandom
Copy link
Owner

I would prefer if this (or #249) would disable the caching based on a command line flag.

@cculianu
Copy link
Author

cculianu commented Sep 6, 2021

I would prefer if this (or #249) would disable the caching based on a command line flag.

Hmm.. ok. Does it ever make sense to use the caching when on macOS host?

@devrandom
Copy link
Owner

Well, the ideal solution for non-Debian OSes would be to run the apt-cache in a VM or a docker and point the gitian builder at that.

@cculianu
Copy link
Author

cculianu commented Sep 6, 2021

Ah I see true.

Well perfect is the enemy of good enough. As it stands now gitian-builder just won't work at all on macOS as a docker host.. so .. until someone does implement a CLI arg.. this PR at least makes it work. shrug

@devrandom
Copy link
Owner

Maintaining per-OS conditionals is not ideal from a maintenance burden point of view. And a command line flag isn't that much additional effort.

ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Nov 21, 2021
Co-authored-by: Andrew#128 <[email protected]>

Summary
-------

As a follow-up to !1248, it turns out with some minor modifications,
it's possible to build using gitian on Docker for macOS!  This may save
time for people that run macOS natively (such as me).

In short: This MR allows the `--docker` options to work on macOS without failing.

In a future MR I will also compose some documentation about how to get
it working on macOS 100%.

For now it also needs you to use a fork of gitian-builder from here:

    https://github.com/cculianu/gitian-builder.git
    BRANCH: macos_support_no_debian_cache

There is a PR for this change that I submitted to the main
gitian-builder repo: devrandom/gitian-builder#252

Test Plan
---------

- Run gitian builder on Linux as normal to ensure that nothing broke.

**Optional:**

- If you are on a **macOS** host, get docker installed and running, check-out
  this branch, and also check-out: https://github.com/cculianu/gitian-builder.git
  branch: `macos_support_no_debian_cache` into your `gitian-builder`
  directory.
- Put the modified script from this MR on the top-level, next to your
  `bitcoin-cash-node` directory.
- Run: `./gitian-build.py --setup --docker`
- Run: `./gitian-build.py --docker -b -D -n -c -o lwm "satoshi" master`
- After a great deal of time waiting for it to rebuild the universe, you
  should have some static binaries built!
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.

2 participants