Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
f5ebcfe
Bump v8 version to 3.27.23
ignisf Jun 10, 2014
b5a4394
Remove unnecessary files from the gem
ignisf Jun 10, 2014
c0c27e2
Bring patchset up to speed with 3.27.23
ignisf Jun 10, 2014
9eee915
Add submodule dependencies and update v8
ignisf Jun 10, 2014
4ec06f8
Link v8 dependency dirs to submodule directories
ignisf Jun 10, 2014
62c010a
Simplify checkout and patch processes
ignisf Jun 10, 2014
1a4c478
GCC 4.9 is a supported compiler
ignisf Jun 10, 2014
f7e706e
Silence warnings
ignisf Jun 10, 2014
3c143f8
Specify the correct directory for the patches
ignisf Jun 10, 2014
7622b9d
Route build warnings to stdout
ignisf Jun 10, 2014
44b4e40
Update Travis configuration
ignisf Jun 10, 2014
3cc2340
Bump v8 to 3.27.24
ignisf Jun 11, 2014
108c3c7
Remove git-svn from Travis configuration
ignisf Jun 11, 2014
68fca9a
Add new submodules to the clean task
ignisf Jun 14, 2014
8170ba3
Bump v8 to 3.27.28
ignisf Jun 14, 2014
6252277
Simplify Rakefile
ignisf Jun 14, 2014
d198236
Attempt to work around 10 minute Travis build limit
ignisf Jun 14, 2014
1ba8077
Remove unused checkout logic
ignisf Jun 14, 2014
0e9aa52
Cosmetic changes to the Rakefile
ignisf Jun 14, 2014
3034f80
Run bundle install concurrently on Travis
ignisf Jun 14, 2014
80a8dc0
Refactor the compiler detection module
ignisf Jun 15, 2014
4a0b861
Add specs for the compiler classes
ignisf Jun 15, 2014
ac4ea12
Extract the CompilerHelpers module to spec/support
ignisf Jun 15, 2014
1a9cbd5
The RSpec spies syntax is now available by default
ignisf Jun 15, 2014
3a842d9
For now we're still using RSpec 2.14
ignisf Jun 15, 2014
a1314e5
Do not use new hash literal syntax
ignisf Jun 15, 2014
c226b41
Escape command before interpolating in Regexp
ignisf Jun 15, 2014
ead7283
Fix a bug in compiler version parsing
ignisf Jun 15, 2014
7b185f4
Add Apple LLVM compiler
ignisf Jun 15, 2014
f142f28
Change spec wording
ignisf Jun 15, 2014
659ccdc
Dry up version and target parsing
ignisf Jun 15, 2014
e50ad5f
Add more version string specific tests
ignisf Jun 15, 2014
82450f9
Check if clang can be used on Travis
ignisf Jun 15, 2014
ed46ceb
Prefer the compiler Ruby was compiled with
ignisf Jun 15, 2014
a7f92a0
Enable clang CI testing
ignisf Jun 15, 2014
1762e38
Use RbConfig to determine default compiler
ignisf Jun 15, 2014
00faaf0
Fix build failure when make is bmake
ignisf Jun 15, 2014
7d4d4a2
Work around build failure on FreeBSD
ignisf Jun 16, 2014
6b09a3f
Bump v8 to version 3.27.29
ignisf Jun 16, 2014
e90425c
Use absolute path to chdir to vendor/v8
ignisf Jun 16, 2014
9b518be
Enumerate files in submodules automatically
ignisf Jun 16, 2014
8bfad68
Remove dependency on the standard library for rbx
ignisf Jun 16, 2014
31ef490
Add ruby 1.8.7 to Travis configuration
ignisf Jun 16, 2014
475af56
Test building gems and installing them
ignisf Jun 16, 2014
bececed
Display output during v8 compilation instead of after
ignisf Jun 16, 2014
8cdb5e8
Do not clean the main tree before building
ignisf Jun 16, 2014
b1cae55
Add travis_wait for the gem install command
ignisf Jun 17, 2014
9cd6947
Ruby 1.8.7's FileUtils.chmod does not like strings
ignisf Jun 17, 2014
d0f1e3f
Tone down the Travis build matrix
ignisf Jun 17, 2014
63dbf4f
Bump v8 version to 3.27.33
ignisf Jun 17, 2014
3cbf1c3
Reimplement architecture detection
ignisf Jun 17, 2014
8e6bd00
Add experimental arm64 support
ignisf Jun 17, 2014
ea9f3b1
Reorder Travis builds
ignisf Jun 17, 2014
0bd9435
Get rid of RUBY_PLATFORM in the Rakefile
ignisf Jun 17, 2014
2107fd7
Rely on v8 to determine which ARM features are present
ignisf Jun 17, 2014
e2fd504
Pass clang=1 option to make when using clang
ignisf Jun 17, 2014
a22a2f8
Disable building i18n (icu)
ignisf Jun 17, 2014
485fb8d
Remove the icu46 submodule
ignisf Jun 17, 2014
8b2de74
Clean even files in .gitignore
ignisf Jun 17, 2014
466b872
Silence warnings
ignisf Jun 17, 2014
3168c51
Styling changes
ignisf Jun 17, 2014
459e5d8
Fix a bug when compiling on an unsupported platform
ignisf Jun 17, 2014
5d10dc6
Gem::Platform.local.cpu is x86 on 32-bit FreeBSD
ignisf Jun 17, 2014
c060997
Include only tested architectures in Arch::libv_arch
ignisf Jun 17, 2014
abc49f0
Merge remote-tracking branch 'origin/master' into 3.27
cowboyd Jul 3, 2015
8d97b7a
Update to the libv8 4.5.* build process
cowboyd Jul 3, 2015
33b71c7
move to full checkout of the v8 source
cowboyd Jul 3, 2015
7aafb0f
don't clean out the bundle when making clean
cowboyd Jul 3, 2015
4df4f19
add check to see which python script is failing
cowboyd Jul 3, 2015
7192977
update binary builders
cowboyd Jul 3, 2015
3fb8bf1
put the depot tools in the path
cowboyd Jul 3, 2015
6786a2c
clang is required to compile 4.5.x
cowboyd Jul 3, 2015
1d85a56
Initialize submodules to the correct versions
ignisf Jul 5, 2015
9fd0db9
Tweak the RSpec output configuration
ignisf Jul 5, 2015
8715eec
Move the patch application message
ignisf Jul 5, 2015
3836e83
Do not add the tests to the produced packages
ignisf Jul 5, 2015
9f287c9
Remove unnecessary checkout logic
ignisf Jul 5, 2015
ff62f6a
Make the Arch class recognise arm64
ignisf Jul 5, 2015
20ba4f6
Remove unnecessary armtest flag from builder.rb
ignisf Jul 5, 2015
d9e4b54
Make the build process print the command it will use
ignisf Jul 5, 2015
1cd7ab0
Use `system` to call `which`
ignisf Jul 5, 2015
967794a
Add additional archives to the paths
ignisf Jul 5, 2015
aba2950
Add the libplatform header to the incflags
ignisf Jul 5, 2015
ebc7c34
Make sure the C locale is set when calling the compiler
ignisf Jul 5, 2015
f7b2181
Migrate to RSpec 3 and add some more specs
ignisf Jul 5, 2015
a26c33c
Reintroduce the removal of vendor/v8 on clean
ignisf Jul 5, 2015
7569d8b
Fix build failures with GCC
ignisf Jul 5, 2015
2a545e9
Turn off strictaliasing warning for GCC < 4.6
ignisf Jul 5, 2015
4192cb6
Raise the minimum supported version of GCC to 4.8
ignisf Jul 5, 2015
18118be
Remove unnecessary make strictaliasing make flag
ignisf Jul 5, 2015
7b7c6b6
Update the supported platforms in README.md
ignisf Jul 5, 2015
792eff7
Disable external startup data
ignisf Jul 5, 2015
76e85e2
Update the incompatible compiler warning
ignisf Jul 5, 2015
60abda5
Fix a typo in well known compiler names list
ignisf Jul 5, 2015
00748ae
Merge pull request #179 from cowboyd/port-changes-from-trunk-branch
cowboyd Jul 6, 2015
531b4ac
build libv8 in vagrant home directory
cowboyd Jul 7, 2015
046bcc9
update location of v8 include path
cowboyd Jul 8, 2015
a41d8bd
fix failing test case
cowboyd Jul 8, 2015
b78abec
Merge pull request #182 from cowboyd/use-4.5-include-paths
cowboyd Jul 10, 2015
bc75ab1
Merge pull request #181 from cowboyd/adapt-vagrant-build-to-4.5-process
cowboyd Jul 10, 2015
ecb5776
Include all header files
Robdel12 Jul 10, 2015
c06e7aa
use container based builds on travis
cowboyd Jul 10, 2015
ddb34ff
Update FreeBSD GCC names
ignisf Jul 10, 2015
0ff84cd
Bump clang++ before g++ as it's preferred by V8 devs
ignisf Jul 10, 2015
599e9a8
Fix indentation of Compiler::type_of
ignisf Jul 10, 2015
26c0160
Merge pull request #183 from Robdel12/include-all-header-files
cowboyd Jul 11, 2015
286345a
v4.5.95.1 - binary release basis
cowboyd Jul 11, 2015
eb06e07
disable appveyor until windows build is fixed
cowboyd Jul 12, 2015
cfba65e
v4.5.95.2
cowboyd Jul 12, 2015
80cc6a1
v4.5.95.3 - binary release basis
cowboyd Jul 12, 2015
9999e40
gyp now provides option to make normal archives
cowboyd Jul 13, 2015
6bd36df
v4.5.95.4
cowboyd Jul 13, 2015
b2ad464
v4.5.95.5 - binary release series
cowboyd Jul 13, 2015
f5dc429
Instruct GYP to create a standalone static library
ignisf Jul 13, 2015
020b648
Merge pull request #185 from cowboyd/build-standalone-static-library
cowboyd Jul 13, 2015
0f96678
enhance the binary builders by
cowboyd Jul 13, 2015
c3ad860
Merge pull request #184 from cowboyd/container-based-travis
cowboyd Jul 13, 2015
054c56d
Merge pull request #186 from cowboyd/update-binary-builds
cowboyd Jul 13, 2015
0fa385d
Add a 64-bit FreeBSD 10.1 build
ignisf Jul 14, 2015
10e62c8
Add amd64 to arch detection
ignisf Jul 14, 2015
9d305e1
Use NFS for Vagrant shared folders for FreeBSD
ignisf Jul 14, 2015
4152edf
Confiure the host-only network adapter for FreeBSD
ignisf Jul 15, 2015
4504cdc
Merge pull request #190 from cowboyd/freebsd-vagrant-box
cowboyd Jul 15, 2015
6b57f9d
Install and use g++ 4.8 in Travis
ignisf Jul 17, 2015
bc7e50c
Add a Requirements section and update the README
ignisf Jul 17, 2015
1f540a2
Remove stale patches for arm and Apple clang 5.1
ignisf Jul 18, 2015
e4a6d63
Merge pull request #191 from cowboyd/use-gcc48-in-travis
cowboyd Jul 19, 2015
92792f2
Merge pull request #192 from cowboyd/readme-update-for-4.5
cowboyd Jul 19, 2015
0b97c04
Merge pull request #193 from cowboyd/remove-unnecessary-patches
cowboyd Jul 19, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ lib/libv8/VERSION
/ext/libv8/.location.yml
/release/**/libv8
/release/**/.vagrant
/vendor/.gclient
/vendor/.gclient_entries
/vendor/v8/
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "vendor/v8"]
path = vendor/v8
url = https://github.com/v8/v8.git
[submodule "vendor/gyp"]
path = vendor/gyp
url = https://chromium.googlesource.com/external/gyp.git
[submodule "vendor/depot_tools"]
path = vendor/depot_tools
url = https://chromium.googlesource.com/chromium/tools/depot_tools.git
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--warnings
41 changes: 35 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
language: ruby
rvm:
- 2.2.2
- 2.1.2
- 2.0.0
- 2.1.5
- 1.9.3
- rbx
bundler_args: --jobs=1 --retry=3
- rbx-2
matrix:
include:
- rvm: ruby-2.2.2-clang
env: CXX=clang++
- rvm: ruby-head
- rvm: ruby-head-clang
env: CXX=clang++
- rvm: ree
- rvm: ruby-1.8.7
allow_failures:
- rvm: ree
- rvm: ruby-1.8.7
- rvm: ruby-head
- rvm: ruby-head-clang
fast_finish: true
bundler_args: -j4 --retry=3
script:
- MAKEFLAGS+=-j8 bundle exec rake spec build binary --trace
- MAKEFLAGS+=-j8 travis_wait gem install pkg/*.gem
notifications:
recipients:
- cowboyd@thefrontside.net
- bordjukov@gmail.com
before_install:
- sudo apt-get update
- sudo apt-get install git-svn
cache: bundler
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
env:
- CXX=g++-4.8
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# libv8
[![Gem Version](https://badge.fury.io/rb/libv8.svg)](http://badge.fury.io/rb/libv8)
[![Build Status](https://travis-ci.org/cowboyd/libv8.svg?branch=master)](https://travis-ci.org/cowboyd/libv8)
[![Build status](https://ci.appveyor.com/api/projects/status/ugeqff972kxlba5j?svg=true)](https://ci.appveyor.com/project/cowboyd/libv8)
<!-- [![Build status](https://ci.appveyor.com/api/projects/status/ugeqff972kxlba5j?svg=true)](https://ci.appveyor.com/project/cowboyd/libv8) -->
[![Join the chat at https://gitter.im/cowboyd/therubyracer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cowboyd/therubyracer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A gem for distributing the v8 runtime libraries and headers in both
Expand All @@ -22,16 +22,11 @@ opens the door for supporting Windows.
That depends on your platform. Right now, we support the following
platforms.

* x86_64-darwin10.7.0
* x86_64-darwin-10
* x86_64-darwin-11
* x86_64-darwin-12
* x86_64-darwin-13
* x86_64-darwin-14
* x86_64-linux
* x86-linux
* x86_64-freebsd-9
* x86_64-freebsd-10
* x86_64-solaris-2.11
* i386-freebsd-10

If you don't see your platform on this list, first, make sure that it
installs from source, and second talk to us about setting up a binary
Expand Down Expand Up @@ -64,6 +59,16 @@ distribution

> This step release system is a workaround to carlhuda/bundler#1537

### Requirements

Building the v8 library from source imposes the following requirements:

* A compiler that supports C++11 (such as GCC 4.8 and above or clang,
preferably 3.5 and above)
* GNU Make
* Python 2
* git-svn

### Using a git version

If you want to use the latest unstable version of the gem you can do
Expand All @@ -79,15 +84,14 @@ You can find more info on using a git repo as a gem source in

### What if I can't install from source?

If you can fix the "Makefile" so that it correctly compiles for your
If you can fix v8's build system so that it correctly compiles for your
platform, we'll pull it right in!

To get the source, these commands will get you started:

git clone git://github.com/cowboyd/libv8.git
git clone --recursive git://github.com/cowboyd/libv8.git
cd libv8
bundle install
bundle exec rake checkout
bundle exec rake compile

### Bring your own V8
Expand All @@ -106,9 +110,15 @@ Using Bundler (in your Gemfile):

bundle config build.libv8 --with-system-v8

#### Gotchas

Please note that if you intend to run your own V8, you must install
both V8 *and its headers* (found in libv8-dev for Debian distros).

Also keep in mind that v8's API does not tend to be stable and you need to make
sure that the version of therubyracer you intend to use is compatible with the
version of v8 present on your system. Otherwise therubyracer's build will fail.

### Bring your own compiler

You can specify a compiler of your choice by either setting the `CXX`
Expand Down
115 changes: 43 additions & 72 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,112 +1,83 @@
require 'bundler/setup'
Bundler::GemHelper.install_tasks
class Bundler::GemHelper
def clean?
sh_with_code('git diff --exit-code --ignore-submodules')[1] == 0
end
end

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

require File.expand_path '../ext/libv8/make.rb', __FILE__
require File.expand_path '../ext/libv8/checkout.rb', __FILE__
include Libv8::Make
include Libv8::Checkout

desc "setup the vendored v8 source to correspond to the libv8 gem version"
task :checkout do
sh "git submodule update --init"
checkout!
end

desc "compile v8 via the ruby extension mechanism"
task :compile => :devkit do
sh "ruby ext/libv8/extconf.rb"
end
Bundler::GemHelper.install_tasks
RSpec::Core::RakeTask.new :spec

desc "manually invoke the GYP compile. Useful for seeing debug output"
task :manual_compile do
require File.expand_path '../ext/libv8/arch.rb', __FILE__
include Libv8::Arch
Dir.chdir(V8_Source) do
sh %Q{#{make} -j2 #{libv8_arch}.release ARFLAGS.target=crs}
module Helpers
module_function
def binary_gemspec(platform = Gem::Platform.local)
gemspec = eval(File.read 'libv8.gemspec')
gemspec.platform = platform
gemspec
end
end

def get_binary_gemspec(platform = RUBY_PLATFORM)
gemspec = eval(File.read('libv8.gemspec'))
gemspec.platform = Gem::Platform.new(platform)
gemspec
def binary_gem_name(platform = Gem::Platform.local)
File.basename binary_gemspec(platform).cache_file
end
end

begin
binary_gem_name = File.basename get_binary_gemspec.cache_file
rescue
binary_gem_name = ''
desc "compile v8 via the ruby extension mechanism"
task :compile do
sh "ruby ext/libv8/extconf.rb"
end

desc "build a binary gem #{binary_gem_name}"
desc "build a binary gem #{Helpers.binary_gem_name}"
task :binary => :compile do
gemspec = get_binary_gemspec
gemspec = Helpers.binary_gemspec
gemspec.extensions.clear

# We don't need most things for the binary
gemspec.files = []
gemspec.files += ['lib/libv8.rb', 'lib/libv8/version.rb']
gemspec.files += ['ext/libv8/arch.rb', 'ext/libv8/location.rb', 'ext/libv8/paths.rb']
gemspec.files += ['ext/libv8/.location.yml']

# V8
gemspec.files += Dir['vendor/v8/include/*']
gemspec.files += Dir['vendor/v8/include/**/*.h']
gemspec.files += Dir['vendor/v8/out/**/*.a']
FileUtils.chmod 'a+r', gemspec.files

