ember-cli: ember build fails because broccoli-funnel can’t symlink tmp file

Output from ember version --verbose && npm --version:

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
ember-cli: 2.8.0
http_parser: 2.7.0
node: 4.8.1
v8: 4.5.103.46
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 46
openssl: 1.0.2k
os: linux x64

npm version: 2.15.11

I’m trying to build our ember app in a nix build environment (basically extracts the source, makes it writable, disables network and chroots to /tmp/nix-build-something). broccoli fails to link some files from a tmp dir that doesn’t exist.

What does exist after the failed build is '/tmp/nix-build-nixcloud-ember.drv-0/nixcloud-ember/, but tmp/funnel-input_base_path-Uvk2rb5J.tmp/index.html does not. Maybe part of it is deleted in cleanup.

I’m at my wit’s end here, I went through the call stack, but there’s a lot of file logic there which I haven’t quite deciphered. When building the project in the development folder, it works just fine, creating a ./tmp that is not removed afterwards, but empty. So probably the tmp logic is broken somewhere or depends on something that is not available in the stripped-down build environment?

> nixcloud-editor@0.0.1 build /tmp/nix-build-nixcloud-ember.drv-0/nixcloud-ember
> ember build

{ Error: getaddrinfo ENOTFOUND google-analytics.com google-analytics.com:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
  code: 'ENOTFOUND',
  errno: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'google-analytics.com',
  host: 'google-analytics.com',
  port: 443 }
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Build failed.
The Broccoli Plugin: [Funnel: Funnel: index.html] failed with:
Error: ENOENT: no such file or directory, lstat '/tmp/nix-build-nixcloud-ember.drv-0/nixcloud-ember/tmp/funnel-input_base_path-Uvk2rb5J.tmp/index.html'
    at Error (native)
    at Object.fs.lstatSync (fs.js:982:18)
    at symlink (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/symlink-or-copy/index.js:79:26)
    at Function.symlinkOrCopySync [as sync] (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/symlink-or-copy/index.js:65:5)
    at Funnel._copy (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/broccoli-funnel/index.js:467:19)
    at Funnel.processFile (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/broccoli-funnel/index.js:450:8)
    at Funnel.applyPatch [as _applyPatch] (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/broccoli-funnel/index.js:367:12)
    at Funnel.<anonymous> (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/broccoli-funnel/index.js:321:10)
    at Array.forEach (native)
    at Funnel.processFilters (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/broccoli-funnel/index.js:320:11)

The broccoli plugin was instantiated at: 
    at Funnel.Plugin (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/broccoli-plugin/index.js:7:31)
    at new Funnel (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/broccoli-funnel/index.js:58:10)
    at EmberApp.index (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/ember-cli/lib/broccoli/ember-app.js:641:15)
    at EmberApp.toArray (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/ember-cli/lib/broccoli/ember-app.js:1605:10)
    at EmberApp.toTree (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/ember-cli/lib/broccoli/ember-app.js:1628:30)
    at module.exports (/tmp/nix-build-nixcloud-ember.drv-0/nixcloud-ember/ember-cli-build.js:68:14)
    at CoreObject.setupBroccoliBuilder (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/ember-cli/lib/models/builder.js:74:19)
    at CoreObject.init (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/ember-cli/lib/models/builder.js:54:10)
    at CoreObject.superWrapper [as init] (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/core-object/lib/assign-properties.js:32:18)
    at CoreObject.Class (/nix/store/9x3xir1k5vxz8ysf8bgww9bgf6li10bk-node-nixcloud-editor-0.0.1/lib/node_modules/nixcloud-editor/node_modules/core-object/core-object.js:32:33)



npm ERR! Linux 4.9.24
npm ERR! argv "/nix/store/dq5lg1gsyzlmblvsbcxqjgjllwvxnnsk-nodejs-6.9.5/bin/node" "/nix/store/dq5lg1gsyzlmblvsbcxqjgjllwvxnnsk-nodejs-6.9.5/bin/npm" "run" "build"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! nixcloud-editor@0.0.1 build: `ember build`
npm ERR! Exit status 1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

@Profpatsch thanks, this gives me a good excuse to play with nix (which I like in theory, but haven’t had a good reason to prioritize using). Thanks!

@stefanpenner it is working now. the problem were the missing files as you pointed out! thanks a lot!

The folder ember build is ultimately being run in appears to be missing all but the top level files and directories, after patching release.nix to include the files (such as app/index.html) all appears to work.

Specifically: https://github.com/nixcloud/ember-quickstart/blob/master/release.nix#L29-L30 is only including (but failing to include descendants):

README.md
app <-- empty
config  <-- empty
ember-cli-build.js
package.json
public  <-- empty
testem.js
tests  <-- empty

after patching release.nix to include everything, all appears well:

nix-build -A ember-quickstart release.nix -K
> ...snip...
> ember-quickstart@0.0.0 build /private/var/folders/4r/whc65vwj1xggvvky3yy1cp9m000mw4/T/nix-build-emb
er-quickstart.drv-0/ember-quickstart
> ember build

WARNING: Ember.js is now provided by node_module `ember-source`, please remove it from bower
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
uickstart
cleaning up...
Built project successfully. Stored in "dist/".

I believe the root cause has been discovered and appears unrelated to this project, but if I missed someone please share and we can reopen.