Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Enforce JRuby as the supported ruby for running Warbler itself

未关闭
#649 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
冷清
技术栈
java, ruby
领域
build-system

调研方向

Start in lib/warbler/jar.rb, at the JRUBY_VERSION reference in find_single_gem_files (around line 221) and the symlink handling (around line 313), then find the ZipSupport versus warbler_jar.jar fallback. The gemspec's platform setting is the other entry point. Before changing anything, get a maintainer decision on whether to fail fast or only warn, since the issue leaves that open. Done means the chosen enforcement exists, the MRI guards are gone, the README documents JRuby-only use, and the spec suite still passes under JRuby.

由索引模型根据 Issue 内容生成。

描述

Warbler currently implicitly half-supports being run under CRuby to package archives: the gem installs anywhere (platform = Gem::Platform::RUBY), and the packaging engine falls back from warbler_jar.jar to pure-Ruby rubyzip when JRUBY_VERSION is not defined. This was never made an explicit contract (see #324) and should be tightened to JRuby-only, because packaging
under CRuby is quietly broken by design:

  • Wrong-platform gem resolution: Bundler/RubyGems resolve gems for the building ruby. Under CRuby that means ruby-platform gems (e.g. native extension nokogiri/psych instead of their -java variants) get packed into an archive that will only ever run on JRuby - assembling fine at build time and failing at boot.
  • Latent crashes: e.g. Warbler::Jar#find_single_gem_files references bare JRUBY_VERSION (jar.rb:221) in the default-gem branch - NameError on CRuby.
  • JRuby-only features: the compiled feature shells out to jrubyc; symlink handling is JRuby-only (jar.rb:313).
  • Zero coverage: the spec suite only runs under JRuby; MRI behaviour is whatever has not rotted since someone last tried it.

Proposed

  • Fail fast (or at minimum warn loudly) when RUBY_ENGINE != 'jruby', pointing at JRuby as the supported build ruby
  • Document JRuby-only usage in the README
  • Remove the now-unreachable MRI accommodations: the rubyzip fallback path (ZipSupport vs warbler_jar.jar conditional), defined?(JRUBY_VERSION) guards, and the MRI symlink warning
  • Consider spec.platform = 'java' for the gem itself so installation is the enforcement point

Refs #324: the request to properly support MRI packaging - this issue resolves that question in the opposite direction, which the wrong-platform gem resolution problem makes the only sound one.
Refs #408: warning or preventing JRuby version skew - an even worse problem likely to generate jars/wars broken on a given JRuby version.


Summarised with Claude assistance.

主要语言
Ruby
星标
901
派生
206
平均合并
1 天 10 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jruby/warbler 的其他 Issue

查看 jruby/warbler 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。