How to bundle a python server with pyinstaller for AppStore as 64bit only? - python-3.x

Context:
I am trying to put an electron app on the App Store. The app features a web frontend and a python backend. Nothing fancy so far.
The backend however features a separate server written in python. This server is a standalone application.
The electron app bundles the main app together with the python standalone server.
The problem:
When building the server as an executable I use pyinstaller on a python 3.5 development environment. Upon uploading to the AppStore I receive the following error:
1 package(s) were not uploaded because they had problems:
/var/folders/39/3v0phzy173s3qxkbxzvcpd5c0000gn/T/82AB662A-44C8-41E9-A213-8BF672F3DF10/1443777291.itmsp - Error Messages:
ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/AppKit._AppKit.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/AppKit._inlines.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/CoreFoundation._CoreFoundation.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/CoreFoundation._inlines.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/Foundation._Foundation.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/Foundation._inlines.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/PIL._imaging.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/PIL._imagingtk.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/PIL._webp.so, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libjpeg.9.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libopenjp2.2.1.0.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libtiff.5.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libwebp.7.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libwebpdemux.2.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libwebpmux.3.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/libz.1.2.11.dylib, com.ShapeRobotics.FableMac.pkg/Payload/Fable.app/Contents/Resources/app/app/app/server/objc._objc.so)]'. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018."
We tried building the server using this:
pyinstaller server.spec --distpath ../app/app --noconfirm
It didn't work.
Another incantation I use to bundle the python server trying to force 64bit is:
arch -64 python ~/anaconda3/envs/shape/bin/pyinstaller server.spec -s --osx-bundle-identifier com.ShapeRobotics.FableMac --distpath ../app/app --noconfirm"
Why I'm sure it's the server:
I was successful in signing the app and getting it uploaded to the AppStore w/o the server packed in.
After packing in the server the 'i386' architecture error popped up.
Consequently my efforts so far have been focused to eliminate any shred of 32bit code in the server.
I assume that in order to do this I must properly configure the .spec file used by pyInstaller.
Does this make sense?
Is there a way to configure the spec file to force exclusive 64bit on anything bundled inside?
Is there some clear cut way to make the AppStore upload not vomit the 'i386' error?
Thank you!

Related

How to run an Electron .exe app on Linux?

I'm trying to run an application build with Electron on Linux. They app maker offers an .exe installation file. So I figured I'd install it in WINE, but I seem to be missing something the app needs to run.
Since the install is an .exe, do I need WINE? And if I need WINE, what do I need to install to make the app work? I have tried two Electron apps, both only downloadable as a .exe install file.
Electron adds os native calls, so .exe files usually do not work. WINE is not able to emulate all of those calls, so if it isn't working for you, then you are out of luck I guess. Look for apps that offer linux versions, like https://www.electronjs.org/apps/camunda-modeler. If you have access to the repository, chances are they build it using electron-builder. You can just build it yourself with the command electron-builder build --linux in most cases

Can I run .exe file on Heroku?

I am building a node app that has a function that requires running an .exe file. I am using the .exe because it was the only was I was able to get my my legacy fortran code to compile (through intel visual fortran). Will I be able to get my app to run through heroku, and if so, is there anything I need to do besides the basic deploy?
Thanks in advance.
I don't think Heroku has any windows servers.
As you have the Heroku CLI to enter into the machine where your app is running you can try using Wine (https://help.ubuntu.com/community/Wine) to run your exe.

Can I compile/package a Node-Webkit (NW.js) app into an exe for windows and a version for Linux?

I've looked on the Node-Webkit site and it appears to say that I can make an application with HTML5 and compile it for Windows, Linux of Mac so it will run without the need for the user to install Node.js separately. However, when I try their sample apps (e.g. https://github.com/leanote/desktop-app found on the official NW.js page: https://github.com/nwjs/nw.js/wiki/List-of-apps-and-companies-using-nw.js ), the ".exe" file does not run the app (on either Win 7 or XP). It just opens a simple browser window with the address "nw:blank" and a gray page says "NW.JS" and does nothing.
Can these apps be packaged and run without requiring the user to install node.js?
https://github.com/leanote/desktop-app 's nw folder is not the distribute leanote app, it's just the NW. You must build the desktop-app. The README has written How to build it, How to develop it
You can download the distributed version via: https://github.com/leanote/desktop-app/releases
You might try... node-webkit-builder ... which is supposed to build a huge .EXE file which is self-contained for you. Otherwise, the instructions for distributing... how to package and distribute, see Step 2b.

Getting sqlite3 on clients computer without needing them to compile and install libraries

I need to build a self contained appjs application with sqlite3, for win xp 32bit.
I myself am running windows 7 32bit and have not been possible to install sqlit3 via npm. I've tried installing all the gyp and correct python code, the errors are numerous and never ending.
Is there a way I can get a zipped version of the sqlite3 node modules for win32 that is precompiled/built so I can A) use it on my system for development and B) give the client without them needing to run any setups?
EDIT I've been googling around reading stuff like building sqlite3 for windows is a nightmare & this https://github.com/developmentseed/node-sqlite3/issues/55 has been linked a few times. Will my client be able to run the app without having to install visual studio or python or is that just the requirement? If so is there any other database that can be self contained without running a database server?
Just use a pure Javascript implementation of SQLite like SQL.js

Why are my AIR apps packaged on linux being corrupt when used on the mac?

I have a need to generate my air app online on my linux webserver. I create a signature and package the app up with adt and then download it to my desktop mac and try and install it, it says the package is corrupt and to get another copy. But when I compile it on the mac (using the exact same commands to adt) it installs and runs fine.
Why is packaging using the linux SDK creating corrupt .air files ?
It seems the adt binary doesn't work 100% in Linux.

Resources