Граф коммитов

296 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 801e4a4feb
Remove UPDATE_LIBRARIES
It has not been used since e48375c112.
2024-04-19 14:12:42 +09:00
Nobuyoshi Nakada af88ca4c07
Match `--with/--without` options against gem names
The simple names in `default_exclude_exts` do not match extension
paths under gems.

Extract each gem name from the gemspec file at the top level of each
gem directory.  For example, if `ext` is `syslog-0.1.2/ext/syslog/`,
find out `syslog-0.1.2/syslog.gemspec` and take the base name `syslog`
without the suffix `.gemspec`.
2024-03-22 14:09:12 +09:00
Nobuyoshi Nakada 235aa7ad63
Pass blocks to blocks as block parameters 2024-03-22 14:06:55 +09:00
Nobuyoshi Nakada 78725f14b2
RMDIRS includes `-p` option [ci skip] 2024-03-07 17:13:43 +09:00
Nobuyoshi Nakada ae8990aef0
Alias init functions
The extension library has each initialization function named "Init_" +
basename. If multiple extensions have the same base name (such as
cgi/escape and erb/escape), the same function will be registered for
both names.

To fix this conflict, rename the initialization functions under sub
directories using using parent names, when statically linking.
2024-02-04 16:43:09 +09:00
Nobuyoshi Nakada 143a1be128
Allow glob patterns in ext/Setup 2024-02-04 16:40:41 +09:00
Nobuyoshi Nakada c40b0d52be
Glob with base option
When ripping the base directory off the result names.
2024-02-04 16:35:44 +09:00
Nobuyoshi Nakada c8d0470bb0
Use `File::NULL` instead of hard coded null device names 2023-07-10 19:21:47 +09:00
Nobuyoshi Nakada 72811deaa8
MSWin: Use MESSAGE_BEGIN/MESSAGE_END instead of bare `echo`
To strip enclosing double quotes.
2023-03-02 19:18:13 +09:00
Nobuyoshi Nakada 612aa5c24a
Use class methods of `File` over `Kernel.open` and `IO.read` 2022-11-21 22:16:49 +09:00
Nobuyoshi Nakada dc1c4e4675 Clean extension build directories and exts.mk file 2022-11-16 18:42:46 +09:00
Nobuyoshi Nakada be65cf5325 Remove `-j` option from `MFLAGS` for sub-makes 2022-11-16 18:42:46 +09:00
Nobuyoshi Nakada 711b2ed5fe
Make the timestamp path correspond to the bundled target path
So different timestamps for different paths will be used.  Extentions
paths in bundled gems contain `ruby_version`, which includes the ABI
version, and the same timestamp file for different paths resulted in
build failures when it changed.
2022-10-24 17:47:59 +09:00
Nobuyoshi Nakada 9de11fe796
Quiet if the target is already linked the same source 2022-09-20 12:54:08 +09:00
Nobuyoshi Nakada e5e6b87e26
Create temporary file exclusively and clean 2022-08-07 18:25:10 +09:00
Yuta Saito 6d8b9a9d61 Resolve abi symbol references from miniruby to avoid circular deps
Adding `ruby` to `PREP` causes the following circular dependencies
because `PREP` is used as a prerequisite by some targets required to
build `ruby` target itself.
```
make: Circular .rbconfig.time <- ruby dependency dropped.
make: Circular builtin_binary.inc <- ruby dependency dropped.
make: Circular ext/extinit.c <- ruby dependency dropped.
make: Circular ruby <- ruby dependency dropped.
```

Adding a new Make variable like `EXTPREP` only for exts may be also
reasonable, but it would introduce another complexity into our build
system. `-bundle_loader` doesn't care that link-time and run-time
loader executables are different as long as bound symbols are provided,
so it's ok to resolve from miniruby to simplify our build.
2022-08-04 16:29:22 +09:00
Alan Wu e5a3f23256 Use $(bindir) for path to executable in mkmf
For the macOS -bundle_loader linker option, we need a path to the
Ruby exectuable. $(RUBY) is not necessarily a path since it could
be a command line invocation. That happens during build with
runruby.rb and can happen post installation if the user passes
the --ruby option to a extconf.rb. Use $(bindir) to locate
the executable instead.