FileUtils.chmod 0644, gemspec.files
FileUtils.mkdir_p 'pkg'

package = if Gem::VERSION < '2.0.0'
Gem::Builder.new(gemspec).build
else
require 'rubygems/package'
Gem::Package.build(gemspec)
Gem::Package.build gemspec
end
FileUtils.mv(package, 'pkg')
end

desc "clean up artifacts of the build"
task :clean do
sh "rm -rf pkg"
sh "git clean -df"
sh "cd #{V8_Source} && git checkout -f && git clean -dxf"
if Dir.chdir GYP_Source
sh "git checkout -f"
puts "git clean -dxf"
`git clean -dxf`
end
end

task :devkit do
begin
if RUBY_PLATFORM =~ /mingw/
require "devkit"
end
rescue LoadError => e
abort "Failed to activate RubyInstaller's DevKit required for compilation."
end
FileUtils.mv package, 'pkg'
end

namespace :build do
['x86_64-linux', 'x86-linux'].each do |arch|
['x86_64-linux', 'x86-linux', 'x86_64-freebsd10'].each do |arch|
desc "build binary gem for #{arch}"
task arch do
arch_dir = Pathname(__FILE__).dirname.join("release/#{arch}")
Dir.chdir(arch_dir) do
sh "vagrant up"
sh "vagrant ssh -c 'cd /vagrant && rm -rf libv8 && git clone /libv8/.git libv8'"
sh "vagrant ssh -c 'cd /vagrant/libv8 && bundle install --path vendor/bundle'"
sh "vagrant ssh -c 'cd /vagrant/libv8 && bundle exec rake checkout binary'"
sh "vagrant ssh -c 'cp /vagrant/libv8/pkg/*.gem /vagrant'"
sh "vagrant ssh -c 'rm -rf libv8 && git clone --recursive /libv8/.git libv8'"
sh "vagrant ssh -c 'cd libv8 && bundle install --path vendor/bundle'"
sh "vagrant ssh -c 'cd libv8 && bundle exec rake binary'"
sh "vagrant ssh -c 'cp libv8/pkg/*.gem /vagrant'"
end
end
end
end

