-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfile.mingw_builds.html
211 lines (151 loc) · 12.5 KB
/
file.mingw_builds.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=no'>
<meta name='apple-touch-fullscreen' content='yes'>
<meta name='apple-mobile-web-app-capable' content='yes'>
<meta name='apple-mobile-web-app-status-bar-style' content='rgba(228,228,228,1.0)'>
<title>Ruby MinGW Builds - Info & Usage</title>
<link rel='stylesheet' type='text/css' href='css/y_fonts.css' />
<link rel='stylesheet' type='text/css' href='css/highlight.github.css' />
<link rel='stylesheet' type='text/css' href='css/y_style.css' />
<link rel='stylesheet' type='text/css' href='css/y_list.css' />
<link rel='stylesheet' type='text/css' href='css/y_color.css' />
<link rel='stylesheet' type='text/css' href='css/custom.css' />
<link rel='stylesheet' type='text/css' href='css/common.css' />
<script type='text/javascript'>
var pathId = "mingw_builds",
relpath = '';
var t2Info = {
CSEP: '.',
ISEP: '#',
NSEP: '::'
};
</script>
<script type='text/javascript' charset='utf-8' src='js/highlight.pack.js'></script>
<script type='text/javascript' charset='utf-8' src='js/y_app.js'></script>
</head>
<body>
<svg id='y_wait' class viewBox='0 0 90 90'></svg>
<div id='settings' class='hidden'></div>
<div id='y_list' class='d h'>
<header id='list_header'></header>
<nav id= 'list_nav' class='y_nav l_nav'>
<ul id='list_items'></ul>
</nav>
</div>
<div id='y_toc' class='f h'>
<header id='toc_header'></header>
<nav id= 'toc_nav' class='y_nav t_nav'>
<ol id='toc_items'></ol>
</nav>
</div>
<div id='y_main' tabindex='-1'>
<header id='y_header'>
<div id='y_menu'>
<a href='/'>Home</a> »
<a href='_index.html'>Index</a> »
<span class='title'><a id='t2_doc_top' href='#'>Ruby MinGW & MSWin Builds - Info & Usage ▲</a></span>
</div>
<a id='list_href' href="file_list.html"></a>
<div id='y_measure_em' class='y_measure'></div>
<div id='y_measure_vh' class='y_measure'></div>
<span id='y_measure_50pre' class='y_measure'><code>123456789_123456789_123456789_123456789_123456789_</code></span>
</header>
<div id='content' class='file'>
<h1>Ruby MinGW & MSWin Builds - Info & Usage</h1>
<h3>Overview</h3>
<p>This document describes what builds are available and their use, both locally and on GitHub. At present, all the builds are 64 bit.</p>
<h4>GitHub</h4>
<p>Rolling MinGW & MSWin trunk builds are done at 3:00, 9:00 and 16:00 UTC (Noon, 6:00 P and 1:00 A JST). The most recent builds with passing tests are available in a <a href="https://github.com/MSP-Greg/ruby-loco/releases/tag/ruby-master">GitHub release</a>.
The <a href="https://github.com/MSP-Greg/ruby-loco/actions">Actions page at ruby-loco</a> has logs and artifacts.</p>
<p>These builds correspond to the <code>mingw</code> and <code>mswin</code> builds used on GitHub Actions when using the <a href="https://github.com/ruby/setup-ruby"><code>ruby/setup-ruby</code></a> action.</p>
<h4>Appveyor</h4>
<p>Rolling trunk builds are done at 3:00, 9:00 and 16:00 UTC (Noon, 6:00 P and 1:00 A JST). The most recent build with passing tests is available as an Appveyor artifact at <a href="https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z">https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z</a>. Build and test logs are an artifact in the most recent passing build shown in <a href="https://ci.appveyor.com/project/MSP-Greg/ruby-loco/history">https://ci.appveyor.com/project/MSP-Greg/ruby-loco/history</a>. Log files are named <code>zlogs_trunk_YYYY-MM-DD_SVN.7z</code>.</p>
<h4>BinTray</h4>
<p>A 2.3.5 build is available on <a href="https://dl.bintray.com/msp-greg/ruby_windows/">Bintray</a>:</p>
<ul>
<li><a href="https://dl.bintray.com/msp-greg/ruby_windows/ruby23-ri2.7z"><code>ruby23-ri2.7z</code></a> build file</li>
<li><a href="https://dl.bintray.com/msp-greg/ruby_windows/ruby23-ri2.7z.sig"><code>ruby23-ri2.7z.sig</code></a> sig file</li>
<li><a href="https://dl.bintray.com/msp-greg/ruby_windows/zlogs_v2_3_5_2017-09-14_59905.7z"><code>zlogs_v2_3_5_2017-09-14_59905.7z</code></a> build & test logs</li>
</ul>
<p>Bundler is included, and rubygems and all bundled gems were updated at the time of build. Four extension default gems are upgraded, <code>bigdecimal</code>, <code>json</code>, <code>openssl</code>, and <code>pysch</code>. These have been pushed back into the build, so they are the default. See <a href="https://bintray.com/msp-greg/ruby_windows/null_package/1.0#release">BinTray Release Note</a>.</p>
<h3>General Use</h3>
<p>All builds utilize the runtime files from <a href="https://github.com/oneclick/rubyinstaller2">RubyInstaller2</a>. Thanks to Lars Kanis for all his work on RubyInstaller2.</p>
<h4>Readline</h4>
<p>Both <code>readline</code> extension and <code>rb-readline</code> are installed. The build is tested with the extension, but the 7z file has <code>rb-readline</code> enabled by default. To use the extension, rename <code>lib\ruby\site_ruby\readline.rb</code> to <code>lib\ruby\site_ruby\readline.rb_</code> (my normal convention).</p>
<h4>MinGW Packages</h4>
<p>Ruby trunk is built with two custom MinGW packages, <code>GDBM 1.10</code> and <code>OpenSSL 1.1.0</code>. The trunk build has a script / cmd file named <code>trunk_pkgs.cmd</code>, which shows how to install both packages. Note that it assumes your MSYS2 install is at <code>C:\msys64</code>. Packages are normally stored in <code>var\cache\pacman\pkg</code>.</p>
<h5>GDBM 1.10</h5>
<p>This package doesn't seem to have many <a href="https://rubygems.org/gems/gdbm/reverse_dependencies">reverse dependencies</a>, so you may not need to add it to your packages. The GDBM package used for these builds is available at:</p>
<ul>
<li><a href="https://dl.bintray.com/msp-greg/ruby_windows/mingw-w64-x86_64-gdbm-1.10-2-any.pkg.tar.xz">mingw-w64-x86_64-gdbm-1.10-2-any.pkg.tar.xz</a></li>
<li><a href="https://dl.bintray.com/msp-greg/ruby_windows/mingw-w64-x86_64-gdbm-1.10-2-any.pkg.tar.xz.sig">mingw-w64-x86_64-gdbm-1.10-2-any.pkg.tar.xz.sig</a></li>
</ul>
<h5>OpenSSL 1.1.0f</h5>
<p>If you're updating OpenSSL or Digest, or installing EventMachine, this package should be added. I'm sure there are gems I'm unaware of that also use it. Packages files:</p>
<ul>
<li><a href="https://dl.bintray.com/msp-greg/ruby_windows/mingw-w64-x86_64-openssl-1.1.0.f-1-any.pkg.tar.xz">mingw-w64-x86_64-openssl-1.1.0.f-1-any.pkg.tar.xz</a></li>
<li><a href="https://dl.bintray.com/msp-greg/ruby_windows/mingw-w64-x86_64-openssl-1.1.0.f-1-any.pkg.tar.xz.sig">mingw-w64-x86_64-openssl-1.1.0.f-1-any.pkg.tar.xz.sig</a></li>
</ul>
<h5>lib\ruby\2.5.0\x64-mingw32\rbconfig.rb - reproducible build</h5>
<p>At present (2017-09-27), <code>rbconfig.rb</code> has paths included that refer to the <code>git.exe</code> location. I have not taken time to determine what may use these settings outside of the build process. You may need to edit these settings to point to a correct path on your system.</p>
<h3>Gem installation</h3>
<p>Many gems builders support MinGW builds with binary (fat) gems. The are listed on RubyGems.org with suffixes <code>x64-mingw32</code> (64 bit) and <code>x86-mingw32</code> (32 bit). Since these gems link to ruby dlls, they need version specific files. Hence, almost none support trunk builds, and some don't support ruby 2.4.</p>
<p>Because of this, you will need to force your system to compile all extension gems that you install. I would suggest making sure that your MSYS2/MinGW files and packages are up to date.</p>
<p>To force compiling, I recommend adding the following to your <code>.gemrc</code> file, normally located in your root user folder:</p>
<pre class="code yaml"><code class="yaml">---
:verbose: true
install: --no-document --env-shebang --platform ruby -- --use-system-libraries
update: --no-document --env-shebang --platform ruby -- --use-system-libraries
</code></pre>
<p>I believe there should be a blank line at the end. This will force all extension gems to install using the MSYS2/MinGW system. If you want documentation, please remove the <code>--no-document</code> option. Some gems may require additional build options. See the <a href="https://github.com/oneclick/rubyinstaller2/wiki/FAQ">RubyInstaller2 FAQ</a> for more info. There may also be issues that discuss your 'problem gem'.</p>
<h3>bundler install</h3>
<p>As to a <a href="http://bundler.io/">bundler</a> install, per the <a href="https://github.com/oneclick/rubyinstaller2/wiki/FAQ">RI2 FAQ</a> (more info there), use the following command lines before install:</p>
<pre class="code shell"><code class="shell">bundle config force_ruby_platform true
bundle config build.<name of gem> --use-system-libraries
--- Examples of some Rails extension gems (not inclusive) ---
bundle config build.eventmachine --use-system-libraries
bundle config build.nio4r --use-system-libraries
bundle config build.nokogiri --use-system-libraries
</code></pre>
<p>If you have several extension gems, the <code>bundle config build.<gem name></code> command should be entered for each. As noted in the FAQ, some extension gems may require additional options, typically related to a specific MSYS2/MinGW package they require for building/compiling. Obviously, you need to install the package first, and possibly specify an option.</p>
<p><strong>Important Bundler Note</strong> the .gemrc file is read by bundler, but I haven't spent a great deal of time seeing if all options are applied. If so, the bundler config commands shouldn't be needed, as the <code>--platform ruby</code> and <code>-- --use-system-libraries</code> options should be read from the <code>.gemrc</code> file.</p>
<h3>Using on Appveyor</h3>
<p>Note - if you are testing a repo that compiles using MSYS2/MinGW, information about installed packages (and several ruby versions) is shown at <a href="https://ci.appveyor.com/project/MSP-Greg/appveyor-ruby">MSP-Greg/appveyor-ruby</a>.</p>
<p>To allow a simply install when used in Appveyor, all build archieves are named <code>r_trunk.7z</code>. There are a few scripts included that updated packages and MSYS2/MinGW also.</p>
<p>The following is an example of a script that installs and updates MSYS2/MinGW:</p>
<pre class="code yaml"><code class="yaml">init:
# To avoid duplicated executables in PATH, see https://github.com/ruby/spec/pull/468
- set PATH=C:\ruby%RUBY_VERSION%\bin;C:\Program Files\7-Zip;C:\Program Files\AppVeyor\BuildAgent;C:\Program Files\Git\cmd;C:\Windows\system32;C:\Program Files;C:\Windows
# Loads trunk build and updates MSYS2 / MinGW to most recent gcc compiler
- if %ruby_version%==_trunk (
appveyor DownloadFile https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z -FileName C:\ruby_trunk.7z &
7z x C:\ruby_trunk.7z -oC:\ruby_trunk & C:\ruby_trunk\trunk_msys2.cmd)
environment:
matrix:
- RUBY_VERSION: 23-x64
- RUBY_VERSION: 24-x64
- RUBY_VERSION: _trunk
</code></pre>
<h4>init: section</h4>
<p>A URI like <code>https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/<file name></code> will download the most recent artifact with the given name from all build jobs.</p>
<p>Note the <code>& C:\ruby_trunk\trunk_msys2.cmd</code>. This runs <code>the trunk_msys2.cmd</code> script after trunk has been installed.</p>
<h4>included scripts</h4>
<ul>
<li><p><code>trunk_msys2.cmd</code> - installs gdbm & opensssl packages, updates gcc to current version. As of 2017-09-28, this was 7.2.0. A single test showed the download and script took about 1:15.</p></li>
<li><p><code>trunk_pkgs.cmd</code> - installs gdbm & opensssl packages.</p></li>
<li><p><code>trunk_install.cmd</code> - included for back-compatibility with BinTray builds. Same as <code>trunk_pkgs.cmd</code>, but assumes <code>.sig</code> file is downloaded and checks signature. Note that BinTray files were built locally, signed and uploaded, Appveyor artifacts are generated & save on Appveyor and not signed.</p></li>
</ul>
<h4>Compiling on Appveyor</h4>
<p>All ruby builds used on Appveyor will set the corrects paths for compiling when <code>-rdevkit</code> is added to most ruby based shell commands.</p>
<div id='footer'>
Generated by
<a href='http://yardoc.org' title='Yay! A Ruby Documentation Tool' target="_parent">yard</a>
0.9.36 with <a href='https://msp-greg.github.io/yard-t2/' title='yard-t2' target="_parent">yard-t2</a> 0.9.0 (ruby 3.4.0dev 2024-11-22)
</div>
</div> <!-- content -->
</div> <!-- y_main -->
</body>
</html>