Before installation, $(bindir) doesn't exist, so we need to be
able to override $(BUILTRUBY) in such situations so test-spec
and bundled extensions could build. Use a new mkmf global,
$builtruby, to do this; set it in fake.rb and in extmk.rb.

Our build system is quite complex...
2022-08-04 16:29:22 +09:00
Yuta Saito 50d81bfbc1 Link ext bundles with bundle loader option for newer ld64
ld64 shipped with Xcode 14 emits a warning when using `-undefined
dynamic_lookup`.

```
ld: warning: -undefined dynamic_lookup may not work with chained fixups
```

Actually, `-undefined dynamic_lookup` doesn't work when:

1. Link a *shared library* with the option
2. Link it with a program that uses the chained-fixup introduced from
   macOS 12 and iOS 15
because `-undefined dynamic_lookup` uses lazy-bindings and they won't be
bound while dyld fixes-up by traversing chained-fixup info.

However, we build exts as *bundles* and they are loaded only through
`dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory.
So the warning produced by ld64 is false-positive, and it results
failure of option checking in configuration. Therefore, it would be an
option to ignore the warning during our configuration.

On the other hand, `-undefined dynamic_lookup` is already deprecated on
all darwin platforms except for macOS, so it's good time to get rid of
the option. ld64 also provides `-bundle_loader <executable>` option,
which allows to resolve symbols defined in the executable symtab while
linking. It behaves almost the same with `-undefined dynamic_lookup`,
but it makes the following changes:

1. Require that unresolved symbols among input objects must be defined
   in the executable.
2. Lazy symbol binding will lookup only the symtab of the bundle loader
   executable. (`-undefined dynamic_lookup` lookups all symtab as flat
   namespace)

This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC
configuration by assuming ruby executable can be linked before building
exts.

See "New Features" subsection under "Linking" section for chained fixup
https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
2022-08-04 16:29:22 +09:00
Nobuyoshi Nakada 6af7212004
Make extensions under `Gem.extension_api_version` directory 2022-07-24 22:32:07 +09:00
Nobuyoshi Nakada c093e7d645
Avoid to symlink under symlink 2022-07-16 16:38:03 +09:00
Nobuyoshi Nakada 78d2be69b5
Move copying/linking extra files to Makefile so removed by `clean` 2022-07-16 10:11:42 +09:00
Yuta Saito ed8c21bbd5 Ensure symlinks to bundled gem with exts have parent dir
When configuring with `--disable-rpath` and `--static-linked-ext` (e.g.
building for WASI), `extmk.rb` doesn't build exts under bundled gems,
and `.bundle/gems/#{gemname}-#{ver}` are not created due to no call of
`extmake`.
b249178398 starts creating symlink at
`.bundle/gems/#{gemname}-#{ver}/lib`, but the parent dir is not created,
so configuration aginst debug and rbs gems were failed.
2022-07-15 13:14:31 +09:00
Nobuyoshi Nakada b249178398 Install gems `lib` directory to build path 2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada a2c66f52f4 Make dependency-free gemspec files
The default gems have not been installed yet in the build directory,
bundled gems depending on them can not work.  As those dependencies
should be usable there even without rubygems, make temporary gemspec
files without the dependencies, and use them in the build directory.
2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada dcbb94d5b9
Move timestamps directory for bundled gems 2022-07-13 00:00:46 +09:00
Nobuyoshi Nakada d7afaf21f2 Move the target directory of bundled gems like as rubygems 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada db3d111c1d Bundled gems are expanded under `.bundle/gems` now 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada d57c5a7b61 transcode-tblgen.rb: make silent a little when just -v 2020-12-29 17:45:19 +09:00
Nobuyoshi Nakada c53aec73dd
Configure static extensions only if in charge
Get rid of races in parallel configuration when using the
ext/Setup file.
2019-11-19 15:11:41 +09:00
Nobuyoshi Nakada b3ddeac33e
Revert "DEBUG: dump mkmf.log"
This reverts commit 69e209a345.

