rake-compiler-dock 0.7.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.gitignore +4 -0
  5. data/Dockerfile.jruby +12 -8
  6. data/Dockerfile.mri.erb +231 -0
  7. data/History.md +56 -0
  8. data/README.md +86 -15
  9. data/Rakefile +44 -4
  10. data/{lib/rake_compiler_dock → build}/gem_helper.rb +0 -15
  11. data/build/parallel_docker_build.rb +102 -0
  12. data/build/patches/{ruby-2.5.3 → ruby-2.5.8}/no_sendfile.patch +1 -1
  13. data/build/patches/ruby-3.0.0/no_sendfile.patch +24 -0
  14. data/build/patches2/hoe-3.20.0/0001-Load-encrypted-private-key-using-ENV-GEM_PRIVATE_KEY.patch +32 -0
  15. data/build/patches2/rake-compiler-1.1.1/0001-Fix-determining-of-ruby-versions-in-rake-native-gem.patch +44 -0
  16. data/build/patches2/rake-compiler-1.1.1/0003-Allow-building-of-cross-rubies-in-parallel.patch +214 -0
  17. data/build/patches2/rake-compiler-1.1.1/0004-Enable-build-of-static-libruby.patch +29 -0
  18. data/build/patches2/rake-compiler-1.1.1/0005-Don-t-mask-out-build-env-vars-for-cross-ruby.patch +30 -0
  19. data/build/patches2/rake-compiler-1.1.1/0006-Use-RAKE_EXTENSION_TASK_NO_NATIVE-env-var-as-the-def.patch +26 -0
  20. data/build/patches2/ruby-2.7.0/ruby2_keywords.patch +15 -0
  21. data/build/patches2/ruby-3.0.0/ruby2_keywords.patch +15 -0
  22. data/build/runas +4 -1
  23. data/build/sudoers +1 -1
  24. data/lib/rake_compiler_dock.rb +10 -0
  25. data/lib/rake_compiler_dock/docker_check.rb +12 -6
  26. data/lib/rake_compiler_dock/starter.rb +68 -53
  27. data/lib/rake_compiler_dock/version.rb +2 -2
  28. data/test/test_environment_variables.rb +2 -2
  29. data/test/test_parallel_docker_build.rb +57 -0
  30. metadata +35 -25
  31. metadata.gz.sig +0 -0
  32. data/Dockerfile.mri +0 -122
  33. data/build/patches/rake-compiler-1.0.6/enable-static.diff +0 -13
