sqlectron / sqlectron-gui

A simple and lightweight SQL client desktop with cross database and platform support.
https://sqlectron.github.io/
MIT License
4.57k stars 524 forks source link

Build fails on Arch Linux #143

Closed radimsuckr closed 8 years ago

radimsuckr commented 8 years ago

Hi,

I tried to build sqlelectron 1.8 from source on Arch Linux and the build command fails. I ran these commands:

npm install
npm run build:linux

The installation worked fine, but the build command fails with following message:

Error: Application entry file ./out/browser/main.js could not be found in package. Seems like a wrong configuration.
    at LinuxPackager.<anonymous> (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/platformPackager.ts:245:13)
    at undefined.next (native)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)
From previous event:
    at tsAwaiter (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/awaiter.ts:10:47)
    at Object.build (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/builder.ts:30:59)
    at Object.<anonymous> (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/build-cli.ts:47:2)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:445:3

Also, here's Gist of the npm-debug.log file.

maxcnunes commented 8 years ago

Hi @Grelek,

The build script requires the compile script have been ran before. Could you try to execute npm run dist instead? I have never tried on Arch Linux. I hope that works.

radimsuckr commented 8 years ago

When I ran compile and then build:linux, it somehow worked. However, the final application is not what I expected... 1463053551

And the dist command fails with following message:

Error: spawn icns2png ENOENT
    at exports._errnoException (util.js:949:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
    at onErrorNT (internal/child_process.js:348:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:
    at Object.exec (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/util.ts:75:9)
    at LinuxPackager.<anonymous> (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/linuxPackager.ts:108:31)
    at undefined.next (native)
From previous event:
    at tsAwaiter (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/awaiter.ts:10:47)
    at Object.build (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/builder.ts:30:59)
    at Object.<anonymous> (/home/grelek/downloads/sqlectron-gui-1.8.0/node_modules/electron-builder/src/build-cli.ts:47:2)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:445:3

Here's corresponding Gist.

maxcnunes commented 8 years ago

There are some required packages to build the app: https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#linux.

Weird npm run compile && npm run build:linux should have the same behavior of npm run dist.

radimsuckr commented 8 years ago

I think I installed all required libs successfully. dist command now works but it still produces the same (wrong) binary.

maxcnunes commented 8 years ago

I'm gonna install a Ubuntu VM to see how it goes.

BornaP commented 8 years ago

@Grelek I see you're using latest Node version, have you tried with v4.4.4 LTS (latest recommended for most linux users)?

radimsuckr commented 8 years ago

@BornaP No, I haven't. I just downloaded nodejs package from Arch repository. I'll try 4.4.4 then.

maxcnunes commented 8 years ago

@Grelek

I have installed a VM with Ubuntu 16.04. The build works following these steps:

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install nodejs git-core icnsutils graphicsmagick xz-utils
npm install
npm run dist

The executable is in dist/Sqlectron-linux-x64/ and dist/Sqlectron-linux-ia32/.

I was using:

I have also download the ISO for Arch Linux. I will try later on that as well. But maybe take a bit more time because I have not used Arch linux before.

maxcnunes commented 8 years ago

Sorry @Grelek, I could not get a Arch Linux running. The only VM I found with Arch Linux didn't work. But since it works on Ubuntu I guess this is probably a problem with some missing package or even using a different version of some package.

radimsuckr commented 8 years ago

Hi, I tried compiling it with node 4.4.4 and it ran successfully without any errors, but I still get not working build. I'll try to investigate it a bit more when I have time. 1463474896

maxcnunes commented 8 years ago

@Grelek Could you try these steps below?

  1. Remove the node_modules from the root directory of the project
  2. Remove the node_modules from the app directory
  3. Install the deps with npm install (please provide the log)
  4. Build the app with npm run dist (please provide the log)
  5. Attach here the dist generated folder.
maxcnunes commented 8 years ago

Could you try if this one built on Ubuntu works for you? http://expirebox.com/download/459f6420e2979a0385aaaffe49ebd3be.html

radimsuckr commented 8 years ago

Hi, I tried the Ubuntu build and it works like a charm.

Now I have only npm install log, npm run dist didn't generate any logs. And I forgot to copy the dist directory, so I don't have access to it right now, will post it later.

maxcnunes commented 8 years ago

Seems is everything ok with the npm install. npm run dist should have generated an output similar to this one https://gist.github.com/maxcnunes/7e03203a76e89db258db2e93b02b8149#file-sqlectron-npm-run-dist-log (although this one is for mac). Since is possible to use the build from Ubuntu. Is there a reason to you not use them? We could include them in the release files.

denysvitali commented 8 years ago

Same error here in Arch Linux, I installed all the packages but this is what I get while dist-compiling:

ERROR in Path must be a string. Received undefined
>> success
Warning: license in the development package.json is deprecated, please move to the application package.json

TypeError: Path must be a string. Received undefined while running ./dist/Sqlectron-linux-x64/Sqlectron

screenshot from 2016-05-25 14-28-46

Okay, I was able to build it in Arch Linux x64 by downgrading node to 4.4.5 Apparently is a problem with gulp / vinyl-fs I'm going to share with you guys the compiled version, tested in Arch x64

Here it is (click it in ~20 mins since it's still uploading and I've got a pretty bad upload connection here)

BornaP commented 8 years ago

Thank you @denysvitali !

radimsuckr commented 8 years ago

@denysvitali Ok, I'll try it. I wanted to make an AUR package for SQLELECTRON but those problems slowed me down and I didn't have time to solve them. :smile:

maxcnunes commented 8 years ago

@Grelek now sqlectron has installer support for more Linux distros. Does the pacman or any other works for you? https://github.com/sqlectron/sqlectron-gui/releases/tag/v1.10.0

radimsuckr commented 8 years ago

Hi I tried pacman and sh version and none of them works for me. pacman package has some problems with dependencies.

grelek ~/downloads pacaur -U Sqlectron-1.10.0.pacman 
loading packages...
resolving dependencies...
warning: cannot resolve "libappindicator1", a dependency of "Sqlectron"
warning: cannot resolve "libnotify-bin", a dependency of "Sqlectron"
:: The following package cannot be upgraded due to unresolvable dependencies:
      Sqlectron

:: Do you want to skip the above package for this upgrade? [y/N] y
looking for conflicting packages...
 there is nothing to do
maxcnunes commented 8 years ago

@Grelek I guess I have fixed that. Could you check again please? https://github.com/sqlectron/sqlectron-gui/releases/tag/v1.11.2-beta.0

radimsuckr commented 8 years ago

@maxcnunes This works like a charm, thank you. :-)

maxcnunes commented 8 years ago

Awesome 🎉