The debug has finishted.
2019-09-19 20:57:57 +09:00
Nobuyoshi Nakada df3fd50717
Removed mkmf.log dump in Makefile 2019-09-19 12:25:48 +09:00
Nobuyoshi Nakada 69e209a345
DEBUG: dump mkmf.log 2019-09-19 12:03:58 +09:00
Koichi Sasada 223854ebe8 catch up e8ddbc0239. 2019-07-15 09:58:26 +09:00
mrkn 5cae104e51 Let sub-directory exts depend on their parent ext
* ext/extmk.rb: Let sub-directory exts depend on their parent ext.

* template/exts.mk.tmpl: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-01 09:29:14 +00:00
nobu 21a63760c9 extmk.rb: get rid of shadowing outer local variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-25 01:52:22 +00:00
nobu 4328d1f50d extmk.rb: exclude recursively
* ext/extmk.rb: exclude extension libraries recursively.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07 02:49:27 +00:00
nobu bdc6d41640 ext/extmk.rb: colorize notes [Feature #13302]
* common.mk (build-ext): pass variables to colorize.

* ext/extmk.rb: colorize notes with tool/colorize.rb.

* tool/colorize.rb: extract from tool/generic_erb.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 03:01:12 +00:00
nobu 3ca61bb04e exts.mk: refine notes [Feature #13302]
* ext/extmk.rb: split notes into header and footer, which are
  common, from bodies which are unique for each extensions.

* template/exts.mk.tmpl: now each notes are not one line, should
  not unique.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 02:43:25 +00:00
nobu b58a30e1c1 extmk.rb: fail for mandatory libraries
* ext/extmk.rb: fail if a mandatory extension library failed to
  configure.  [ruby-core:80759] [Feature #13302]

* template/exts.mk.tmpl: move `exit` at the end.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 08:13:16 +00:00
rhe 826f16d465 extmk.rb: improve message printed when configuring extensions fails
Point to the mkmf.log if configuring an extension fails so that people
can find and fix the culprit easily.  [ruby-core:80131] [Feature #13302]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 14:05:26 +00:00
naruse a298301baa suppress warning: shadowing outer local variable - e
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07 05:19:00 +00:00
nobu a0da6f0dfe clean gems
* Makefile.in (clean-ext): clean gem directories too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-28 08:22:00 +00:00
nobu f9694cdb67 extmk.rb: split notes
* ext/extmk.rb: split notes and echo per lines, for multiple lines
  messages.  [ruby-core:79475] [Bug #13200]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-10 03:58:01 +00:00
nobu b2c9c82cb7 extmk.rb: remove clean and install mode
* ext/extmk.rb (parse_args): remove clean and install mode, now
  configure mode only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 05:31:25 +00:00
nobu c3df88eca6 extmk.rb: remove direct build mode
* ext/extmk.rb (parse_args): --command-output is now mandatory.
  remove direct build mode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 05:23:39 +00:00
nobu 658fc3dd26 exts.mk.tmpl: ruby names
* template/exts.mk.tmpl: extract configured ruby names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 01:43:29 +00:00
nobu 3d5facc48f extmk.rb: fix for static-linked-ext
* ext/extmk.rb (extmake): fix up r57424 for static-linked-ext.
  separate maybestatic argument from basedir which is given always
  now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 08:05:06 +00:00
nobu 72ad0019ba Parallel gem configuration
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 08:19:34 +00:00
nobu 17b748df2b Parallel ext configuration
* ext/configure-ext.mk: configure each directories underneath ext
  in parallel.

* template/exts.mk.tmpl: then collect the results.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23 02:50:23 +00:00
nobu ea87854c52 extinit.c.tmpl: drop after dot
* template/extinit.c.tmpl: drop rest from the first dot in the
  base name of a feature is ignored since r30464.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23 02:19:00 +00:00