metadata.gz.sig CHANGED
Binary file
@@ -1,122 +0,0 @@
1
- FROM ubuntu:18.04
2
-
3
- RUN apt-get -y update && \
4
- apt-get install -y curl git-core xz-utils build-essential wget unzip sudo gpg dirmngr
5
-
6
- # Add "rvm" as system group, to avoid conflicts with host GIDs typically starting with 1000
7
- RUN groupadd -r rvm && useradd -r -g rvm -G sudo -p "" --create-home rvm && \
8
- echo "source /etc/profile.d/rvm.sh" >> /etc/rubybashrc
9
- USER rvm
10
-
11
- # install rvm, RVM 1.26.0+ has signed releases, source rvm for usage outside of package scripts
12
- RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
13
- (curl -L http://get.rvm.io | sudo bash -s stable) && \
14
- bash -c " \
15
- source /etc/rubybashrc && \
16
- rvmsudo rvm cleanup all "
17
-
18
- # Import patch files for ruby and gems
19
- COPY build/patches /home/rvm/patches/
20
- ENV BASH_ENV /etc/rubybashrc
21
-
22
- # install rubies and fix permissions on
23
- RUN bash -c " \
24
- export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
25
- for v in 2.5.3 ; do \
26
- rvm install \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
27
- done && \
28
- rvm cleanup all && \
29
- find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
30
-
31
- # Install rake-compiler and typical gems in all Rubies
32
- # do not generate documentation for gems
33
- RUN echo "gem: --no-ri --no-rdoc" >> ~/.gemrc && \
34
- bash -c " \
35
- rvm all do gem install --no-document bundler rake-compiler hoe mini_portile rubygems-tasks mini_portile2 && \
36
- find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
37
-
38
- # Install rake-compiler's cross rubies in global dir instead of /root
39
- RUN sudo mkdir -p /usr/local/rake-compiler && \
40
- sudo chown rvm.rvm /usr/local/rake-compiler && \
41
- ln -s /usr/local/rake-compiler ~/.rake-compiler
42
-
43
- # Add cross compilers for Windows and Linux
44
- USER root
45
- RUN apt-get -y update && \
46
- apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 g++-mingw-w64-x86-64 g++-mingw-w64-i686 \
47
- gcc-multilib moreutils
48
-
49
- # Create dev tools i686-linux-gnu-*
50
- COPY build/mk_i686.rb /root/
51
- RUN bash -c " \
52
- rvm alias create default 2.5.3 && \
53
- rvm use default && \
54
- ruby /root/mk_i686.rb "
55
-
56
- USER rvm
57
-
58
- # Patch rake-compiler to build and install static libraries for Linux rubies
59
- RUN cd /usr/local/rvm/gems/ruby-2.5.3/gems/rake-compiler-1.0.6 && git apply /home/rvm/patches/rake-compiler-1.0.6/*.diff ;\
60
- true
61
-
62
- ENV XRUBIES 2.6.0 2.5.0 2.4.0 2.3.0 2.2.2
63
-
64
- # First do downloads sequentially since they can not run in parallel
65
- # Then build all xruby versions in parallel
66
- # Then cleanup all build artifacts
67
- RUN for rv in $XRUBIES; do \
68
- bash -c "rake-compiler /home/rvm/.rake-compiler/sources/ruby-$rv/Makefile.in VERSION=$rv HOST=x86_64-linux-gnu"; \
69
- done; \
70
- for rv in $XRUBIES; do \
71
- for host in i686-linux-gnu x86_64-linux-gnu i686-w64-mingw32 x86_64-w64-mingw32; do \
72
- echo -n "'rake-compiler cross-ruby VERSION=$rv HOST=$host' " >> ~/xbuild_rubies; \
73
- done; \
74
- done && \
75
- cat ~/xbuild_rubies; \
76
- bash -c " \
77
- export CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
78
- parallel -- $( cat ~/xbuild_rubies ) && \
79
- rm -rf ~/.rake-compiler/builds ~/.rake-compiler/sources && \
80
- find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
81
-
82
- # Avoid linking against libruby shared object.
83
- # See also https://github.com/rake-compiler/rake-compiler-dock/issues/13
84
- RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.so | xargs rm
85
- RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby-static.a | while read f ; do cp $f `echo $f | sed s/-static//` ; done
86
- RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.a | while read f ; do ar t $f | xargs ar d $f ; done
87
- RUN find /usr/local/rake-compiler/ruby/*linux*/ -name mkmf.rb | while read f ; do sed -i ':a;N;$!ba;s/TRY_LINK = [^\n]*\n[^\n]*\n[^\n]*LOCAL_LIBS)/& -lruby-static/' $f ; done
88
-
89
- # RubyInstaller doesn't install libgcc -> link it static.
90
- RUN find /usr/local/rake-compiler/ruby/*mingw*/ -name rbconfig.rb | while read f ; do sed -i 's/."LDFLAGS". = "/&-static-libgcc /' $f ; done
91
-
92
- USER root
93
-
94
- # Add more libraries and tools to support cross build
95
- RUN dpkg --add-architecture i386 && \
96
- apt-get -y update && \
97
- apt-get install -y libc6-dev:i386 libudev-dev libudev-dev:i386 cmake
98
-
99
- # Fix paths in rake-compiler/config.yml and add rvm and mingw-tools to the global bashrc
100
- RUN sed -i -- "s:/root/.rake-compiler:/usr/local/rake-compiler:g" /usr/local/rake-compiler/config.yml && \
101
- echo "source /etc/profile.d/rvm.sh" >> /etc/bash.bashrc
102
-
103
- # # Install wrappers for strip commands as a workaround for "Protocol error" in boot2docker.
104
- COPY build/strip_wrapper /root/
105
- RUN mv /usr/bin/i686-w64-mingw32-strip /usr/bin/i686-w64-mingw32-strip.bin && \
106
- mv /usr/bin/x86_64-w64-mingw32-strip /usr/bin/x86_64-w64-mingw32-strip.bin && \
107
- ln /root/strip_wrapper /usr/bin/i686-w64-mingw32-strip && \
108
- ln /root/strip_wrapper /usr/bin/x86_64-w64-mingw32-strip
109
-
110
- # Install SIGINT forwarder
111
- COPY build/sigfw.c /root/
112
- RUN gcc $HOME/sigfw.c -o /usr/local/bin/sigfw
113
-
114
- # Install user mapper
115
- COPY build/runas /usr/local/bin/
116
-
117
- # Install sudoers configuration
118
- COPY build/sudoers /etc/sudoers.d/rake-compiler-dock
119
-
120
- ENV RUBY_CC_VERSION 2.6.0:2.5.0:2.4.0:2.3.0:2.2.2
121
-
122
- CMD bash
@@ -1,13 +0,0 @@
1
- diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
2
- index 6230799..3a69f13 100644
3
- --- a/tasks/bin/cross-ruby.rake
4
- +++ b/tasks/bin/cross-ruby.rake
5
- @@ -134,6 +134,8 @@ file "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/Makefile" => ["#{USER
6
- "--target=#{MINGW_TARGET}",
7
- "--build=#{RUBY_BUILD}",
8
- '--enable-shared',
9
- + '--enable-static',
10
- + '--enable-install-static-library',
11
- '--disable-install-doc',
12
- '--with-ext='
13
- ]