Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Chromium's depot_tools are not able to fetch V8's source on Alpine Linux #259

Closed
niko opened this issue Jun 25, 2018 · 8 comments
Closed

Comments

@niko
Copy link

niko commented Jun 25, 2018

I'm getting an error when trying to install libv8. I'm using Ruby 2.5.0 on Alpine Linux. It seems to be a problem with downloading the sources.

gem install libv8                                                                                                                                                                                              Building native extensions. This could take a while...
ERROR:  Error installing libv8:
	ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/ext/libv8
/usr/bin/ruby -r ./siteconf20180625-7743-1i7w51g.rb extconf.rb
creating Makefile
Running: gclient root
Error: Command 'download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-clang-format -s v8/buildtools/linux64/clang-format.sha1' returned non-zero exit status 1 in /usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/vendor
Running: gclient config --spec 'solutions = [
  {
    "url": "https://chromium.googlesource.com/v8/v8.git",
    "managed": False,
    "name": "v8",
    "deps_file": "DEPS",
    "custom_deps": {},
  },
]
'
Running: gclient sync --with_branch_heads
Traceback (most recent call last):
  File "/usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/vendor/depot_tools/fetch.py", line 301, in <module>
    sys.exit(main())
  File "/usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/vendor/depot_tools/fetch.py", line 296, in main
    return run(options, spec, root)
  File "/usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/vendor/depot_tools/fetch.py", line 290, in run
    return checkout.init()
  File "/usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/vendor/depot_tools/fetch.py", line 133, in init
    self.run_gclient(*sync_cmd)
  File "/usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/vendor/depot_tools/fetch.py", line 78, in run_gclient
    return self.run(cmd_prefix + cmd, **kwargs)
  File "/usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/vendor/depot_tools/fetch.py", line 68, in run
    return subprocess.check_output(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '('gclient', 'sync', '--with_branch_heads')' returned non-zero exit status 2
/usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/ext/libv8/builder.rb:117:in `block in setup_build_deps!': unable to fetch v8 source (RuntimeError)
	from /usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/ext/libv8/builder.rb:115:in `chdir'
	from /usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/ext/libv8/builder.rb:115:in `setup_build_deps!'
	from /usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/ext/libv8/builder.rb:71:in `build_libv8!'
	from /usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1/ext/libv8/location.rb:24:in `install!'
	from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/libv8-6.3.292.48.1 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/libv8-6.3.292.48.1/gem_make.out
@niko
Copy link
Author

niko commented Jun 26, 2018

Strange enough install in the docker ruby:2.5-alpine container just works:

$ docker run -it ruby:2.5-alpine gem install libv8                                                                                                                                                                                                                                                                                                   
Fetching: libv8-6.3.292.48.1-x86_64-linux.gem (100%)
Successfully installed libv8-6.3.292.48.1-x86_64-linux
1 gem installed

Notable similarities: It's the exact same version.
Notable difference: It's not building native extensions. And that's where my local install fails.
gem version is 2.7.7 in docker and 2.7.6 native.

@ignisf ignisf changed the title "unable to fetch v8 source" Ruby 2.5.0 / Alpine Linux depot_tools are not able to fetch V8's source on Alpine Linux Jun 27, 2018
@ignisf
Copy link
Collaborator

ignisf commented Jun 27, 2018

There seems to be lack of upstream support of the SDK with Alpine at this point:

Reference issues:

Star those issues to help get them resolved or even better -- suggest patches.

@ignisf ignisf changed the title depot_tools are not able to fetch V8's source on Alpine Linux Chromium's depot_tools are not able to fetch V8's source on Alpine Linux Jun 27, 2018
@ignisf ignisf removed the type: bug label Jun 27, 2018
@niko
Copy link
Author

niko commented Jun 28, 2018

Any idea why this just works within a docker container?

@ignisf
Copy link
Collaborator

ignisf commented Jun 28, 2018

Hey, it does not.

If you take a closer look, gem downloads the Linux binary version Fetching: libv8-6.3.292.48.1-*x86_64-linux*.gem (100%)

This has been linked against glibc, which makes it unusable on Alpine afaik. :(

@ignisf
Copy link
Collaborator

ignisf commented Jun 28, 2018

Huh... Actually it might work -- the Dockerfile you're using downloads and compiles Ruby from source which I think is linked against glibc... https://github.com/docker-library/ruby/blob/699a04311386ecc98ca242fc9bdee17fb4008863/2.5/alpine3.7/Dockerfile

The Ruby in Alpine's repos is not and in fact is patched to not use binary versions of gems because of the reason I outlined in the comment above.

@niko
Copy link
Author

niko commented Jun 29, 2018

Oh. Right. That makes sense.

@lloeki
Copy link
Contributor

lloeki commented Feb 3, 2020

Made a comment here regarding musl support and a possible partially upstream solution: #270 (comment)

@lloeki
Copy link
Contributor

lloeki commented Dec 4, 2023

Closing as this issue is completely sidestepped in libv8-node, and has musl builds.

@lloeki lloeki closed this as completed Dec 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants