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

Yarn Support (rebuild) #861

Closed
amilajack opened this issue Oct 30, 2016 · 8 comments · May be fixed by qcif/data-curator#563
Closed

Yarn Support (rebuild) #861

amilajack opened this issue Oct 30, 2016 · 8 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@amilajack
Copy link

amilajack commented Oct 30, 2016

yarn version: 0.16.0, node 7.0.0

  • Version: latest:
  • All: This is a cross-platform issue:

(I should note that I am installing with yarn) I think the issue is that electron-builder tries to find incorrect flags that were passed to it and its somehow validating flags from npm. I found that when running install-app-deps from npm scripts, the --cache-min option seems to be validated by electron-builder. Here's the stack trace:

    at ChildProcess.childProcess.once.code (/Users/amila/Documents/Projects/builder-test/node_modules/electron-builder/src/util/util.ts:160:14)
    at ChildProcess.g (events.js:291:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)
From previous event:
    at spawn (/Users/amila/Documents/Projects/builder-test/node_modules/electron-builder/src/util/util.ts:123:3)
    at spawnNpmProduction (/Users/amila/Documents/Projects/builder-test/node_modules/electron-builder/src/util/util.ts:49:3)
    at installDependencies (/Users/amila/Documents/Projects/builder-test/node_modules/electron-builder/src/util/util.ts:20:122)
    at /Users/amila/Documents/Projects/builder-test/node_modules/electron-builder/src/install-app-deps.ts:31:2
    at Generator.next (<anonymous>)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)
From previous event:
    at main (/Users/amila/Documents/Projects/builder-test/node_modules/electron-builder/out/install-app-deps.js:29:21)
    at Object.<anonymous> (/Users/amila/Documents/Projects/builder-test/node_modules/electron-builder/out/install-app-deps.js:73:1)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.runMain (module.js:607:10)
    at run (bootstrap_node.js:382:7)
    at startup (bootstrap_node.js:137:9)
    at bootstrap_node.js:497:3

Everything seems to work fine when installing with npm

@amilajack amilajack changed the title Bug: electron builder fails when it detects npm's --cache-min Bug: install-app-deps fails when it detects npm's --cache-min Oct 30, 2016
@amilajack amilajack changed the title Bug: install-app-deps fails when it detects npm's --cache-min Bug: Yarn install-app-deps fails when it detects npm's --cache-min Oct 30, 2016
@develar
Copy link
Member

develar commented Oct 31, 2016

Yarn will be not supported until yarnpkg/yarn#756 is not fixed or rebuild will be not implemented on our side.

@develar develar changed the title Bug: Yarn install-app-deps fails when it detects npm's --cache-min yarn install-app-deps fails when it detects npm's --cache-min Oct 31, 2016
@develar
Copy link
Member

develar commented Oct 31, 2016

This error is fixed, but you cannot in any case use yarn because yarn cannot rebuild native dependencies.

@ConorIA
Copy link

ConorIA commented Nov 3, 2016

yarn's website provides yarn install --force as equivalent to npm rebuild, but I imagine that implementing this would require a substantial re-write. As mentioned in the dup #870, replacing the rebuild commands with install does help get past the first bug, but then I was hitting the --cache-min issue even in builder 7.18.0.

@develar
Copy link
Member

develar commented Nov 3, 2016

replacing the rebuild commands with install does help get past the first bug

No. install doesn't respect arch. If previously was installed for ia32, new arch via env is ignored and you will get broken build. It is the reason why rebuild is used. I don't know is this bug fixed in the yarn or not.

@ConorIA
Copy link

ConorIA commented Nov 3, 2016

Ok. Thanks @develar. I'll follow the issue on yarn closely.

@develar
Copy link
Member

develar commented Nov 9, 2016

yarn will be supported as soon as yarnpkg/yarn#1749 will be fixed.

@develar develar changed the title yarn install-app-deps fails when it detects npm's --cache-min Yarn Support (rebuild) Nov 9, 2016
@develar
Copy link
Member

develar commented Nov 9, 2016

If you do not use yarn run to run build, but execute it directly, you can set env FORCE_YARN=true

develar added a commit to develar/electron-builder that referenced this issue Nov 9, 2016
@develar
Copy link
Member

develar commented Nov 9, 2016

Result of installDependencies is not yet fully tested and proven (because yarn doesn't support --build-from-source). Use yarn in this case on your own risk.

BTW — electron-builder now uses yarn run test on macOS CI ;)

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

Successfully merging a pull request may close this issue.

3 participants