-
Notifications
You must be signed in to change notification settings - Fork 285
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
Packaging for macOS #28
Conversation
This avoids issues with require('electron') using fs.readSync() breaking when we end up packaging it.
These are the defaults for electron-forge.
When packaged, we will not be able to load file:// URLs (currently not an issue because the dev workflow includes running a local HTTP server). So we will need an additional protocol for loading resources.
This will be used to package the application.
We will, at the short term at least, not target Linux.
This will be needed later as we get more complex electron-forge configuration.
This was making it hard for webpack to figure out dependencies.
When packaged, we can't just read files off the filesystem (as the layout will be different); however, we don't really need to, as we can just import it as a module, at which point webpack can find the file ahead of time.
This is needed as the path will be different when the application is packaged.
Because file:// doesn't really work due to security restrictions.
This will be needed for Vue.js integration
This does all the fixups necessary to make the build work correctly.
This is useful to have artifacts to test locally if necessary.
I tried to run the packaged app and it didn't work. The specific error was 65 from minikube which means the provider (hyperkit) is not found. |
@mattfarina Is this with a new install of minikube? The first time minikube uses the hyperkit driver it has to fix permissions to make it possible to run it with setuid root:
When this happens minikube shells out to Note also that hyperkit itself (not the driver) must be installed separately, either by having docker installed, or by installing it via homebrew: See also kubernetes/minikube#5478 Of course eventually RD will have to install it itself if not already present. Not sure if it also must be installed as root; at least docker does do it:
|
@jandubois In the non-packaged application, if you don't have hyperkit installed it should handle that case for you without you needing to do anything. It will install hyperkit and handle the permissions. hyperkit is stored in the Library with the other data. What changed about packaging the app that this no longer happens? |
@mattfarina Sorry, I should have checked the latest RD sources to see that it already does the permissions thing...
It is not the packaging; it is the way the app is started. Everything works when you start if from your controlling terminal:
I can reproduce the error when launching it via Finder, in which case I believe |
This does not seem to be correct; I don't see any place where RD installs hyperkit itself. As I pointed out above, there are 2 pieces to it:
This should maybe be a separate issue from packaging the app. |
@jandubois it automatically installs it. See kubernetes/minikube#5354 for the change that implemented that. |
@jandubois I stand corrected. That's just the driver that's needed. Yes, we need to make sure hyperkit is installed an included. What I don't understand is why I have hyperkit and got that error with the packaged app. That's more my curiosity, now. |
@mattfarina Do you keep the stdout/stderr from minikube somewhere? Also, is |
@mattfarina The issue is that We could configure the I assume we just use the hardcoded location |
Here is a command to view the logs from the last minikube command executed (add
It does show the
macOS automatically deletes temp files older than 3 days, so copy out the files if you need to reference them for longer. |
Well, I realized that in Emacs I use https://github.com/purcell/exec-path-from-shell to make sure I have my regular environment inside the Emacs shell, and then found https://github.com/sindresorhus/shell-path. I haven't looked at it, nor searched if there are alternative implementations, but just an idea in case we don't want to hard-code the location. I still think hard-coding is fine. If we bundle the binary, we might even want to always use our internal version, to make sure it is compatible. |
Closing as we have #34 as a replacement. |
…-action-lint-issue Adds json tag to port mapping types
…-action-lint-issue Adds json tag to port mapping types
This implements packaging for macOS; we can get a zip file with the
.app
out at the other end. This fixes #9.I've tried to make the individual commits individually reviewable, so doing commit-by-commit might be easier.
I'm not entirely happy about having a new
app://
protocol handler, but electron gets unhappy about loading things offfile://
— it thinks it's insecure. I'd be happy to switch it to something else if it works.New run scripts:
npm run package
— output the packaged.app
inout/
npm run make
— output distributable.zip
inout/
(Those are the default names from electron-forge.)