Split gem into Ruby and extension parts
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
调研方向
未指定文件或测试。首先跟踪当前的 prism gem 打包方式和原生扩展构建,然后评估提议的 prism 和 prism-ext 构件以及 JRuby 的 WASM 路径;完成的标准是已实现拆分和平台行为,并且 JRuby prism 包排除原生库。
由索引模型根据 Issue 内容生成。
描述
I would like to split the current Prism gem into two pieces: "prism" which contains the Ruby parts of the library, and "prism-ext" which contains the native extension and native library. This makes most sense for JRuby, but it would be simpler if done as a general move.
This is less of an issue and more of an idea that would make our lives easier in the JRuby world.
For JRuby users, the dependency on a native library is usually problematic. A large percentage of JRuby users (perhaps a majority) deploy JRuby into environments where there's no C build tools and frequently no allowances for random native libraries on the filesystem. Some of these deployments are all-in-one bundles that don't even unpack files to the filesystem. In such cases, the native library can't be built or loaded.
The most sensible option for the prism gem for JRuby would be that it ships only what can be run without native libraries; specifically this would mean prism would ship the WASM version of Prism so it can be embedded and bundled in all the ways JRuby users depend upon.
Users could opt-into the faster native Prism build by installing prism-ext or prism-library, which would build the dynamic library and make it available to the prism library. We would only ship prism as part of JRuby releases, since we need our distribution to always work across platforms.
The native-extension implementations would continue to just use the ext or the dynamic library as today.
The artifacts would look something like this:
prismgem includes only the Ruby parts of the library and can be patched and versioned independently of the native code.prism-extwould work like the currentprismgem does, building and installing either the CRuby extension or the dynamic library.- The normal non-platform-specific version of the
prismgem would depend uponprism-ext. - The
javaplatform version of theprismgem (for JRuby) would ship only the Ruby parts and the WASM library. Users can opt into the native version by installingprism-ext.
Alternatively, these changes would only apply to JRuby, and prism-ext would only be for JRuby users. Either way, the main prism gem for JRuby will need to exclude the native library.
I can think of other benefits to separating the extension into its own gem:
- CRuby users would be able to update just the Ruby part of Prism while still using the built-in native extension. This might make some bug fixes easier to distribute.
- If TruffleRuby in the future chooses to run Prism in a different form such as with Chicory or TruffleWasm, it would be a natural progression of this split.
- Doing the split uniformly (rather than just for JRuby) will keep the differences minimal. CRuby users would just get an additional extension dependency.
- 主要语言
- C
- 星标
- 1k
- 派生
- 194
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 15
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/prism 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
-
Revisit comments 未关闭enhancement
难度 5/5 一周以上 新手友好度 30/100
-
java
难度 5/5 一周以上 新手友好度 25/100
-
java
难度 5/5 一周以上 新手友好度 25/100
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
相似的 Issue
-
task
难度 2/5 1-3 小时 新手友好度 70/100
vsanthanam/JBird#429 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
bug documentation
难度 2/5 1-3 小时 新手友好度 75/100
es-ude/OnDeviceTraining#459 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
bilelmoussaoui/gobject-linter#199 · 1 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
bradcypert/plum#53 ·