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

Building Snaps on Travis CI Trusty #1736

Closed
chgibb opened this issue Jun 22, 2017 · 5 comments
Closed

Building Snaps on Travis CI Trusty #1736

chgibb opened this issue Jun 22, 2017 · 5 comments

Comments

@chgibb
Copy link

chgibb commented Jun 22, 2017

  • Version:
    electron-builder: ^19.7.1
    snapcraft : 1.1.0
    Travis: sudo: required, dist: trusty, node: '8'
  • Target:
    Linux x64 snap

Running:

node_modules/.bin/electron-builder --prepackaged=app-linux-x64 --linux snap

results in the following:

Building Snap for arch x64
⚠️  Application icon is not set, default Electron icon will be used
Error: snapcraft exited with code 2
Error output:
usage: snapcraft [-h] [-v]
                 {init,shell,run,list-plugins,clean,pull,build,stage,snap,assemble,all,version,help}
                 ...
snapcraft: error: unrecognized arguments: --target-arch -o /home/travis/build/chgibb/PHAT/dist/phat_0.0.26_amd64.snap
    at ChildProcess.childProcess.once.code (/home/travis/build/chgibb/PHAT/node_modules/electron-builder-util/src/util.ts:128:14)
    at Object.onceWrapper (events.js:318:30)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:897:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
From previous event:
    at spawn (/home/travis/build/chgibb/PHAT/node_modules/electron-builder-util/src/util.ts:96:3)
    at /home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/targets/snap.ts:139:7
    at Generator.next (<anonymous>)
    at /home/travis/build/chgibb/PHAT/node_modules/graceful-fs/graceful-fs.js:99:16
    at /home/travis/build/chgibb/PHAT/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at SnapTarget.build (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/targets/snap.js:167:11)
    at postAsyncTasks.push.default.map.it (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/platformPackager.ts:101:85)
From previous event:
    at LinuxPackager.packageInDistributableFormat (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/platformPackager.ts:101:41)
    at /home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/platformPackager.ts:97:10
From previous event:
    at LinuxPackager.pack (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/platformPackager.js:153:11)
    at /home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/packager.ts:229:24
From previous event:
    at Packager.doBuild (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/packager.js:300:11)
    at /home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/packager.ts:161:52
    at Generator.next (<anonymous>)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
    at Packager.build (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/packager.js:211:11)
    at /home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/builder.ts:228:40
    at Generator.next (<anonymous>)
    at build (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/builder.js:69:21)
    at Object.args [as handler] (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/cli/cli.ts:41:4)
    at Object.self.runCommand (/home/travis/build/chgibb/PHAT/node_modules/yargs/lib/command.js:233:22)
    at Object.Yargs.self._parseArgs (/home/travis/build/chgibb/PHAT/node_modules/yargs/yargs.js:1018:24)
    at Object.get [as argv] (/home/travis/build/chgibb/PHAT/node_modules/yargs/yargs.js:927:19)
    at Object.<anonymous> (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/src/cli/cli.ts:36:15)
From previous event:
    at build (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/builder.js:69:21)
    at Object.args [as handler] (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/cli/cli.js:115:9)
    at Object.self.runCommand (/home/travis/build/chgibb/PHAT/node_modules/yargs/lib/command.js:233:22)
    at Object.Yargs.self._parseArgs (/home/travis/build/chgibb/PHAT/node_modules/yargs/yargs.js:1018:24)
    at Object.get [as argv] (/home/travis/build/chgibb/PHAT/node_modules/yargs/yargs.js:927:19)
    at Object.<anonymous> (/home/travis/build/chgibb/PHAT/node_modules/electron-builder/out/cli/cli.js:111:314)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
mv: cannot stat ‘dist/*.snap’: No such file or directory

I have a feeling this has to do with electron-builder expecting a newer version of snapcraft than what I can wrangle onto Travis CI. Is this a no go due to the age of the distros that Travis CI supports? Could anyone recommend using an older version of electron-builder instead or a way to get a newer version of snapcraft onto Travis CI? The build works fine on my dev machine running Ubuntu 16.04.

@develar
Copy link
Member

develar commented Jun 22, 2017

snapcraft : 1.1.0

2.x is required.

@develar develar closed this as completed Jun 22, 2017
@develar
Copy link
Member

develar commented Jun 22, 2017

Please use Docker if you don't want to configure all this hell.

@chgibb
Copy link
Author

chgibb commented Jun 22, 2017

@develar thank you for the quick response. This does not exactly answer any of my questions however.

From the wiki: https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build

Travis Linux

Trusty is required — default Travis Linux dist is outdated and icnsutils version is non-functional.

sudo: required
dist: trusty

This would suggest to me that my Travis config is correct.

As for your recommendation about Docker, how would I obtain a Docker image for electron-builder?

@develar
Copy link
Member

develar commented Jun 22, 2017

how would I obtain a Docker image for electron-builder?

We provide prebuilt docker images — https://github.com/electron-userland/electron-builder/wiki/Dockerelectronuserland/electron-builder:latest

I cannot provide you example for Travis, but for CircleCI — https://github.com/electron-userland/electron-builder/blob/master/circle.yml Anyway, should be easy, please see https://docs.travis-ci.com/user/docker/

This would suggest to me that my Travis config is correct.

I will fix docs.

@chgibb
Copy link
Author

chgibb commented Jun 22, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants