Skip to content
This repository

cairo build fails with no output - where to start debugging? #20

Closed
RandomEtc opened this Issue · 7 comments

3 participants

Tom Carden Ilya Grigorik David Dollar
Tom Carden
$ wget http://cairographics.org/releases/cairo-1.10.2.tar.gz
$ tar xzvf cairo-1.10.2.tar.gz
$ cd cairo-1.10.2
$ vulcan build -v -o ../cairo-1.10.2.tgz
>> Packaging local directory
>> Uploading code for build
>> Building with: ./configure --prefix /app/vendor/cairo-1.10.2 && make install
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
      <style type="text/css">
        html, body, iframe { margin: 0; padding: 0; height: 100%; }
        iframe { display: block; width: 100%; border: none; }
      </style>
    <title>Application Error</title></head>
    </head>
    <body>
      <iframe src="https://s3.amazonaws.com/heroku_pages/error.html">
        <p>Application Error</p>
      </iframe>
    </body>
    </html>!! Unknown error, no build output given

I've successfully built pixman (http://www.cairographics.org/releases/pixman-0.20.2.tar.gz) on the same vulcan instance so I'm pretty sure it's working correctly. I suspect Cairo has other dependencies (pixman, freetype?) which I'll need to specify with -d but I'm not sure how to diagnose which ones were missing?

My hope is to get a repeatable toolchain together for deploying https://github.com/LearnBoost/node-canvas to Heroku. There are other efforts to do this (https://github.com/elspoono/node-canvas-heroku) but they are falling out of date ... the tutorial to repeat the fix (https://github.com/elspoono/node-canvas-heroku) starts with compiling Cairo for Ubuntu 64-bit, so here I am :)

Ilya Grigorik

I just ran into the same issue (albeit with different binary), and it appears that there are several things in here:

(1) The output of vulcan is misleading. When it says "Building with", it's only actually starting the upload. The output makes it seem like the upload has completed (which is not the case): https://github.com/heroku/vulcan/blob/master/lib/vulcan/cli.rb#L46 vs line 55.

I think the output should be changed to indicate that the upload is in process. My first problem was that my upload was failing due to a bad connection but I thought it was a failing build. Doh.

(2) Once I got on a decent connection and managed to upload the data, the connection is nonetheless terminated after 30s. The upload succeeded, and the logs show that the build is starting, but for whatever reason the connection is killed:

2012-05-30T23:55:07+00:00 app[web.1]: fff63a6d-ac7a-4960-9691-ecb5331826c4: saving to couchdb
2012-05-30T23:55:09+00:00 app[web.1]: fff63a6d-ac7a-4960-9691-ecb5331826c4: saving attachment - [id:fff63a6d-ac7a-4960-9691-ecb5331826c4, rev:1-c33ad64515e3c80e1dfef0e09c076933]
2012-05-30T23:55:25+00:00 app[web.1]: fff63a6d-ac7a-4960-9691-ecb5331826c4: spawning build
2012-05-30T23:55:25+00:00 app[web.1]: spawning on heroku: bin/make fff63a6d-ac7a-4960-9691-ecb5331826c4
2012-05-30T23:55:25+00:00 heroku[run.1]: State changed from created to starting
2012-05-30T23:55:25+00:00 app[web.1]: valid socket
2012-05-30T23:55:27+00:00 heroku[run.1]: State changed from starting to up
2012-05-30T23:55:27+00:00 app[run.1]: Awaiting client
2012-05-30T23:55:30+00:00 app[run.1]: Starting process with command `bin/make fff63a6d-ac7a-4960-9691-ecb5331826c4`
2012-05-30T23:55:37+00:00 heroku[router]: Error H12 (Request timeout) -> POST vulcan-dart1.herokuapp.com/make dyno=web.1 queue= wait= service=30000ms status=503 bytes=0

The annoying part is that if I continue watching the logs, I do see the build "finish" but that's well after my connection is dead, hence I can't retrieve the output.

David Dollar
ddollar commented

I just pushed up a new version of vulcan that should fix many if not all of the outstanding issues.

Could you try the following:

$ gem update vulcan; vulcan update
Ilya Grigorik

much better! Uploaded successfully and seeing output from the build.. the build fails, but that's my own specific issues (need to figure out some path gymnastics).

Tom Carden

Same here: much better. My cairo build is failing at the configure step - as expected, I know it needs pixman - however it still reports that the build artifacts are available:

