crystal-jp / introducing-crystal

『Introducing Crystal Programming Language』の原稿をまとめたリポジトリです
https://crystal-jp.github.io/introducing-crystal/
17 stars 3 forks source link

Support Crystal 1.0.0 🎉 #70

Closed kachick closed 3 years ago

kachick commented 3 years ago

https://github.com/crystal-lang/crystal/pull/10500 に対応させてみました! (bundle exec rake test が通る、という意味でですが・・・)

最初詰まったところは https://crystal-jp.slack.com/archives/C06TSJY59/p1616552881005400 にも書かせて頂いたのですが、

shard.yml の crystal version 指定が無いと 1.0.0 から shards install 時に --ignore-crystal-version 無しだと エラーになる shard.yml の crystal version 指定が 0.36.1 みたいな感じだと、やはり 1.0.0 から shards install 時に --ignore-crystal-version 無し だと エラーになる  という仕様で、 crystal 1.0.0 でも動きそうなのに shards 的に厄介になっているという物が一杯ありました・・・ この仕様おかしいのでは?と思ったんですが、過去に議論済みみたいです。 https://github.com/crystal-lang/shards/issues/413 https://github.com/crystal-lang/shards/pull/395 https://github.com/crystal-lang/shards/issues/365 https://github.com/crystal-jp/introducing-crystal に 1.0.0 対応して欲しいなと思っただけなんですが、依存先のそのまた依存先の指定でこれに引っかかるみたいなのが多くて・・・ 正直人力でやるんじゃなくて bot でやるべき作業では?と思いつつ幾つかPR出しておきました。 https://github.com/crystal-lang/html_builder/pull/13 https://github.com/jeromegn/slang/pull/60 https://github.com/jeromegn/kilt/pull/25 https://github.com/matthewmcgarvey/webdrivers.cr/pull/7 https://github.com/luckyframework/habitat/pull/70 https://github.com/naqvis/crystar/pull/10 https://github.com/kemalcr/spec-kemal/pull/20 gem の required_ruby_version みたいな物と考えると、そもそも crystal: '>= 0.35.0' みたいに このバージョン以降は動くよ と指定しておくのが良さそうです。 https://github.com/crystal-lang/shards/pull/487 と、長くなっちゃったんですが、 crystal 1.0.0 で既存の何かが shard のエラーで動かなくなったらとりあえず --ignore-crystal-version を付けてみる、で大半は解決しそう。という話でした。

というように、 依存 shards の指定の問題でした。 最初はなるべくそれらに対してPRを投げていったんですが、キリが無いのとマージされるのがいつになるのかわからない、 https://github.com/crystal-lang/shards/pull/487#issuecomment-805168601

Currently we see a lot of issues with shard dependencies not installing for 1.0 just because they don't state to be compatibile. If you install with --ignore-crystal-version, everything works. But that shouldn't be the solution every time a new major Crystal release happens and shard maintainers don't get to update their shard dependencies quickly.

と言われたこともあり、 --ignore-crystal-version とりあえずこれをつけちゃって良いのでは?と思った次第です。

次に引っかかったのは https://github.com/at-grandpa/clim という shards への依存で spec が大分落ちているようでした。 https://github.com/crystal-jp/introducing-crystal/commit/feb6c8d20fb16e30fafa45ead81194a9f96a3ec3, https://github.com/crystal-jp/introducing-crystal/commit/ee5f886ebbaf97300015fde739a814a12d8502a0 でなんとなく書き換えてみたら spec 通ったので大丈夫かな・・・?と思った感じです。

あまり Crystal 周りのことわかってない中手探り感あるので、間違い等あれば突っ込んで下さい 🙏

kachick commented 3 years ago

あ、 clim に関しては作者の @at-grandpa さんが著者のお一人ということなので、直接見てもらえると確実そうですね 🙏

https://github.com/crystal-jp/introducing-crystal/commits?author=at-grandpa https://github.com/crystal-jp/introducing-crystal/blob/7066d90abef3c469ef8426ae21e4f57adaa93148/authors.adoc#at_grandpa

at-grandpa commented 3 years ago

@kachick @MakeNowJust climに関して修正ありがとうございます。 https://github.com/crystal-jp/introducing-crystal/commit/feb6c8d20fb16e30fafa45ead81194a9f96a3ec3 https://github.com/crystal-jp/introducing-crystal/commit/ee5f886ebbaf97300015fde739a814a12d8502a0 の修正で問題ありません!

もともとが 0.4.0 というかなり昔のversionだったので、いろいろとコケていましたね。。改めて修正ありがとうございました!

kachick commented 3 years ago

おー良かったです! ありがとうございます! 🙏

makenowjust commented 3 years ago

@kachick マージしました。ありがとうございます!

kachick commented 3 years ago

ありがとうございます! 😂 🎉