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

1698 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada d752cf7601 Use class methods of `File` over `Kernel.open` and `IO.read` 2022-12-01 02:28:49 +09:00
Takashi Kokubun a1d70f5b12 MJIT: Rename mjit_compile_attr to mjit_sp_inc
There's no mjit_compile.inc, so no need to use this prefix anymore.
2022-11-29 21:45:34 -08:00
Nobuyoshi Nakada 1a47521c44
Use `rb_sprintf` instead of deprecated `sprintf` 2022-11-25 08:51:14 +09:00
Nobuyoshi Nakada 612aa5c24a
Use class methods of `File` over `Kernel.open` and `IO.read` 2022-11-21 22:16:49 +09:00
Lars Kanis 439990318d Avoid warnings on MINGW:
win32/win32.c: In function 'rtc_error_handler':
win32/win32.c:691:5: warning: function 'rtc_error_handler' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
  691 |     rb_str_vcatf(str, fmt, ap);
      |     ^~~~~~~~~~~~

and

win32/win32.c:683:1: warning: 'rtc_error_handler' defined but not used [-Wunused-function]
  683 | rtc_error_handler(int e, const char *src, int line, const char *exe, const char *fmt, ...)
      | ^~~~~~~~~~~~~~~~~
2022-11-20 11:06:28 +09:00
Samuel Williams ea8a7287e2
Add support for `sockaddr_un` on Windows. (#6513)
* Windows: Fix warning about undefined if_indextoname()

* Windows: Fix UNIXSocket on MINGW and make .pair more reliable

* Windows: Use nonblock=true for read tests with scheduler

* Windows: Move socket detection from File.socket? to File.stat

Add S_IFSOCK to Windows and interpret reparse points accordingly.
Enable tests that work now.

* Windows: Use wide-char functions to UNIXSocket

This fixes behaviour with non-ASCII characters.
It also fixes deletion of temporary UNIXSocket.pair files.

* Windows: Add UNIXSocket tests for specifics of Windows impl.

* Windows: fix VC build due to missing _snwprintf

Avoid usage of _snwprintf, since it fails linking ruby.dll like so:

  linking shared-library x64-vcruntime140-ruby320.dll
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol snwprintf
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol vsnwprintf_l

whereas linking miniruby.exe succeeds.

This patch uses snprintf on the UTF-8 string instead.

Also remove branch GetWindowsDirectoryW, since it doesn't work.

* Windows: Fix dangling symlink test failures

Co-authored-by: Lars Kanis <kanis@comcard.de>
2022-11-17 14:50:25 -08:00
Lars Kanis 7b1d23fd29
Windows: Readlink improvements (#6745)
* Windows: Use readlink emulation for File.readlink

This fixes readlink emulation for the ERROR_MORE_DATA case and general error reporting.
It now releases GVL while readlink IO operation.

The dedicated rb_readlink was introduced in commit 2ffb87995a
in order to improve encoding and buffer allocation.
However the encoding issues are solved since ruby-3.0 switched to UTF-8
and the buffer allocation will be improved in a later commit.

* Windows: Increase the default buffer size for reparse point info

So far nearly all queries of reparse points needed two attempts to get enough buffer.

* Windows: Remove declaration of rb_w32_wreadlink

It was removed in commit 2f6fdd3aeb
2022-11-17 01:57:52 -08:00
Josh Cooper 1670e96c0d [win32] Only include base windows types
esent.h is the header for MS essential storage engine (JET) which is not
needed in ruby. basetsd.h has existed since _MSC_VER >= 1200 (VS 6.0)
and is the preferred header to use for WCHAR.
2022-10-26 10:42:03 +09:00
Takashi Kokubun 0e816e6d30
Demote mjit_instruction.rb from builtin to stdlib 2022-09-18 14:04:20 +09:00
Takashi Kokubun 39f91bc24b
Always generate non-empty revision.h
Non-GNU make seems to generate empty revision.h, but it doesn't make
sense since https://github.com/ruby/ruby/pull/6382.

Also the $(HAVE_BASERUBY:yes=tmp) hack doesn't seem to be working on
OpenBSD. I'll remove it to focus on fixing RubyCI first, and then deal
with baseruby-missing environments. At least a snapshot should have
revision.h and it might work fine though.
2022-09-17 23:44:14 +09:00
Takashi Kokubun 38a7a13ac6
Auto-generate the release date on version.h from git CommitDate (#6382)
* Auto-generate the release date on version.h

from git CommitDate

* Generate revision.h on mswin
2022-09-17 21:16:06 +09:00
U.Nakamura 316b44df09 Add GMP support for mswin 2022-09-13 15:44:29 +09:00
Nobuyoshi Nakada f641179525
[win32] Set proper `NULLCMD` in rbconfig.rb [ci skip] 2022-09-10 21:32:19 +09:00
YO4 28030f7b54 eliminate magic number 2022-09-09 00:45:56 +09:00
YO4 81e7573a64 win32.c additional fix: is_readable_console
classic console(conhost.exe) reports an input with ALT+NUMPAD as VK_MENU, KeyUp, and uChar!=0.
additional fix for #5634
2022-09-09 00:45:56 +09:00
YO4 7a849e1903 win32.c fix: is_readable_console
UnicodeChar with lower byte == 0 has dropped accidentaly
this is additional fix for #5634
2022-09-09 00:45:56 +09:00
Nobuyoshi Nakada e2ccb316b4 [Bug #5317] Use `rb_off_t` instead of `off_t`
Get rid of the conflict with system-provided small `off_t`.
2022-09-08 23:01:07 +09:00
Nobuyoshi Nakada e76a550876 [MSWin] Fix for non-Windows (cygwin/msys) BASERUBY 2022-09-08 13:41:02 +09:00
Nobuyoshi Nakada 26c4230404 [MSWin] Disable rubygems of BASERUBY 2022-09-08 13:41:02 +09:00
Nobuyoshi Nakada 1f91dcdab3
Define BOOTSTRAPRUBY from HAVE_BASERUBY 2022-09-07 14:33:25 +09:00
Nobuyoshi Nakada 3a575d13d5
Ensure BASERUBY when cross-compiling 2022-09-07 10:08:23 +09:00
Takashi Kokubun 3767c6a90d
Ruby MJIT (#6028) 2022-09-04 21:53:46 -07:00
Nobuyoshi Nakada 7c67d0fd79
Make sources by BASERUBY if available instead of miniruby 2022-09-03 19:25:29 +09:00
Nobuyoshi Nakada bc5b9be1ee
Move duplicate dependencies 2022-09-03 15:01:05 +09:00
Nobuyoshi Nakada 1d83302f32
[Win32] Use `exit` instead of `type` [ci skip]
`exit` command ignores the rest arguments after an exit code, while
`type` command tries to read all as files.
2022-08-28 13:54:14 +09:00
Takashi Kokubun ddf96b7693
Drop mswin support of MJIT (#6265)
The current MJIT relies on SIGCHLD and fork(2) to be performant, and
it's something mswin can't offer. You could run Linux MJIT on WSL
instead.

[Misc #18968]
2022-08-20 18:35:36 -07:00
Nobuyoshi Nakada cd1a0b3caa Stop defining `RUBY_ABI_VERSION` if released versions
As commented in include/ruby/internal/abi.h, since teeny versions of
Ruby should guarantee ABI compatibility, `RUBY_ABI_VERSION` has no role
in released versions of Ruby.
2022-08-12 15:57:25 +09:00
Nobuyoshi Nakada 74d95744bd
Add `--enable-devel` configure option
Since `RUBY_DEVEL` in cppflags has no effect in the configure script
and makefiles.
2022-08-11 11:34:52 +09:00
Nobuyoshi Nakada 58c8b6e862
Adjust styles [ci skip] 2022-08-06 10:13:20 +09:00
Takashi Kokubun 5b21e94beb Expand tabs [ci skip]
[Misc #18891]
2022-07-21 09:42:04 -07:00
Jean Boussier d084585f01 Rename ENCINDEX_ASCII to ENCINDEX_ASCII_8BIT
Otherwise it's way too easy to confuse it with US_ASCII.
2022-07-19 08:48:56 +02:00
Nobuyoshi Nakada ee48c9cda6
[Win32] allow pipe in flock 2022-04-21 15:14:08 +09:00
Nobuyoshi Nakada a0040af671 [Win32] Fix mode of character/pipe device stat [Bug #18732] 2022-04-15 17:14:29 +09:00
Nobuyoshi Nakada 7b1ece9b94
Get rid of type-punning pointer casts 2022-04-07 19:19:13 +09:00
Nobuyoshi Nakada 97ce030954 Load fake.rb at `BTESTRUBY`
So that `mkmf` checks work from `make run`, and also remove
duplicate `$(MINIRUBYOPT)` which is used in `$(MINIRUBY)`.
2022-04-05 22:35:40 +09:00
Peter Zhu 9f306618b1 [Bug #18667] Define RUBY_API_VERSION on Windows
On other platforms, RUBY_SO_NAME is defined from RUBY_API_VERSION.
ruby_version contains the ABI version, which is not needed.
RUBY_API_VERSION is defined as MAJOR.MINOR.
2022-03-30 18:08:46 -04:00
Nobuyoshi Nakada 26aff37466
Need to reconfigure and rebuild everything when abi.h changed 2022-03-23 00:58:46 +09:00
YO4 5d90c60109
Avoid console input behavior in windows 10 [Bug #18588]
When ANSI versions of PeekConsoleInput read multibyte charactor
partially, subsequent ReadFile returns wrong data on newer Windows
10 versions (probably since Windows Terminal introduced).  To
avoid this, use Unicode version of of PeekConsoleInput/ReadConsole.
2022-03-16 10:28:35 +09:00
Nobuyoshi Nakada 0b66121484
[MSWin] Allow gems with VS2022 for VS2019 build ruby [Misc #18362]
Although not sure if it is really compatible, let’s give it a
try.
2022-03-02 23:18:54 +09:00
Peter Zhu 97001638d9 Add ABI version to ruby_version tag on Windows 2022-02-24 13:31:53 -05:00
Nobuyoshi Nakada ed8776f960 [MSWin] Tentative measure for a bug of VS2022 [Misc #18362]
Disable the use of `__assume()`, when combinations of `isnan()`,
`isinf()` and `__assume()` will be wrongly optimized due to the
bug of VS2022.
2022-02-20 20:39:48 +09:00
Nobuyoshi Nakada 7470780058 Check if `__assume` is supported 2022-02-19 23:32:52 +09:00
Nobuyoshi Nakada 131154f878 Define `HAVE___BUILTIN_UNREACHABLE` instead of `UNREACHABLE`
`UNREACHABLE` in ruby/internal/has/builtin.h is only used as just
a flag now, and redefined in ruby/backward/2/assume.h then.
2022-02-19 23:32:52 +09:00
Nobuyoshi Nakada 11862c1a7c
[MSWin] Remove stale configuration check [ci skip]
PSAPI library has not been used since d66c5768ca.
2022-02-12 23:17:23 +09:00
Nobuyoshi Nakada 5de62fe37c
Fixed an missing percent in the batch file 2022-01-24 18:10:17 +09:00
Yuta Saito 6729258839
include/ruby/win32.h: define HAVE_X for the missing prototypes (#5456) 2022-01-18 19:08:07 +09:00
nagachika d5fc3fa4db win32/win32.c Fix PROT_EXEC bit flag check for FlushInstrucitonCache() 2021-12-30 21:16:29 +09:00
U.Nakamura 4e007d705c Fix some bornheads 2021-12-27 17:15:09 +09:00
U.Nakamura 85a426dc86 Tiny mmap emulation for Windows
- prerequisite of supporting YJIT with VC++.
- note that now can specfily `--yjit` on mswin64, but not enabled
  YJIT'ed code because of YJIT requires `OPT_DIRECT_THREADED_CODE`
  or `OPT_CALL_THREADED_CODE` in `rb_yjit_compile_iseq`.
2021-12-27 15:56:23 +09:00
Takashi Kokubun 11b8aaa26a
Rename --jit to --mjit (#5248)
* Rename --jit to --mjit

[Feature #18349]

* Fix a few more --jit references

* Fix MJIT Actions

* More s/jit/mjit/ and re-introduce --disable-jit

* Update NEWS.md

* Fix test_bug_reporter_add
2021-12-13 16:08:01 -08:00