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

Trying to build atom-shell on Debian Wheezy #735

Closed
dwilson6 opened this issue Oct 22, 2014 · 9 comments
Closed

Trying to build atom-shell on Debian Wheezy #735

dwilson6 opened this issue Oct 22, 2014 · 9 comments

Comments

@dwilson6
Copy link

I've been trying to build atom-shell 0.15.3 on debian wheezy. I'm building libchromiumcontent from source successfully (though I need to figure out issues with the chrome_sandbox not running). But I can't get atom-shell to build against the libchromiumcontent that I have built.

Here's the build error I am seeing: ../../atom/browser/net/adapter_request_job.cc:42:21: error: 'ReadRawData' is a protected member of 'net::URLRequestJob'

Interestingly if I build atom-shell against the default libchromiumcontent that is downloaded, then copy my manually built libchromiumcontent and then build again, the build succeeds (it just links against the new version since the other build tasks are cached). I have to manually copy the libchromiumcontent.so file into the out/Release directory afterward but then I can run atom-shell (other than the sandbox issues in the renderer).

Here is more details from the build log when building both the debug and release configurations

[929/988] CXX obj/atom/browser/net/atom_lib.adapter_request_job.o
FAILED: /usr/bin/clang++ -MMD -MF obj/atom/browser/net/atom_lib.adapter_request_job.o.d -DNODE_WANT_INTERNALS=1 -DHTTP_PARSER_STRICT=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_C_SOURCE=200112 -DCOMPONENT_BUILD -DGURL_DLL -DSKIA_DLL -DNDEBUG -DUSING_V8_SHARED -DWEBKIT_DLL -DTOOLKIT_VIEWS -DUSE_AURA -DVIEWS_IMPLEMENTATION -DWEBVIEW_IMPLEMENTATION -DUSE_X11 -I../.. -I../../chromium_src -I../../vendor/brightray -I../../vendor/native_mate -I../../vendor/node/src -I../../vendor/node/deps/http_parser -I../../vendor/node/deps/uv/include -I../../vendor/brightray/vendor/download/libchromiumcontent/src/v8/include -I../../vendor/node/deps/cares/include -I../../vendor/breakpad/src -I../../vendor -I../../vendor/brightray/vendor/download/libchromiumcontent/src -I../../vendor/brightray/vendor/download/libchromiumcontent/src/skia/config -I../../vendor/brightray/vendor/download/libchromiumcontent/src/third_party/skia/include/core -I../../vendor/brightray/vendor/download/libchromiumcontent/src/third_party/icu/source/common -I../../vendor/brightray/vendor/download/libchromiumcontent/src/third_party/WebKit -I../../vendor/brightray/vendor/download/libchromiumcontent/Release/gen -I../../vendor/node/deps/uv/src/ares -I../../vendor/node/deps/zlib -g -Wno-empty-body -std=gnu++11 -std=gnu++11 -fno-rtti -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12  -c ../../atom/browser/net/adapter_request_job.cc -o obj/atom/browser/net/atom_lib.adapter_request_job.o
../../atom/browser/net/adapter_request_job.cc:42:21: error: 'ReadRawData' is a protected member of 'net::URLRequestJob'
  return real_job_->ReadRawData(buf, buf_size, bytes_read);
                    ^
../../vendor/brightray/vendor/download/libchromiumcontent/src/net/url_request/url_request_job.h:297:16: note: object type must derive from context type 'atom::AdapterRequestJob'
  virtual bool ReadRawData(IOBuffer* buf, int buf_size, int *bytes_read);
               ^
1 error generated.

And here's the build script I am runinng:

#Prereqs: 
#1. node is installed
#2. export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox is in your .bashrc file

#atom-shell dependencies
sudo apt-get install build-essential clang libgtk2.0-dev libnotify-dev gcc-multilib g++-multilib libgnome-keyring-dev libnss3

#libchromiumcontent dependencies
sudo apt-get install libudev-dev pciutils-dev cups libcups2-dev libpulse-dev libxss-dev libdrm-dev libgconf2-dev libnss3-dev gperf bison libcap-dev libspeechd-dev ibmimelib1-dev libnss3-tools

#chromium dependencies
sudo apt-get install apache2.2-bin bison curl dpkg-dev elfutils devscripts fakeroot flex\
          fonts-thai-tlwg g++ git-core gperf\
          libapache2-mod-php5\
          libasound2-dev libbrlapi-dev libbz2-dev libcairo2-dev libcap-dev\
          libcups2-dev libcurl4-gnutls-dev libdrm-dev libelf-dev libexif-dev\
          libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev\
          libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev\
          libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev\
          libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl\
          libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev openbox\
          patch perl php5-cgi pkg-config python python-cherrypy3 python-dev\
          python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts\
          ttf-kochi-gothic ttf-kochi-mincho wdiff xfonts-mathml zip

