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

1761 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 7845ab1bc9
[Bug #20687] Exclude just built ruby as baseruby
On Windows, an executable file in the current directory has the
priority to the PATH environment variable always.
2024-08-21 20:43:56 +09:00
Raed Rizqie f1224e55fd fix i386-ucrt build 2024-08-11 00:10:28 +09:00
Nobuyoshi Nakada 7aea269b89 [Feature #20563] Drop support for Windows older than 8/Sever 2012
Directly call APIs available on Windows 8/Server 2012 and later.
2024-07-31 09:57:38 +09:00
Nobuyoshi Nakada 7ef8051cbb [Feature #20563] Drop support for Windows older than Vista/2008
Directly call APIs available on Windows Vista/Server 2008 and later.
2024-07-31 09:57:38 +09:00
Nobuyoshi Nakada 3219ecf4f6 Win32: Skip check for VS2022 FP BUG by default 2024-07-15 16:34:23 +09:00
Nobuyoshi Nakada 880b7f1513
Win32: Pass triplet option to vcpkg 2024-07-14 19:09:13 +09:00
Peter Zhu e5d12f9cce Move gc_impl.c to gc/gc_impl.c
This commit creates a new directory `gc` to put different GC
implementations and moves the default GC from gc_impl.c to gc/gc_impl.c.
The default GC can be easily switched using the `BUILTIN_GC` variable
in Makefile.in.
2024-07-11 09:09:47 -04:00
Nobuyoshi Nakada 4688b92a86
[win32] Fallback release date when revision.h is not present 2024-07-02 12:39:11 +09:00
Hiroshi SHIBATA d70057d4b5 We couldn't use nmake before configure.bat 2024-06-26 12:31:02 +09:00
Hiroshi SHIBATA 797e1dfb83 Link dll files on install-vcpkg tasks 2024-06-26 12:31:02 +09:00
Hiroshi SHIBATA 2f76faaf51 Added tasks related vcpkg 2024-06-25 16:14:45 +09:00
Nobuyoshi Nakada dd378c5a24
Expand --with-opt-dir arguments 2024-06-22 02:16:16 +09:00
Nobuyoshi Nakada 906a86e4de
Use `dllexport` as `RUBY_FUNC_EXPORTED` on Windows 2024-06-09 16:55:27 +09:00
Nobuyoshi Nakada 83f02d42e0
[Bug #20524] Do not define USE_GMP insteaad of setting to "no" 2024-06-05 21:05:16 +09:00
Nobuyoshi Nakada 065190a973
[Bug #20524] win32: Try to configure GMP if available 2024-06-05 17:11:10 +09:00
Nobuyoshi Nakada 26bd4144f7
Add `nightly` recipe
Installs the last revision in the previous `RUBY_RELEASE_DATE`.
2024-06-02 18:36:09 +09:00
Nobuyoshi Nakada f630b24d7a
Fix `calloc` arguments order for -Wcalloc-transposed-args 2024-05-29 14:53:33 +09:00
Nobuyoshi Nakada ce20367a0e Define `incflags` also on mswin 2024-05-23 13:16:48 +09:00
Nobuyoshi Nakada 376ae22235
Manage required baseruby version in one place
Add a Ruby script mode to `tool/missing-baseruby.bat` that checks if
`RUBY_VERSION` meets the required version.  This will enable similar
checks on mswin as well.
2024-03-31 00:54:38 +09:00
Nobuyoshi Nakada 5d71880df6 Embed manifest with VS2013 or later
Since VS2013, `link.exe` supports `-manifest:embed` option.
[`/MANIFEST` (Create side-by-side assembly manifest)](https://learn.microsoft.com/en-us/cpp/build/reference/manifest-create-side-by-side-assembly-manifest?view=msvc-170&viewFallbackFrom=msvc-120)
2024-03-13 02:34:12 +09:00
Yusuke Endoh 25d74b9527 Do not include a backtick in error messages and backtraces
[Feature #16495]
2024-02-15 18:42:31 +09:00
Nobuyoshi Nakada a63a0c247b
Win32: Include stdio.h for `printf` 2024-02-12 01:09:51 +09:00
Nobuyoshi Nakada 90fe1b4402
Win32: Use `TARGET_OS` for word-size
It is derived from `_WIN64` pre-defined macro, at `-osname-` in
win32/setup.mak.
2024-02-11 22:00:12 +09:00
Nobuyoshi Nakada ea2ea74a26
Win32: Copy coroutine no longer exists
At 42130a64f0, it has been replaced with
pthread implementation.
2024-02-11 20:03:18 +09:00
Nobuyoshi Nakada aa36e44c05
Win32: Define `HAVE_INTTYPES_H`
Suppress redefinition warnings, inttypes.h has been provided as well
as stdint.h since `_MSC_VER` 1600 (= Visual C++ 10.0 = Visual Studio
2010).

```
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(123): warning C4005: 'PRIdPTR': macro redefinition
D:\a\ruby\ruby\src\include\ruby/backward/2/inttypes.h(51): note: see previous definition of 'PRIdPTR'
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(142): warning C4005: 'PRIiPTR': macro redefinition
D:\a\ruby\ruby\src\include\ruby/backward/2/inttypes.h(52): note: see previous definition of 'PRIiPTR'
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(161): warning C4005: 'PRIoPTR': macro redefinition
D:\a\ruby\ruby\src\include\ruby/backward/2/inttypes.h(53): note: see previous definition of 'PRIoPTR'
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(180): warning C4005: 'PRIuPTR': macro redefinition
D:\a\ruby\ruby\src\include\ruby/backward/2/inttypes.h(54): note: see previous definition of 'PRIuPTR'
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(199): warning C4005: 'PRIxPTR': macro redefinition
D:\a\ruby\ruby\src\include\ruby/backward/2/inttypes.h(55): note: see previous definition of 'PRIxPTR'
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(218): warning C4005: 'PRIXPTR': macro redefinition
D:\a\ruby\ruby\src\include\ruby/backward/2/inttypes.h(56): note: see previous definition of 'PRIXPTR'
```
2024-02-11 19:34:13 +09:00
Pierrick Bouvier 784fdecc4c
windows-arm64 support (#8995)
* [win32] fix compilation for windows-arm64

Credits to MSYS2 Ruby package using this patch.

* [win32] nm use full options

Fix compilation error when using MSYS2 environment.
Credits to MSYS2 Ruby package using this patch.

* [win32] detect llvm-windres (used for windows-arm64)

When adding preprocessor option for llvm-windres (using clang as
parameter), it fails. Thus, do not add this.

It's needed to be able to compile windows-arm64 version, because MSYS2
toolchain is LLVM based (instead of GCC/binutils).

* [win32] pioinfo detection for windows-arm64

This fixes "unexpected ucrtbase.dll" for native windows-arm64 ruby
binary. It does not solve issue with x64 version emulated on this
platform.

Value of pioinfo pointer can be found in ucrtbase.dll at latest adrp/add
sequence before return of _isatty function. This works for both release
and debug ucrt.

Due to the nature of aarch64 ISA (vs x86 or x64), it's needed to
disassemble instructions to retrieve offset value, which is a bit more
complicated than matching specific string patterns.

Details about adrp/add usage can be found in this blog post:
https://devblogs.microsoft.com/oldnewthing/20220809-00/?p=106955
For instruction decoding, the Arm documentation was used as a reference.
2023-11-23 17:17:28 +09:00
Nobuyoshi Nakada 22939382a8 [Bug #18286] Make builtin binary if sharable in universal binaries 2023-11-09 16:01:01 +09:00
Lars Kanis 9a618b95cd
[Feature #19244] Windows: Prefer USERPROFILE over HOMEPATH on startup as well 2023-10-27 10:16:18 +09:00
Kevin Newton 3d0a46796b Rename YARP symbols to prism 2023-09-27 13:57:38 -04:00
Nobuyoshi Nakada 0f64290704 Add `rb_w32_uspawn_process` 2023-09-25 22:57:28 +09:00
Nobuyoshi Nakada 20bd19a9ad
Move YARP_BUILD_DIR to common.mk
It does not need to be an absolute path.
2023-09-21 18:18:27 +09:00
Takashi Kokubun 57dfd5c245 Revert "Fix tool/update-deps for YARP files"
This reverts commit 6fff5c5ba2.

Revert "Use $(top_srcdir) entries for mswin (#8244)"

This reverts commit e327bf32bd.

Revert "Update dependencies"

This reverts commit aba26a8804.

Revert "Use {$(VPATH)} for OpenBSD"

This reverts commit 2046e054bc.

---

None of those revisions actually worked for both mswin and OpenBSD at
the same time. I need more time to build something that works for both.
2023-08-18 01:12:41 -07:00
Takashi Kokubun e327bf32bd
Use $(top_srcdir) entries for mswin (#8244)
While the $(VPATH) rules live in common.mk, mswin seems to ignore them.
We need to use $(VPATH) for OpenBSD, but we need to use the other one for mswin.
2023-08-18 00:48:13 -07:00
Nobuyoshi Nakada b76c2ec005
Use `::` form workflow commands 2023-08-15 23:30:40 +09:00
Takashi Kokubun 38be9a9b72
Clean up OPT_STACK_CACHING (#8132) 2023-07-27 17:27:05 -07:00
Peter Zhu 58386814a7 Don't check for null pointer in calls to free
According to the C99 specification section 7.20.3.2 paragraph 2:

> If ptr is a null pointer, no action occurs.

So we do not need to check that the pointer is a null pointer.
2023-06-30 09:13:31 -04:00
Jemma Issroff d53e1f42ff [Feature #19741] Add yarp to builds
Add yarp to common.mk and windows builds to enable us to run yarp
correctly with CI.
2023-06-21 11:25:39 -07:00
Nobuyoshi Nakada 21b61b21c2
Fix the case no file under bin directory
NMake cannot handle empty expanded targets.
2023-06-02 16:58:55 +09:00
Samuel Williams a218ed5692
Hide the usage of `rb_io_t` where possible. (#7880)
This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
2023-06-01 14:23:30 +09:00
NARUSE, Yui 85dcc4866d Revert "Hide most of the implementation of `struct rb_io`. (#6511)"
This reverts commit 18e55fc1e1.

fix [Bug #19704]
https://bugs.ruby-lang.org/issues/19704
This breaks compatibility for extension libraries. Such changes
need a discussion.
2023-06-01 08:43:22 +09:00
Samuel Williams 18e55fc1e1
Hide most of the implementation of `struct rb_io`. (#6511)
* Add rb_io_path and rb_io_open_descriptor.

* Use rb_io_open_descriptor to create PTY objects

* Rename FMODE_PREP -> FMODE_EXTERNAL and expose it

FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but
FMODE_EXTERNAL is clearer about what the file descriptor represents and
aligns with language in the IO::Buffer module.

* Ensure that rb_io_open_descriptor closes the FD if it fails

If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be
responsible for closing your file, eventually, if you pass it to
rb_io_open_descriptor, even if it raises an exception.

* Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P

* Expose `rb_io_closed_p`.

* Add `rb_io_mode` to get IO mode.

---------

Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
2023-05-30 10:02:40 +09:00
Samuel Williams 6d976eb534
Fix "runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO" on Windows. (#7848)
* Enable borked spec.

* Ensure win32 wrappers are visible and used.

* Reorganise `read`/`write`/`pipe` in `thread_spec.c`.
2023-05-24 22:45:34 +09:00
Samuel Williams 28056a6d16
Add support for pread/pwrite on windows. (#7827) 2023-05-24 09:15:20 +09:00
Yuichiro Kaneko a1b01e7701
Use Lrama LALR parser generator instead of Bison
https://bugs.ruby-lang.org/issues/19637

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-05-12 18:25:10 +09:00
Nobuyoshi Nakada 39bbbd767d
Add rubyspec-capiext on mswin 2023-04-21 21:28:08 +09:00
Alan Wu 57bc4cfa28 [DOC] Remove obsolete win32/.document
The README file moved in f499c81b01.
2023-04-11 19:43:47 -04:00
Takashi Kokubun 2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun 011c08b643 Remove obsoleted mjit_sp_inc.inc.erb 2023-03-06 23:05:50 -08:00
Takashi Kokubun 233ddfac54 Stop exporting symbols for MJIT 2023-03-06 21:59:23 -08:00
Takashi Kokubun 526111290b Revert "reuse open(2) from rb_file_load_ok on POSIX-like system"
This reverts commit 35136e1e9c.

test-spec has been failing since this revision.

.github/workflows/compilers.yml:82
https://github.com/ruby/ruby/actions/runs/4276884159/jobs/7445299562

```
env:
  # Minimal flags to pass the check.
  default_cc: 'gcc-11 -fcf-protection -Wa,--generate-missing-build-notes=yes'
  optflags: '-O2'
  LDFLAGS: '-Wl,-z,now'
  # FIXME: Drop skipping options
  # https://bugs.ruby-lang.org/issues/18061
  # https://sourceware.org/annobin/annobin.html/Test-pie.html
  TEST_ANNOCHECK_OPTS: "--skip-pie --skip-gaps"
```

Failure:

```
  1)
  An exception occurred during: Kernel#require (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:317
  Kernel#require (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded ERROR
  LeakError: Leaked file descriptor: 8 : #<File:/__w/ruby/ruby/src/spec/ruby/fixtures/code/load_fixture.ext.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:5:in `<top (required)>'

  2)
  An exception occurred during: Kernel#require ($LOADED_FEATURES) stores an absolute path
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:330
  Kernel#require ($LOADED_FEATURES) stores an absolute path ERROR
  LeakError: Closed file descriptor: 8
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:5:in `<top (required)>'

  3)
  An exception occurred during: Kernel#require ($LOADED_FEATURES) does not load a non-canonical path for a file already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:535
  Kernel#require ($LOADED_FEATURES) does not load a non-canonical path for a file already loaded ERROR
  LeakError: Leaked file descriptor: 8 : #<File:/__w/ruby/ruby/src/spec/ruby/fixtures/code/load_fixture.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:5:in `<top (required)>'

  4)
  An exception occurred during: Kernel#require ($LOADED_FEATURES) does not load a ../ relative path for a file already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:551
  Kernel#require ($LOADED_FEATURES) does not load a ../ relative path for a file already loaded ERROR
  LeakError: Leaked file descriptor: 9 : #<File:../code/load_fixture.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:5:in `<top (required)>'

  5)
  An exception occurred during: Kernel#require ($LOADED_FEATURES) complex, enumerator, rational, thread, ruby2_keywords are already required
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:563
  Kernel#require ($LOADED_FEATURES) complex, enumerator, rational, thread, ruby2_keywords are already required ERROR
  LeakError: Closed file descriptor: 8
  Closed file descriptor: 9
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:5:in `<top (required)>'

  6)
  An exception occurred during: Kernel.require (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:317
  Kernel.require (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded ERROR
  LeakError: Leaked file descriptor: 8 : #<File:/__w/ruby/ruby/src/spec/ruby/fixtures/code/load_fixture.ext.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:23:in `<top (required)>'

  7)
  An exception occurred during: Kernel.require ($LOADED_FEATURES) stores an absolute path
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:330
  Kernel.require ($LOADED_FEATURES) stores an absolute path ERROR
  LeakError: Closed file descriptor: 8
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:23:in `<top (required)>'

  8)
  An exception occurred during: Kernel.require ($LOADED_FEATURES) does not load a non-canonical path for a file already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:535
  Kernel.require ($LOADED_FEATURES) does not load a non-canonical path for a file already loaded ERROR
  LeakError: Leaked file descriptor: 8 : #<File:/__w/ruby/ruby/src/spec/ruby/fixtures/code/load_fixture.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:23:in `<top (required)>'

  9)
  An exception occurred during: Kernel.require ($LOADED_FEATURES) does not load a ../ relative path for a file already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:551
  Kernel.require ($LOADED_FEATURES) does not load a ../ relative path for a file already loaded ERROR
  LeakError: Leaked file descriptor: 9 : #<File:../code/load_fixture.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:23:in `<top (required)>'

  10)
  An exception occurred during: Kernel.require ($LOADED_FEATURES) complex, enumerator, rational, thread, ruby2_keywords are already required
  /__w/ruby/ruby/src/spec/ruby/core/kernel/shared/require.rb:563
  Kernel.require ($LOADED_FEATURES) complex, enumerator, rational, thread, ruby2_keywords are already required ERROR
  LeakError: Closed file descriptor: 8
  Closed file descriptor: 9
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_spec.rb:23:in `<top (required)>'

  11)
  An exception occurred during: Kernel#require_relative with a relative path (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:197
  Kernel#require_relative with a relative path (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded ERROR
  LeakError: Leaked file descriptor: 8 : #<File:/__w/ruby/ruby/src/spec/ruby/fixtures/code/load_fixture.ext.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:4:in `<top (required)>'

  12)
  An exception occurred during: Kernel#require_relative with a relative path ($LOADED_FEATURES) stores an absolute path
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:205
  Kernel#require_relative with a relative path ($LOADED_FEATURES) stores an absolute path ERROR
  LeakError: Closed file descriptor: 8
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:4:in `<top (required)>'

  13)
  An exception occurred during: Kernel#require_relative with an absolute path (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:399
  Kernel#require_relative with an absolute path (file extensions) does not load a C-extension file if a complex-extensioned .rb file is already loaded ERROR
  LeakError: Leaked file descriptor: 8 : #<File:/__w/ruby/ruby/src/spec/ruby/fixtures/code/load_fixture.ext.rb>
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:277:in `<top (required)>'

  14)
  An exception occurred during: Kernel#require_relative with an absolute path ($LOAD_FEATURES) stores an absolute path
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:407
  Kernel#require_relative with an absolute path ($LOAD_FEATURES) stores an absolute path ERROR
  LeakError: Closed file descriptor: 8
  /__w/ruby/ruby/src/spec/ruby/core/kernel/require_relative_spec.rb:277:in `<top (required)>'
```
2023-02-27 09:24:45 -08:00