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

MacOS support #153

Open
iilyak opened this issue Feb 23, 2022 · 5 comments
Open

MacOS support #153

iilyak opened this issue Feb 23, 2022 · 5 comments

Comments

@iilyak
Copy link

iilyak commented Feb 23, 2022

Is it possible to build on MacOS for MacOS (given all build tools installed)?

What about M1 based mac?

@ddvk
Copy link
Owner

ddvk commented Feb 24, 2022

it should be possible

@waider
Copy link

waider commented Dec 27, 2022

Some notes from trying this out on x86 macOS Catalina (10.15.7) - a few things don't work quite as documented:

Building

  • node, yarn, and go installed from HomeBrew
$ node --version
v19.1.0
$ yarn --version
1.22.19
$ go version
go version go1.19.4 darwin/amd64
  • Docker Destkop installed from docker.com
  • make all fails as go on macOS no longer supports armv6 and armv7; removed those from the list of targets.
  • make container (rather than make docker)
    • this assumes that the dist/rmfakecloud-docker is a Linux x64 binary, which it won't be - it'll be a Mac binary. Modifying the Makefile to explicitly create rmfakecloud-docker as a Linux binary fixes this.
  • running dockerbuild.sh crashes out for reasons I'm not clear on and haven't debugged as yet - possibly it's a similar Linux/MacOS problem as the make container build.

Running

  • I haven't tried running "native", but it looks like the build above produces a working native binary.
  • running in current Docker Desktop requires that the data directory is specified as an absolute path, not a relative one
  • the current (as of 2022-12-27) downloadable Docker container (ddvk/rmfakecloud) isn't up-to-date with the GitHub version so may give various errors (probably not a macOS-specific issue!) fixed in latest commits
  • I've not so far gotten the handwriting recognition to work - the API call to MyScript returns a certificate error which I've not tracked down this seems to only affect the docker build I tried; it works fine in the native build
  • PDF view also doesn't appear to work - again, I've not tracked this down but it looks like something is getting passed as null somewhere along the way and that's breaking the renderer. there's a couple of cosmetic issues here but the main one appears to be a mistaken assumption on my part that the web UI would render all documents. If I put a PDF into the reMarkable then it shows up correctly in this view.

Now, having said all of the above: the important parts of this (for me, at least) work: it's syncing my documents as expected and I can manually hack about with them on the filesystem for the moment. I'll see if I can debug further to understand why a few things aren't working, but this is a combination of environments that I'm either new to or not very familiar with.

Hope this helps!

Dobrin, if I can provide more useful feedback (e.g. if there's a debug mode I can enable or whatever) let me know.

@waider
Copy link

waider commented Dec 28, 2022

Further update:

  • the native macOS binary works just fine
  • handwriting recognition via MyScript works with the native binary (the certificate error I mentioned came from running inside docker)

@waider
Copy link

waider commented Dec 31, 2022

  • running dockerbuild.sh crashes out for reasons I'm not clear on and haven't debugged as yet - possibly it's a similar Linux/MacOS problem as the make container build.

latest update (2022-12-31) fixes this.

@waider
Copy link

waider commented Jan 1, 2023

Here's a patch to address some of the issues I identifed above. Building a specific -darwin binary isn't strictly necessary, mind; I just put that in for completeness.

(this is from a local branch - I haven't cloned this repo to my own space to generate a PR.)

commit 23f8808f647168519a827acfc652d9dde6b30333 (HEAD -> local)
Author: Ronan Waide <[email protected]>
Date:   Tue Dec 27 14:53:00 2022 +0000

    macOS support: disable unsupported build targets, add specific darwin target, make Docker target explicitly Linux x64
    
    This addresses a number of issues identified in https://github.com/ddvk/rmfakecloud/issues/153:
    * current versions of go on macOS do not support armv6 & armv7 targets.
    * the Makefile `container` target was assuming that the `rmfakecloud-docker` binary was a Linux x64 binary; this was not the case on macOS.
    * there was no macOS (darwin) binary in the list of builds.

diff --git a/Makefile b/Makefile
index bcd7360..e41c2f6 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,11 @@ GOFILES += $(ASSETS)
 UIFILES := $(shell find ui/src)
 UIFILES += $(shell find ui/public)
 UIFILES += ui/package.json
-TARGETS := $(addprefix $(OUT_DIR)/$(BINARY)-, x64 armv6 armv7 arm64 win64 docker)
+TARGETS := $(addprefix $(OUT_DIR)/$(BINARY)-, x64 arm64 win64 docker darwin)
+# recent versions of go will not build armv6/armv7 on macOS.
+ifneq ($(shell go env GOOS),darwin)
+TARGETS += $(addprefix $(OUT_DIR)/$(BINARY)-, armv6 armv7)
+endif
 YARN   = yarn --cwd ui  
 
 .PHONY: all run runui clean test testgo testui
@@ -34,12 +38,15 @@ $(OUT_DIR)/$(BINARY)-win64:$(GOFILES)
 $(OUT_DIR)/$(BINARY)-arm64:$(GOFILES)
        GOARCH=arm64 $(BUILD)
 
+$(OUT_DIR)/$(BINARY)-darwin:$(GOFILES)
+       GOOS=darwin $(BUILD)
+
 $(OUT_DIR)/$(BINARY)-docker:$(GOFILES)
-       CGO_ENABLED=0 $(BUILD)
+       GOOS=linux CGO_ENABLED=0 $(BUILD)
 
 container: $(OUT_DIR)/$(BINARY)-docker
        docker build -t rmfakecloud -f Dockerfile.make .
-       
+
 run: $(ASSETS)
        go run $(CMD) $(ARG)
 

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

No branches or pull requests

3 participants