#these weren't found on debian
#language-pack-da language-pack-fr language-pack-he language-pack-zh-hant\

git clone https://github.com/atom/atom-shell.git
cd atom-shell
git checkout v0.15.3
./script/bootstrap.py

#build libchromiumcontent
echo '***Building libchromiumcontent'
cd vendor/brightray/vendor/libchromiumcontent
script/bootstrap
vendor/chromium/src/build/update-linux-sandbox.sh
script/build
script/create-dist


#copy libchromiumcontent into the vendor/brightray/vendor/download
echo '***Copying libchromiumcontent into download folder'
cp libchromiumcontent.zip ../download/
cd ../download
unzip -o -q libchromiumcontent.zip -d libchromiumcontent
rm libchromiumcontent.zip

#build atom-shell
echo '***Building atom-shell'
cd ../../../../ #go back to the atom-shell folder
./script/build.py
@zcbenz
Copy link
Contributor

zcbenz commented Oct 23, 2014

You need to build the atom branch of libchromiumcontent, which included some atom-shell specific patches.

@zcbenz zcbenz closed this as completed Oct 23, 2014
@dwilson6
Copy link
Author

When I build the atom branch of libchromiumcontent, I get errors about not finding references to GLIBC_2.14 and GLIBC_2.15 required by clang++ which is the original problem and why I'm trying to build on wheezy. I also tried checking out the last commit in the atom branch of libchromiumcontent before the date atom-shell 0.15.3 was released (8/6/2014). Libchromiumcontent builds successfully but I get the same errors as before when building atom-shell.

The version of clang installed locally is 3.0-6.2

@zcbenz
Copy link
Contributor

zcbenz commented Oct 24, 2014

Building atom-shell requires clang 3.4 (I'll add this to the docs, sorry), and you may need to add clang's apt source to get clang 3.4.

zcbenz added a commit that referenced this issue Oct 24, 2014
@dwilson6
Copy link
Author

It appears that clang 3.4 is not compatible with wheezy because it requires a higher version of libc (2.15) than wheezy is built with (2.13). Does that mean that atom-shell can't be built on wheezy? Was there a point where it didn't require clang 3.4?

@zcbenz
Copy link
Contributor

zcbenz commented Oct 26, 2014

Clang 3.4 is required because libchromiumcontent is configured to be built with prebuilt clang binaries whose version is 3.4. I'll change libchromiumcontent to be built with system clang, which should be able to fix this issue.

@dwilson6
Copy link
Author

dwilson6 commented Nov 8, 2014

Any updates on this?

@frankhale
Copy link
Contributor

You may be able to hack:

https://github.com/brightray/libchromiumcontent/blob/master/chromiumcontent/chromiumcontent.gypi

There are a couple areas of interest (as far as clang goes)

['OS=="linux" and host_arch=="ia32"', {
        # Use system installed clang for building.
        'make_clang_dir': '/usr',
        'clang': 1,
      }],

and

['OS=="linux" and host_arch=="ia32"', {
        'cflags!': [
          # Clang 3.4 doesn't support these flags.
          '-Wno-absolute-value',
          '-Wno-tautological-pointer-compare',
        ],
      }],

Beyond that I suppose we'll have to wait for @zcbenz to comment.

@dwilson6
Copy link
Author

So I was able to build atom-shell 0.15.3 successfully on wheezy with a little hackery (but I'm getting some runtime errors). I checkout libchromiumcontent commit baf43b6 (the last one before atom-shell 0.15.3 was released) and then manually add the UrlRequestJob patch to the patches folder before building libchromiumcontent.

The errors I get when I try to run atom-shell (with the default app or with our own app) are about the chromium sandbox and nss loading certs. Are the sandbox errors important? I saw that there is a patch to downgrade the severity of them.

[7337:1117/161635:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[7370:1117/161635:ERROR:renderer_main.cc(227)] Running without renderer sandbox
[7358:1117/161635:ERROR:sandbox_linux.cc(302)] InitializeSandbox() called with multiple threads in process gpu-process
[7337:1117/161635:ERROR:nss_util.cc(853)] After loading Root Certs, loaded==false: NSS error code: -8018
[7337:1117/161635:ERROR:gpu_process_transport_factory.cc(323)] Failed to establish GPU channel.
[7337:1117/161642:ERROR:raw_channel_posix.cc(139)] recvmsg: Connection reset by peer
[7337:1117/161642:ERROR:channel.cc(297)] RawChannel fatal error (type 1)

@zcbenz
Copy link
Contributor

zcbenz commented Apr 27, 2015

Electron now links with static library version of libchromiumcontent, so three is no need to build libchromiumcontent separately for each distribution now.

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

3 participants