$ wget http://cairographics.org/releases/cairo-1.10.2.tar.gz
$ tar xzvf cairo-1.10.2.tar.gz
$ cd cairo-1.10.2
$ vulcan build -v -o ../../vendor/cairo-1.10.2.tgz 
<LOTS_OF_STUFF>
checking for pixman... no
no
checking whether cairo's image surface backend feature could be enabled... no (requires pixman-1 >= 0.18.4 http://cairographics.org/releases/)
configure: error: mandatory image surface backend feature could not be enabled
bin/make:66:in `chdir': No such file or directory - /app/vendor/cairo-1.10.2 (Errno::ENOENT)
    from bin/make:66:in `block (2 levels) in <main>'
    from bin/make:18:in `chdir'
    from bin/make:18:in `block in <main>'
    from /usr/local/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from bin/make:17:in `<main>'
>> Downloading build artifacts to: ../../vendor/cairo-1.10.2.tgz
   (available at <SECRET_URL_THAT_DOESN'T_WORK>)

I'll build pixman first and provide its output with -d (I think that's how it's intended) and report back if I'm still mystified. But so far it seems like the error reporting is much clearer. Thanks!

Tom Carden

Hmm, sadly with --deps and the results of my (successful seeming) pixman build I'm getting unhelpful output again:

$ vulcan build -v -o ../../vendor/cairo-1.10.2.tgz --deps <PIXMAN_BUILD_ARTIFACTS_URL>
Packaging local directory... done
Uploading source package... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
      <style type="text/css">
        html, body, iframe { margin: 0; padding: 0; height: 100%; }
        iframe { display: block; width: 100%; border: none; }
      </style>
    <title>Application Error</title></head>
    </head>
    <body>
      <iframe src="https://s3.amazonaws.com/heroku_pages/error.html">
        <p>Application Error</p>
      </iframe>
    </body>
    </html>!! Unknown error, no build output given

Looking at the logs for my build server I can see that there's a crash somewhere in the form processing after a GET request for the dependency URL I provided:

2012-05-31T23:45:48+00:00 app[web.1]: undefined:1
2012-05-31T23:45:48+00:00 app[web.1]: 
2012-05-31T23:45:48+00:00 app[web.1]: 7-605fc3151ee2
2012-05-31T23:45:48+00:00 app[web.1]: ^
2012-05-31T23:45:48+00:00 app[web.1]: SyntaxError: Unexpected token h
2012-05-31T23:45:48+00:00 app[web.1]:     at Object.parse (native)
2012-05-31T23:45:48+00:00 app[web.1]:     at IncomingForm.<anonymous> (/app/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js:117:9)
2012-05-31T23:45:48+00:00 app[web.1]:     at /app/web.js:58:23
2012-05-31T23:45:48+00:00 app[web.1]:     at IncomingForm.emit (events.js:64:17)
2012-05-31T23:45:48+00:00 app[web.1]:     at /app/node_modules/connect-form/node_modules/formidable/lib/file.js:59:5
2012-05-31T23:45:48+00:00 app[web.1]:     at IncomingForm._maybeEnd (/app/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js:373:8)
2012-05-31T23:45:48+00:00 app[web.1]:     at /app/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js:207:12
2012-05-31T23:45:48+00:00 app[web.1]:     at Object.oncomplete (fs.js:1298:9)
2012-05-31T23:45:49+00:00 heroku[web.1]: Process exited with status 1

If you want more details I can provide them privately (not sure if the specific URLs and build paths are sensitive but I'm omitting them here just in case). I'm reading web.coffee now but I haven't looked at web.js yet to see if it offers more insights.

Tom Carden

Me again, giving this vulcan/Cairo thing another try.

I am now running into a different problem where builds that are otherwise successful are hanging at the end and not downloading the build products. It seems to be the same as this Stackoverflow post but it sounds like that issue has been fixed?

I have run vulcan update and heroku update and also created a new build server for this set of attempts.

I followed some of the advice on @rwdaigle's lovely tutorial - when my builds fail I'm running heroku run bash -a my-build-app and ./bin/make "the-hash" to investigate.

For pixman I saw some instructions about LD_LIBRARY_PATH and LIBDIR. This led me to a mailing list post which explained that I need to set PKG_CONFIG_PATH. If I do this then Cairo builds successfully:

# tell Cairo where to find pixman:
$ export PKG_CONFIG_PATH=/app/vendor/pixman-0.20.2/lib/pkgconfig

# I don't think these ended up being necessary, but I tried them:
# export LD_LIBRARY_PATH=/app/vendor/pixman-0.20.2/lib
# export LIBDIR=/app/vendor/pixman-0.20.2/lib

$ bin/make "1704b021-1b7c-4bbb-b110-4d165c88c254" -c "./configure --disable-dependency-tracking --prefix=/app/vendor/cairo-1.10.2 && make && make install"

Of course I now have the problem of how to get the build products off this dyno... But at least I have build products!

Because of the first issue I haven't been able to make a repeatable process. I would love to add Cairo to the table on Ryan's tutorial - hope you can help :)

Tom Carden

I'm still seeing the issue with hanging builds (I'll open a new issue for that) but I am at least able to get my builds done with heroku run bash and I also figured out how to get them off the dyno and up to S3 using knox which is already available for the Vulcan web-app.

For those following along at home, in heroku run bash after the pixman and cairo builds completed I did:

$ cd vendor/pixman-0.20.2
$ tar -czvf pixman-0.20.2.tgz .
$ cd ../cairo-1.10.2
$ tar -czvf cairo-1.10.2.tgz .
$ cd ../..

(It took a couple of tries to realize that I should tar inside the package itself and not include the package's folder.)

And then in node:

> var client = require('knox').createClient({
    key: "MY_KEY"
  , secret: "MY_SECRET"
  , bucket: 'MY_BUCKET'
});
> client.putFile('./vendor/pixman-0.20.2.tgz', './pixman-0.20.2.tgz', console.log);
> client.putFile('./vendor/cairo-1.10.2.tgz', './cairo-1.10.2.tgz', console.log);

To make these packages available to node-canvas itself I used a custom buildpack. See our fork of heroku-nodejs-buildpack or the adjustments I made in github's compare view.

Phewf!

Tom Carden RandomEtc closed this
Simon Hill metalaureate referenced this issue in virtualstaticvoid/heroku-buildpack-r
Closed

R with png support #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.