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

84 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Hiroshi SHIBATA db0a4c8923 Prefer to use File.foreach instead of IO.foreach 2023-02-27 18:49:18 +09:00
Nobuyoshi Nakada 3a7367ccc3 mkconfig: Map `includedir` only for system ruby
Only when installing to the system path on macOS, prepend '$(SDKROOT)'
and remap `includedir`.
Fix https://github.com/rbenv/ruby-build/discussions/2123
2023-01-31 06:33:16 +09:00
Nobuyoshi Nakada 6422fef90c Fix `target_cpu` at runtime 2023-01-26 16:31:08 +09:00
Nobuyoshi Nakada ed9d761217
mkconfig.rb: take CPU name from arch flag 2022-11-04 18:19:30 +09:00
Alan Wu b989c7c6ac
[DOC] Move :nodoc: so rdoc finds `RbConfig.ruby`
Rdoc [build] of `master` did not have this method but the reference manual [did].

[build]: https://docs.ruby-lang.org/en/master/RbConfig.html
[did]: https://docs.ruby-lang.org/ja/master/class/RbConfig.html#S_RUBY
2022-04-25 14:28:39 -04:00
Peter Zhu 9bd4b2ab14 Add ABI version to RUBY_LIB_VERSION
This commit adds the ABI version as build metadata to
RUBY_LIB_VERSION. This will ensure that gems are installed in a path
with the ABI version.
2022-02-24 09:18:01 -05:00
Peter Zhu 3df16924b4 [Feature #18249] Implement ABI checking
Header file include/ruby/internal/abi.h contains RUBY_ABI_VERSION which
is the ABI version. This value should be bumped whenever an ABI
incompatible change is introduced.

When loading dynamic libraries, Ruby will compare its own
`ruby_abi_version` and the `ruby_abi_version` of the loaded library. If
these two values don't match it will raise a `LoadError`. This feature
can also be turned off by setting the environment variable
`RUBY_RUBY_ABI_CHECK=0`.

This feature will prevent cases where previously installed native gems
fail in unexpected ways due to incompatibility of changes in header
files. This will force the developer to recompile their gems to use the
same header files as the built Ruby.

In Ruby, the ABI version is exposed through
`RbConfig::CONFIG["ruby_abi_version"]`.
2022-02-22 09:55:21 -05:00
Nobuyoshi Nakada 99c60d4b25 Get rid of exponential backtracks found by CodeQL
Since these regexps are used at build/installation, they are not
vulnerabilities.
2021-10-30 02:22:42 +09:00
Nobuyoshi Nakada fd978621cc
mkconfig.rb: Update around SDKROOT
c.f. https://opensource.apple.com/source/ruby/ruby-145.40.1/patches/tool_mkconfig.rb.diff

* moved to "includedir" from "oldincludedir".
* honor "$(prefix)/include" if exists, otherwise fallback to `xcrun`.
2021-04-15 14:55:22 +09:00
Nobuyoshi Nakada 5e2e8ad9a9
Add `RbConfig::CONFIG["platform"]`
Means the platform with the actual CPU info on universal binary.
The CPU in "arch" is fixed as "universal" to refer the header and
library paths.
2021-03-22 00:20:27 +09:00
Nobuyoshi Nakada 96ce1d9a0f
rbconfig.rb: extract cpu from RUBY_PLATFORM when universal 2021-01-07 14:55:33 +09:00
Nobuyoshi Nakada 9552fa9c0d
[DOC] Updated module name [ci skip] 2020-03-30 15:53:55 +09:00
Nobuyoshi Nakada 4adb2d655d
Make RbConfig::CONFIG values mutable [Bug #16738]
As `RbConfig.expand` modifies the argument and involved `CONFIG`
values, its values should be mutable.
2020-03-25 22:09:28 +09:00
taki b2041c8b70 [ci skip]Fix return type on RbConfig.fire_update! 2020-03-21 16:38:04 +09:00
Nobuyoshi Nakada db16629008
Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
Takashi Kokubun 72cff5f3af
MJIT_CC and MJIT_SUPPORT are not a prefix
0b19e15a12 was also for "MJIT_SUPPORT"
too.
2019-12-04 22:18:43 -08:00
Takashi Kokubun 5fbb4555b4
Prefer using MJIT_CC for JIT support check
because Solaris might have CC=cc and we'd like to check full path
MJIT_CC=/opt/developerstudio12.5/bin/cc instead.
2019-12-04 22:16:08 -08:00
Nobuyoshi Nakada 4562dad94c
Removed unused variable 2019-06-28 12:39:14 +09:00
kazu e4f46eabab Fix make-snapshot for trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-11 04:58:33 +00:00
ko1 da8830e3de fix r66599 to sucess install. please refix this patch @nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 03:09:29 +00:00
nobu 8422725408 Moved version numbers
* Define major and minor version numbers only in the public
  include/ruby/version.h header, as the API version numbers.

* Define only teeny version number in the private version.h
  header.

* RUBY_VERSION moved to version.c.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 02:12:34 +00:00
nobu ce8a8c101a Remove unnecessary require of fileutils
Today I updated my ruby core clone, and I run the usual steps to compile
ruby. When running "make", I run into the following error:

```
(... stuff ...)
encdb.h unchanged
Traceback (most recent call last):
	5: from ./tool/mkconfig.rb:19:in `<main>'
	4: from ./tool/mkconfig.rb:19:in `require'
	3: from /home/deivid/Code/ruby/lib/fileutils.rb:4:in `<top (required)>'
	2: from /home/deivid/Code/ruby/lib/fileutils.rb:4:in `require'
	1: from /home/deivid/Code/ruby/rbconfig.rb:11:in `<top (required)>'
/home/deivid/Code/ruby/rbconfig.rb:13:in `<module:RbConfig>': ruby lib version (2.5.0) doesn't match executable version (2.6.0) (RuntimeError)
uncommon.mk:780: recipe for target '.rbconfig.time' failed
make: *** [.rbconfig.time] Error 1
```

Apparently, the script that generates the root `rbconfig.rb` file requires
`fileutils`, which in turn requires 'rbconfig' (for mjit-headers it says in a
comment), which uses the `rbconfig.rb` config file in the root folder if it
exists. In my case, this file existed but had been generated on 2.5.0, thus
causing the error.

I think we can avoid this sort of circular dependency by not requiring
`fileutils`, since it does not seem to be used anywhere in the
`tool/mkconfig.rb` script since r55338.

[Fix GH-2045]

From: David Rodríguez <deivid.rodriguez@riseup.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10 00:05:43 +00:00
nobu a830793914 Add UNICODE_EMOJI_VERSION to RbConfig [Feature #15341]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-07 08:51:26 +00:00
nobu f34e8ff672 Add RbConfig.fire_update!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-14 04:42:14 +00:00
ko1 0b19e15a12 rename configure option `--disable-mjit` to `--disable-mjit-support`
* configure.ac: rename configure option `--disable-mjit` to
  `--disable-mjit-support` because `--disable-mjit` is ambiguous that
  runtime MJIT default enable option or supporting MJIT features.
  `ENABLE_MJIT` is also renamed to `MJIT_SUPPORT`

* Makefile.in: catch up this fix.

* common.mk: ditto.

* test/ruby/test_jit.rb: ditto.

* win32/Makefile.sub: catch up this fix on mswin.

* tool/mkconfig.rb: fix to pass `MJIT_SUPPORT` key.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 08:00:42 +00:00
nobu 64a189d207 remove DISABLE_RUBYGEMS from config files
* configure.ac: removed DISABLE_RUBYGEMS macro from config.h, not
  to rebuild everything when the flag changed.

* configure.ac, win32/configure.bat: make USE_RUBYGEMS lowercase.

* tool/mkconfig.rb: remove RUBYGEMS stuff from rbconfig.rb, not to
  reconfigure and rebuild all extension libraries.

* Makefile.in (CPPFLAGS): enable/disable Rubygems by USE_RUBYGEMS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 04:13:02 +00:00
nobu 251f8be76b mkconfig.rb: hide MJIT configurations
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-08 15:19:01 +00:00
nobu d5c776ad58 mkconfig.rb: remove cross_compiling
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-02 12:45:07 +00:00
shugo 56a3c92303 mkconfig.rb: add a magic comment to rbconfig.rb
* tool/mkconfig.rb: add a magic comment to rbconfig.rb in case the command
  line option -K is specified.  [ruby-core:78181] [Bug #12949]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-17 07:19:49 +00:00
nobu c40e5bac03 mkconfig.rb: trailing space
* tool/mkconfig.rb: [DOC] remove trailing space from a generated
  line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05 07:14:19 +00:00
sho-h 639ccc40ec * tool/mkconfig.rb: [DOC] add rbconfig documentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05 06:59:31 +00:00
nobu 1a03f9c582 Use keyword
* tool/mkconfig.rb: use keyword true, instead of the toplevel
  constant.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-09 02:44:39 +00:00
nobu a7ce662a85 Unicode Version in RbConfig
* tool/mkconfig.rb: provide Unicode Version information as
  RbConfig::CONFIG['UNICODE_VERSION'].
  [ruby-core:75845] [Feature #12460]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-14 16:44:45 +00:00
nobu 2bd061f25e common.mk: ifchange for mkconfig.rb
* common.mk (RBCONFIG): use ifchange tool to see if the content is
  changed and update the timestamp file.
* tool/mkconfig.rb: remove ifchange features.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-09 06:32:18 +00:00
nobu 199e910602 mkconfig.rb: cross_compiling option
* common.mk, tool/mkconfig.rb: set cross_compiling option from
  Makefile, but not from rbconfig.rb, which is just going to be
  created by this command.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-29 07:31:56 +00:00
nobu d58e799d41 extract version from version.h
* tool/mkconfig.rb: extract version numbers from version.h but not
  from API version in include/ruby/version.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-09 01:02:17 +00:00
nobu 7d9342aecd mkconfig.rb: SDKROOT
* tool/mkconfig.rb (RbConfig): prefix SDKROOT to oldincludedir
  not includedir, the latter is outside the ruby installation.
  [ruby-core:72496] [Bug #11881]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-01 01:27:30 +00:00
nobu 19f035ccee mkconfig.rb: must not be frozen
* tool/mkconfig.rb: rbconfig must not be fronzen-string-literal to
  expand CONFIG hash.  [ruby-core:72006] [Bug #11798]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09 20:53:21 +00:00
hsbt ce9b056c5d * mkconfig.rb: Add some high-level documentation.
[ci skip][fix GH-1081]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-16 07:16:16 +00:00
nobu 51bcbca236 rbconfig.rb: use program version
* common.mk, tool/mkconfig.rb: check the running ruby version in
  rbconfig.rb with the program version, as RUBY_VERSION has never
  been affected by --with-ruby-version option.
  [ruby-core:68639] [Bug #11002]
* configure.in (LIBRUBY_DLDFLAGS): compatibility_version must be
  valid version numbers, not an arbitrary string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-02 07:27:12 +00:00
nobu 733a03c285 mkconfig.rb: embed version substring
* tool/mkconfig.rb (RbConfig): embed substring of the version, not
  at the runtime, and fall back to the version itself for the case
  it does not include the teeny version.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-26 00:30:07 +00:00
nobu 6268830ba8 mkconfig.rb: without fake.rb
* tool/mkconfig.rb: use arguments instead of built-in constants
  to work without fake.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-07 02:06:11 +00:00
nobu e9f3a59e85 configure.in: BOOTSTRAPRUBY
* configure.in (BOOTSTRAPRUBY): baseruby if cross compiling or
  miniruby, anyway runnable ruby command.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-07 02:06:06 +00:00
nobu cb0cfbb4c3 mkconfig.rb: no build-time variables
* tool/mkconfig.rb: exclude unnecessary build-time only variables,
  various ruby commands, installation targets, and dtrace stuffs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-01 02:17:13 +00:00
nobu 25edb07cb3 mkconfig.rb: delete DESTDIR
* tool/mkconfig.rb (RbConfig): delete default DESTDIR set by
  --with-destdir.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-25 09:17:33 +00:00
naruse 7d24866746 * tool/merger.rb: support 2.1+ versioning scheme.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-25 06:35:47 +00:00
nobu e98f7ea423 mkconfig.rb: SDKROOT
* tool/mkconfig.rb (RbConfig): allow prefix includedir by SDKROOT
  environment variable on OSX.  cf.
  http://www.opensource.apple.com/source/ruby/ruby-106/patches/tool_mkconfig.rb.diff

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-10 08:30:16 +00:00
naruse 011b74b748 * tool/mkconfig.rb: remove not to require rbconfig/obsolete.rb.
* lib/rbconfig/obsolete.rb: removed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-07 02:07:01 +00:00
nobu 76bb597728 mkconfig.rb: fix empty prefix
* tool/mkconfig.rb: vars["prefix"] may not set.  [fix GH-643]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-27 22:52:46 +00:00