forked from wjessop/build_ruby
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from basecamp/yjit
Add support for building 3.2.0 with yjit flags enabled
- Loading branch information
Showing
3 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Can't use {{.Distro}} since it's ubuntu:18.04:yjit | ||
FROM ubuntu:18.04 | ||
RUN apt-get update | ||
RUN apt-get install -y build-essential \ | ||
libc6-dev libffi-dev libgdbm-dev libncurses5-dev \ | ||
libreadline-dev libssl1.0-dev libyaml-dev zlib1g-dev rustc \ | ||
curl ruby ruby-dev | ||
RUN ["/usr/bin/gem", "install", "bundler", "-v", "1.17.3", "--no-rdoc", "--no-ri"] | ||
ADD Gemfile / | ||
ADD Gemfile.lock / | ||
RUN ["bundle", "install"] | ||
|
||
RUN curl {{.DownloadUrl}}|tar oxzC /tmp | ||
{{range .Patches}}ADD {{.}} / | ||
{{end}} | ||
WORKDIR /tmp/ruby-{{.RubyVersion}} | ||
RUN for i in `/bin/ls /*.patch`; do patch -p0 < $i; done | ||
RUN CFLAGS='-march=x86-64 -O3 -fno-fast-math -g3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -std=iso9899:1999 -fPIC' ./configure \ | ||
--prefix=/opt/ruby{{.RubyVersion}} \ | ||
--enable-shared \ | ||
--disable-install-doc \ | ||
--enable-load-relative \ | ||
--enable-yjit | ||
# Seems to only affect some 1.9 series Rubies, but the combined make step: | ||
# | ||
# RUN make -j8 install DESTDIR=/tmp/fpm | ||
# | ||
# that ran the make then make install, was broken. Splitting it up into | ||
# two separate commands works fine: | ||
RUN make -j{{.NumCPU}} | ||
RUN make install DESTDIR=/tmp/fpm | ||
|
||
WORKDIR / | ||
RUN fpm \ | ||
-s dir \ | ||
-t deb \ | ||
-n ruby-{{.RubyVersion}} \ | ||
-a {{.Arch}} \ | ||
-v {{.RubyVersion}} \ | ||
{{.Iteration}} | ||
-d libc6-dev \ | ||
-d libffi-dev \ | ||
-d libgdbm-dev \ | ||
-d libncurses5-dev \ | ||
-d libreadline-dev \ | ||
-d libssl1.0-dev \ | ||
-d libyaml-dev \ | ||
-d zlib1g-dev \ | ||
-C /tmp/fpm \ | ||
-p /{{.FileName}} \ | ||
opt |