task :clean_submodules do
sh "git submodule --quiet foreach git reset --hard"
sh "git submodule --quiet foreach git clean -dxf"
sh "git submodule update --init"
end

desc "clean up artifacts of the build"
task :clean => [:clean_submodules] do
sh "rm -rf pkg"
sh "rm -rf vendor/v8"
sh "git clean -dxf -e .bundle -e vendor/bundle"
end

task :default => [:checkout, :compile, :spec]
task :build => [:clean, :checkout]
task :default => [:compile, :spec]
task :build => [:clean]
File renamed without changes.
42 changes: 9 additions & 33 deletions ext/libv8/arch.rb
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
require 'rbconfig'
require 'rubygems'

module Libv8
module Arch
module_function

def x86_64_from_build_cpu
RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64'
end

def x86_64_from_byte_length
['foo'].pack('p').size == 8
end

def x86_64_from_arch_flag
RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/
end

def rubinius?
Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
end

# TODO fix false positive on 64-bit ARM
def x64?
if rubinius?
x86_64_from_build_cpu || x86_64_from_arch_flag
else
x86_64_from_byte_length
end
end

def arm?
RbConfig::MAKEFILE_CONFIG['build_cpu'] =~ /^arm/
end

def libv8_arch
if arm? then "arm"
elsif x64? then "x64"
else "ia32"
case Gem::Platform.local.cpu
when /^arm$/ then 'arm'
when /^a(rm|arch)64$/ then 'arm64'
when /^x86$/ then 'ia32'
when /^(x86_64|amd64)$/ then 'x64'
else
warn "Unsupported target: #{Gem::Platform.local.cpu}"
Gem::Platform.local.cpu
end
end
end
Expand Down
Loading