Closed arky closed 4 years ago
@okdistribute Testing windows artifact from build 5843279 and build 58488207 results in following error on Windows 32 machine.
I was able to get more information by using asar: false
in the windows build:
Looks like the issue is with leveldown. We are one of the 1.9% here that need to create our own build.. https://github.com/Level/leveldown/issues/554
@okdistribute Yup, That reminds me that I had to rebuild leveldown package before building mapeo-desktop on 32bit machines.
@arky what did you type to rebuild?
To build mapeo-desktop on 32bit machine you had rebuild leveldown without 64-bit flag.
"cd node_modules/leveldown && cross-env HOME=~/.electron-gyp node-gyp rebuild --target=2.0.7 --runtime=electron --dist-url=https://atom.io/download/atom-shell
Please refer to this bug https://github.com/digidem/mapeo-desktop/issues/237
Which version of leveldown are y'all on? The above command suggests on older version.
On latest leveldown (5.x) there should be no need to rebuild. If node is 32-bit, then on npm install
leveldown will see that it has no bundled prebuild for windows 32-bit and fallback to compilation. The resulting build is compatible with both node and electron.
@vweevers Thanks for responding. I realize now that you're right, we updated to leveldown 5.x since #237 was filed.
That's what I thought but still running into issues... I've been doing this on GitHub Actions and experimenting on this PR
@vweevers okay, doing this it seems to not have rebuilt leveldown, and says it can't find a native build for win32
I noticed here in the log for this build that electron-builder is rebuilding native modules for leveldown, but I wonder if that's failing silently?
Could be, because those electron tools are geared towards the older node-pre-gyp
and prebuild-install
. I don't know if they support leveldown's setup.
I've got a Windows machine and can maybe help, given some instructions on how to get started on mapeo-desktop
.
@vweevers thanks, that would be great. We're a small team and non-profit so any help is greatly appreciated. Mapeo Desktop should work out of the box with npm install
, npm run watch
in a new terminal window or npm run build
for one-time front-end build, and npm run dev
https://github.com/digidem/mapeo-desktop/#getting-started
With:
$ node -v
v12.11.1
$ node -p process.arch
ia32
$ git branch
* master
I see that npm install
correctly compiles leveldown
.
There's also a postinstall script that (deep breath) runs electron-builder install-app-deps
which in turn spawns node_modules/app-builder-bin/win/ia32/app-builder.exe rebuild-node-modules
which is written in Go and effectively spawns npm rebuild leveldown@5.5.1 ...
which calls the install
script of leveldown
. Which doesn't do anything, because it previously compiled and doesn't check whether that build is compatible with the target runtime. I'll get back to that.
TLDR, electron-builder install-app-deps
doesn't do anything (at least for leveldown
) but at this point in time we still have a leveldown
build that happens to be compatible with Electron.
The npm run build
and npm run dev
commands also work, and I see a LevelDB db getting created on disk, so leveldown
is correctly loaded.
Next up is packaging; I'll try that in your 32bit-builds
branch.
@okdistribute After running npm run dist
(in the 32bit-builds
branch) how can I launch Mapeo? Can I simply open dist/win-ia32-unpacked/Mapeo.exe
or is that not a realistic test and should I instead run the installer exe?
Side note: the 32bit-builds
branch has this (overly helpful) error:
$ npx electron-builder --ia32
• electron-builder version=21.2.0 os=10.0.18362
• loaded configuration file=package.json ("build" field)
⨯ Package "electron-rebuild" is only allowed in "devDependencies". Please remove it
from the "dependencies" section in your package.json.
The 32-bit leveldown build correctly gets included in win-ia32-unpacked/resources/app/node_modules/..
and Mapeo.exe
works - but it created registry keys so I ran the installer anyway to have the uninstaller cleanup those keys afterwards.
And... the installed Mapeo also works!
It stops working when I re-enable asar though. Another problem is that npm run dist
builds both --x64
and --ia32
, and because it doesn't rebuild leveldown, you'd have to separate that into two CI jobs or npm scripts.
Given the amount of tools involved, it might take some time and thought to properly fix rebuilding. So I'm leaning towards just adding a 32-bit prebuild to leveldown
(and making note of the issues elsewhere).
Thanks so much for investigating.
Adding 32-bit builds to leveldown will really help the electron ecosystem!
This will be fixed in the next release, but you can try it now in this build https://github.com/digidem/mapeo-desktop/actions/runs/67706742
@okdistribute Tested on windows 32 bit machine. Works like a charm.
Given the amount of tools involved, it might take some time and thought to properly fix rebuilding.
Update (FYI): node-gyp-build
now respects the electron-builder
buildDependenciesFromSource
option (https://github.com/prebuild/node-gyp-build/pull/30).
nice thanks @vweevers !
Trying to run the Mapeo Desktop (5.x) installer on 32 bit Windows 10 Pro machines results in '64-bit Windows is required' message. I have tested multiple versions of latest installers.
Most NGO/CSO organization have legacy machines hence the need for 32bit installers. I had managed to download and install Atom editor installer on this machine to check if electronJS applications are supported.