rake-compiler-dock 0.4.2 → 0.4.3.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Gemfile +3 -1
- data/History.md +5 -0
- data/README.md +20 -14
- data/Rakefile +23 -0
- data/lib/rake_compiler_dock.rb +1 -0
- data/lib/rake_compiler_dock/predefined_user_group.rb +5 -0
- data/lib/rake_compiler_dock/starter.rb +12 -2
- data/lib/rake_compiler_dock/version.rb +1 -1
- metadata +82 -73
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
|
4
|
-
|
5
|
-
SHA512:
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb7f02a748652c032e4b7f748da552f874052217
|
4
|
+
data.tar.gz: 29cc1e0fa7f56629c75bc3efc31fdb619bfcbf44
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 536e7f50af8780fa134289dd4a6f43b7b4966bf79de088ebf2e23794a9bdfa9837fdda3df6192dccf3dd5291275174fafb8e142320ae66566027243cdb223cf0
|
7
|
+
data.tar.gz: 3aaf4ef59353c3b346223b8becb1530681141e0d67034093913d89bd03496c1d0ba82aac6bd0814e73e86f7922c2d2c3dc1dced22cc002944f8aac9a5dee36f3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Gemfile
CHANGED
data/History.md
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# rake-compiler-dock
|
2
2
|
|
3
|
-
Easy to use and reliable cross compiler environment for building Windows binary gems
|
3
|
+
**Easy to use and reliable cross compiler environment for building Windows binary gems.**
|
4
4
|
|
5
5
|
It provides cross compilers and Ruby environments for all versions of the [RubyInstaller](http://rubyinstaller.org/) .
|
6
6
|
They are prepared for use with [rake-compiler](https://github.com/rake-compiler/rake-compiler) .
|
7
7
|
|
8
8
|
This is kind of successor of [rake-compiler-dev-box](https://github.com/tjschuck/rake-compiler-dev-box).
|
9
9
|
It is wrapped as a gem for easier setup, usage and integration and is based on lightweight Docker containers.
|
10
|
-
It is also more reliable, since the underlying docker images are
|
10
|
+
It is also more reliable, since the underlying docker images are versioned and kept unchanged while building.
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -35,7 +35,7 @@ Rake-compiler-dock offers the shell command `rake-compiler-dock` and a [ruby API
|
|
35
35
|
This is best suited to try out and debug a build.
|
36
36
|
It mounts the current working directory into the docker environment.
|
37
37
|
All changes below the current working directory are shared with the host.
|
38
|
-
But note, that all other changes to the file system of the container are dropped at the end of the session - the docker image is
|
38
|
+
But note, that all other changes to the file system of the container are dropped at the end of the session - the docker image is static for a given version. `rake-compiler-dock` can also take the build command(s) from STDIN or as command arguments.
|
39
39
|
|
40
40
|
All commands are executed with the same user and group of the host.
|
41
41
|
This is done by copying user account data into the container and sudo to it.
|
@@ -50,21 +50,25 @@ To build x86- and x64 Windows (RubyInstaller) binary gems interactively, it can
|
|
50
50
|
user@host:$ ls pkg/*.gem
|
51
51
|
your-gem-1.0.0.gem your-gem-1.0.0-x64-mingw32.gem your-gem-1.0.0-x86-mingw32.gem
|
52
52
|
|
53
|
-
|
53
|
+
Or non-interactive:
|
54
54
|
|
55
|
-
|
55
|
+
user@host:$ rake-compiler-dock bash -c "bundle && rake cross native gem"
|
56
56
|
|
57
|
-
The environment variable `RUBY_CC_VERSION` is predefined
|
57
|
+
The environment variable `RUBY_CC_VERSION` is predefined as described [below](#environment-variables).
|
58
58
|
|
59
|
-
|
59
|
+
If necessary, additional software from the Ubuntu repositories can be installed, prior to the build command.
|
60
|
+
This is local to the running session, only:
|
60
61
|
|
61
|
-
|
62
|
+
sudo apt-get update && sudo apt-get install your-package
|
63
|
+
|
64
|
+
You can also choose between different executable ruby versions by `rvm use <version>` .
|
65
|
+
Current default is 2.2.
|
62
66
|
|
63
|
-
You can also choose between different executable ruby versions by `rvm use <version>` . Current default is 2.2.
|
64
67
|
|
65
68
|
### Add to your Rakefile
|
66
69
|
|
67
|
-
To make the build process reproduceable for other parties, it is recommended to add rake-compiler-dock to your Rakefile.
|
70
|
+
To make the build process reproduceable for other parties, it is recommended to add rake-compiler-dock to your Rakefile.
|
71
|
+
This can be done like this:
|
68
72
|
|
69
73
|
task 'gem:windows' do
|
70
74
|
require 'rake_compiler_dock'
|
@@ -78,13 +82,14 @@ Rake-compiler-dock uses [semantic versioning](http://semver.org/), so you should
|
|
78
82
|
See [the wiki](https://github.com/larskanis/rake-compiler-dock/wiki/Projects-using-rake-compiler-dock) for projects which make use of rake-compiler-dock.
|
79
83
|
|
80
84
|
|
81
|
-
## Variables
|
85
|
+
## Environment Variables
|
82
86
|
|
83
87
|
Rake-compiler-dock makes use of several environment variables.
|
84
88
|
|
85
89
|
The following variables are recognized by rake-compiler-dock:
|
86
90
|
|
87
|
-
* `RCD_IMAGE` - The docker image that is downloaded and started.
|
91
|
+
* `RCD_IMAGE` - The docker image that is downloaded and started.
|
92
|
+
Defaults to "larskanis/rake-compiler-dock:IMAGE_VERSION" with an image version that is determined by the gem version.
|
88
93
|
|
89
94
|
The following variables are passed through to the docker container without modification:
|
90
95
|
|
@@ -95,7 +100,8 @@ The following variables are provided to the running docker container:
|
|
95
100
|
* `RCD_IMAGE` - The full docker image name the container is running on.
|
96
101
|
* `RCD_HOST_RUBY_PLATFORM` - The `RUBY_PLATFORM` of the host ruby.
|
97
102
|
* `RCD_HOST_RUBY_VERSION` - The `RUBY_VERSION` of the host ruby.
|
98
|
-
* `RUBY_CC_VERSION` - The target ruby versions for rake-compiler.
|
103
|
+
* `RUBY_CC_VERSION` - The target ruby versions for rake-compiler.
|
104
|
+
The default is defined in the [Dockerfile](https://github.com/larskanis/rake-compiler-dock/blob/master/Dockerfile), but can be changed as a parameter to rake.
|
99
105
|
|
100
106
|
Other environment variables can be set or passed through to the container like this:
|
101
107
|
|
@@ -104,7 +110,7 @@ Other environment variables can be set or passed through to the container like t
|
|
104
110
|
|
105
111
|
## More information
|
106
112
|
|
107
|
-
See [Frequently asked questions](https://github.com/larskanis/rake-compiler-dock/wiki/FAQ)
|
113
|
+
See [Frequently asked questions](https://github.com/larskanis/rake-compiler-dock/wiki/FAQ) and [![Join the chat at https://gitter.im/larskanis/rake-compiler-dock](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/larskanis/rake-compiler-dock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
108
114
|
|
109
115
|
|
110
116
|
## Contributing
|
data/Rakefile
CHANGED
@@ -5,6 +5,29 @@ task :build do
|
|
5
5
|
sh "docker build -t larskanis/rake-compiler-dock:#{RakeCompilerDock::IMAGE_VERSION} ."
|
6
6
|
end
|
7
7
|
|
8
|
+
desc "Run tests"
|
8
9
|
task :test do
|
9
10
|
sh "ruby -w -W2 -I. -Ilib -e \"#{Dir["test/test_*.rb"].map{|f| "require '#{f}';"}.join}\" -- -v"
|
10
11
|
end
|
12
|
+
|
13
|
+
desc "Update predefined_user_group.rb"
|
14
|
+
task :update_lists do
|
15
|
+
|
16
|
+
users = `rake-compiler-dock bash -c "getent passwd"`.each_line.map do |line|
|
17
|
+
line.chomp.split(":")[0]
|
18
|
+
end.compact.reject(&:empty?) - [RakeCompilerDock::Starter.make_valid_user_name(`id -nu`.chomp)]
|
19
|
+
|
20
|
+
groups = `rake-compiler-dock bash -c "getent group"`.each_line.map do |line|
|
21
|
+
line.chomp.split(":")[0]
|
22
|
+
end.compact.reject(&:empty?) - [RakeCompilerDock::Starter.make_valid_group_name(`id -ng`.chomp)]
|
23
|
+
|
24
|
+
File.open("lib/rake_compiler_dock/predefined_user_group.rb", "w") do |fd|
|
25
|
+
fd.puts <<-EOT
|
26
|
+
# DO NOT EDIT - This file is generated per 'rake update_lists'
|
27
|
+
module RakeCompilerDock
|
28
|
+
PredefinedUsers = #{users.inspect}
|
29
|
+
PredefinedGroups = #{groups.inspect}
|
30
|
+
end
|
31
|
+
EOT
|
32
|
+
end
|
33
|
+
end
|
data/lib/rake_compiler_dock.rb
CHANGED
@@ -0,0 +1,5 @@
|
|
1
|
+
# DO NOT EDIT - This file is generated per 'rake update_lists'
|
2
|
+
module RakeCompilerDock
|
3
|
+
PredefinedUsers = ["root", "daemon", "bin", "sys", "sync", "games", "man", "lp", "mail", "news", "uucp", "proxy", "www-data", "backup", "list", "irc", "gnats", "nobody", "libuuid", "syslog", "rvm"]
|
4
|
+
PredefinedGroups = ["root", "daemon", "bin", "sys", "adm", "tty", "disk", "lp", "mail", "news", "uucp", "man", "proxy", "kmem", "dialout", "fax", "voice", "cdrom", "floppy", "tape", "sudo", "audio", "dip", "www-data", "backup", "operator", "list", "irc", "src", "gnats", "shadow", "utmp", "video", "sasl", "plugdev", "staff", "games", "users", "nogroup", "libuuid", "netdev", "crontab", "syslog", "ssh", "rvm"]
|
5
|
+
end
|
@@ -49,8 +49,8 @@ module RakeCompilerDock
|
|
49
49
|
uid = Process.uid
|
50
50
|
gid = Process.gid
|
51
51
|
end
|
52
|
-
user =
|
53
|
-
group =
|
52
|
+
user = make_valid_user_name(`id -nu`.chomp)
|
53
|
+
group = make_valid_group_name(`id -ng`.chomp)
|
54
54
|
|
55
55
|
drun_args = docker_opts + [image_name] + runargs
|
56
56
|
|
@@ -97,6 +97,16 @@ module RakeCompilerDock
|
|
97
97
|
name.sub( /^(.{16}).{2,}(.{15})$/ ){ $1+"-"+$2 }
|
98
98
|
end
|
99
99
|
|
100
|
+
def make_valid_user_name(name)
|
101
|
+
name = make_valid_name(name)
|
102
|
+
PredefinedUsers.include?(name) ? make_valid_name("_#{name}") : name
|
103
|
+
end
|
104
|
+
|
105
|
+
def make_valid_group_name(name)
|
106
|
+
name = make_valid_name(name)
|
107
|
+
PredefinedGroups.include?(name) ? make_valid_name("_#{name}") : name
|
108
|
+
end
|
109
|
+
|
100
110
|
def make_valid_path(name)
|
101
111
|
# Convert problematic characters
|
102
112
|
name = name.gsub(/[ ]/i, "_")
|
metadata
CHANGED
@@ -1,80 +1,89 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-compiler-dock
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.3.pre1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Lars Kanis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
10
|
+
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
13
|
+
MIIDLjCCAhagAwIBAgIBAzANBgkqhkiG9w0BAQUFADA9MQ4wDAYDVQQDDAVrYW5p
|
14
|
+
czEXMBUGCgmSJomT8ixkARkWB2NvbWNhcmQxEjAQBgoJkiaJk/IsZAEZFgJkZTAe
|
15
|
+
Fw0xNTAyMjYxNDIyNDRaFw0xNjAyMjYxNDIyNDRaMD0xDjAMBgNVBAMMBWthbmlz
|
16
|
+
MRcwFQYKCZImiZPyLGQBGRYHY29tY2FyZDESMBAGCgmSJomT8ixkARkWAmRlMIIB
|
17
|
+
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApop+rNmg35bzRugZ21VMGqI6
|
18
|
+
HGzPLO4VHYncWn/xmgPU/ZMcZdfj6MzIaZJ/czXyt4eHpBk1r8QOV3gBXnRXEjVW
|
19
|
+
9xi+EdVOkTV2/AVFKThcbTAQGiF/bT1n2M+B1GTybRzMg6hyhOJeGPqIhLfJEpxn
|
20
|
+
lJi4+ENAVT4MpqHEAGB8yFoPC0GqiOHQsdHxQV3P3c2OZqG+yJey74QtwA2tLcLn
|
21
|
+
Q53c63+VLGsOjODl1yPn/2ejyq8qWu6ahfTxiIlSar2UbwtaQGBDFdb2CXgEufXT
|
22
|
+
L7oaPxlmj+Q2oLOfOnInd2Oxop59HoJCQPsg8f921J43NCQGA8VHK6paxIRDLQID
|
23
|
+
AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUvgTdT7fe
|
24
|
+
x17ugO3IOsjEJwW7KP4wDQYJKoZIhvcNAQEFBQADggEBAE4pDPwv7zV/guo2ZETn
|
25
|
+
V+oVXMvEtUv7lPLpUYTM/g1qHP+mue4vZrhHTZbqEgxZEv03noz/4yIHizMQljED
|
26
|
+
6aUw0DSCQiOtK39LeHE2SfVPnpJdl6R9WX6ObdhNvN3Q9bJL2Ng3TTPidj9on2jO
|
27
|
+
6SevWmI9NMDsupzXOjeuNKbUivcCKgIsp3+qjw1gGURF6eITEM+kxV+u4eC5ah/f
|
28
|
+
iV4wuwAX30bHxaaOA2owy1BJBOHwTl5XBJFKWBf+HlTIGL6yrOjTb+rB+/rSTttv
|
29
|
+
1i6jssufMLmyDB9b1ss72d7xQQpCHH7oizgt84wKAcsV8b83kGbAhtoszY3TgGiJ
|
30
|
+
rww=
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
33
|
+
dependencies:
|
34
|
+
- !ruby/object:Gem::Dependency
|
36
35
|
name: bundler
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
version: "1.7"
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
43
41
|
type: :development
|
44
|
-
version_requirements: *id001
|
45
|
-
- !ruby/object:Gem::Dependency
|
46
|
-
name: rake
|
47
42
|
prerelease: false
|
48
|
-
|
49
|
-
requirements:
|
50
|
-
- - ~>
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version:
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
53
55
|
type: :development
|
54
|
-
version_requirements: *id002
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: test-unit
|
57
56
|
prerelease: false
|
58
|
-
|
59
|
-
requirements:
|
60
|
-
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: test-unit
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
63
69
|
type: :development
|
64
|
-
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
65
76
|
description: |-
|
66
77
|
Easy to use and reliable cross compiler environment for building Windows binary gems.
|
67
78
|
Use rake-compiler-dock to enter an interactive shell session or add a task to your Rakefile to automate your cross build.
|
68
|
-
email:
|
79
|
+
email:
|
69
80
|
- lars@greiz-reinsdorf.de
|
70
|
-
executables:
|
81
|
+
executables:
|
71
82
|
- rake-compiler-dock
|
72
83
|
extensions: []
|
73
|
-
|
74
84
|
extra_rdoc_files: []
|
75
|
-
|
76
|
-
|
77
|
-
- .gitignore
|
85
|
+
files:
|
86
|
+
- ".gitignore"
|
78
87
|
- Dockerfile
|
79
88
|
- Gemfile
|
80
89
|
- History.md
|
@@ -85,6 +94,7 @@ files:
|
|
85
94
|
- lib/rake_compiler_dock.rb
|
86
95
|
- lib/rake_compiler_dock/colors.rb
|
87
96
|
- lib/rake_compiler_dock/docker_check.rb
|
97
|
+
- lib/rake_compiler_dock/predefined_user_group.rb
|
88
98
|
- lib/rake_compiler_dock/starter.rb
|
89
99
|
- lib/rake_compiler_dock/version.rb
|
90
100
|
- patches/ruby-1.8.7-p374/nop.patch
|
@@ -99,30 +109,29 @@ files:
|
|
99
109
|
- src/sudoers
|
100
110
|
- test/test_environment_variables.rb
|
101
111
|
homepage: https://github.com/larskanis/rake-compiler-dock
|
102
|
-
licenses:
|
112
|
+
licenses:
|
103
113
|
- MIT
|
104
114
|
metadata: {}
|
105
|
-
|
106
115
|
post_install_message:
|
107
116
|
rdoc_options: []
|
108
|
-
|
109
|
-
require_paths:
|
117
|
+
require_paths:
|
110
118
|
- lib
|
111
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
-
|
114
|
-
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: 1.3.1
|
120
129
|
requirements: []
|
121
|
-
|
122
130
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.4.5
|
124
132
|
signing_key:
|
125
133
|
specification_version: 4
|
126
|
-
summary: Easy to use and reliable cross compiler environment for building Windows
|
127
|
-
|
134
|
+
summary: Easy to use and reliable cross compiler environment for building Windows
|
135
|
+
binary gems.
|
136
|
+
test_files:
|
128
137
|
- test/test_environment_variables.rb
|
metadata.gz.sig
CHANGED
Binary file
|