Skip to content

Instantly share code, notes, and snippets.

View hsbt's full-sized avatar
🏠
Working from home

Hiroshi SHIBATA hsbt

🏠
Working from home
View GitHub Profile
@hsbt
hsbt / ruby-windows-mswin-distribution-proposal-ja.md
Last active July 5, 2026 10:52
Japanese version of the proposal: Provide official Windows (mswin) binary packages and a version manager

Windows (mswin) 公式バイナリパッケージとバージョンマネージャの提供

背景

Ruby はかつて公式の Windows バイナリを配布していました。https://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ には 1.6 から 1.9-preview 時代の mswin32 の zip が今も残っており、1.9 の頃に途絶えています。理由のひとつは、素の zip が配布物として成立していなかったことです。https://bugs.ruby-lang.org/issues/999 には ruby-1.9.1-preview1 の mswin32 zip に OpenSSL と zlib の DLL が入っておらず gem update が全く動かなかったという報告があります。

以来、Windows への Ruby のインストールはサードパーティの配布物に依存してきました。ruby/ruby の CI が MSVC で実際にビルドしテストしている mswin プラットフォームには、エンドユーザー向けの配布物が存在しません。現状が Windows ユーザーにどう受け止められているかは https://bugs.ruby-lang.org/issues/19325 が示すとおりです。

技術的な土台は変わりました。この数か月、mswin に残っていた動かないテストは私自身がすべて修正しました。nmake checktest-bundlertest-bundled-gems は現在グリーンで、全テストスイートを実行する nmake exam も完走します。ビルドは pin された vcpkg manifest (vcpkg.json) で C 依存を管理しており、CI は VS 2022、VS 2026、windows-11-arm をカバーしています。MSVC の ABI (vcruntime140) は 2015 年から安定しています。欠けているのはビルド品質ではなく配布です。

test

@hsbt
hsbt / git-coauthor
Last active January 25, 2024 07:02 — forked from pocke/git-coauthor
Add GitHub's Co-authored-by to the latest commit from account name
#!/usr/bin/env bash
USAGE="Usage: git coauthor USERNAME
It adds the specified user as Co-authored-by into the latest commit.
Example:
$ git coauthor pocke"
From 6e957e7d49f1e1762fd28d3a0d0df1f3cd1ec288 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Date: Tue, 21 Nov 2023 17:09:58 +0900
Subject: [PATCH] Revert "[Feature #19422] Enable shared by default on macOS"
This reverts commit 9694445051c4192c8f659529133acab253bd0bc3.
---
configure.ac | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
@hsbt
hsbt / demo.rb
Created September 11, 2021 03:29
class Demo
# 外向けからはこれだけがよばれる
def run
puts 'new'
_run
end
private
diff --git tool/sync_default_gems.rb tool/sync_default_gems.rb
index 1c697857d0..3b8dd5474d 100644
--- tool/sync_default_gems.rb
+++ tool/sync_default_gems.rb
@@ -353,6 +353,15 @@ def sync_default_gems(gem)
end
end
+IGNORE_FILE_PATTERN =
+ /\A(?:[A-Z]\w*\.(?:md|txt)
lib/open-uri.rb
2:require 'uri'
lib/time.rb
3:require 'date'
lib/rdoc/store.rb
2:require 'fileutils'
lib/rdoc/options.rb
hsbt@euclid /usr % ls /usr/lib
charset.alias libMTLCapture.dylib libiodbcinst.2.dylib log sasl2
cron libffi-trampolines.dylib libiodbcinst.dylib pam sqlite3
dsc_extractor.bundle libgmalloc.dylib libobjc-trampolines.dylib php swift
dtrace libhunspell-1.2.0.dylib libpython.dylib pkgconfig system
dyld libhunspell-1.2.dylib libpython2.7.dylib python2.7 updaters
groff libiodbc.2.dylib libstdc++.6.dylib rpcsvc xpc
libLeaksAtExit.dylib libiodbc.dylib libstdc++.dylib ruby zsh
linking shared-object io/nonblock.bundle
../../../../ext/fiddle/libffi-3.2.1/src/arm/trampoline.S:34:17: error: vector register expected
stmfd sp!, {r0-r3}
^
../../../../ext/fiddle/libffi-3.2.1/src/arm/trampoline.S:39:9: error: invalid operand for instruction
ldr r0, [pc, #-4092]
^
../../../../ext/fiddle/libffi-3.2.1/src/arm/trampoline.S:42:9: error: invalid operand for instruction
ldr pc, [pc, #-4092]
^
$ rbenv install truffleruby-20.2.0
ruby-build: using openssl from homebrew
Downloading truffleruby-20.2.0-macos-amd64.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ac1e6867e357a44d0bb72b0bb44ea50c3900b0574e81e6e48d2317b6b45a6ffd
Installing truffleruby-20.2.0...
Recompiling the OpenSSL C extension (against the installed libssl)
/Users/hsbt/.local/share/rbenv/versions/truffleruby-20.2.0/lib/mri/rubygems/specification.rb:18: warning: loading in progress, circular require considered harmful - /Users/hsbt/.local/share/rbenv/versions/truffleruby-20.2.0/lib/mri/rubygems.rb
<internal:core> core/kernel.rb:265:in `require': RubyGems did not redefine #require as expected, make sure $LOAD_PATH and home are set correctly (RuntimeError)
from /Users/hsbt/.local/share/rbenv/versions/truffleruby-20.2.0/lib/mri/rubygems/specification.rb:18:in `<top (required)>'
from <internal:core> core/kernel.rb:257:in `require'