Enforce JRuby as the supported ruby for running Warbler itself
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 领域
- 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-javavariants) 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_filesreferences bareJRUBY_VERSION(jar.rb:221) in the default-gem branch -NameErroron CRuby. - JRuby-only features: the
compiledfeature shells out tojrubyc; 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 (
ZipSupportvswarbler_jar.jarconditional),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,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jruby/warbler 的其他 Issue
-
难度 4/5 一周以上 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 22/100
-
难度 5/5 一周以上 新手友好度 12/100
-
难度 5/5 一周以上 新手友好度 12/100
-
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
aws/aws-sdk-ruby#3460 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 17 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
riscv/riscv-unified-db#2755 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
ossf/best-practices-badge#3081 ·
维护者通常 1 天内回复