danger / swift

⚠️ Stop saying "you forgot to …" in code review
https://danger.systems/swift/
MIT License
1.04k stars 135 forks source link

Update SwiftLint (0.50.3) version in Dockerfile used in `danger-swift-with-swiftlint` container. #573

Closed JaviLorbada closed 1 year ago

JaviLorbada commented 1 year ago

This PR aims to update SwiftLint to version 0.50.3 used in danger-swift-with-swiftlint docker container.

SwiftLint release: https://github.com/realm/SwiftLint/releases/tag/0.50.3

JaviLorbada commented 1 year ago

@f-meloni could we try to create a new version of the danger-swift-with-swiftlint container and bump swiftlint to 0.50.3?

If something fails while building the container we can easily roll back, although I tried docker build and everything seemed fine. Thanks so much.

f-meloni commented 1 year ago

Yes, I'm currently not at home, but will be back and release beginning of next week 🙂

JaviLorbada commented 1 year ago

Awesome! Thank you very much!

JaviLorbada commented 1 year ago

Thanks for merging @f-meloni! 🙏🏼 Is there any date scheduled for the next release? Is there a way I can fetch a docker container including these changes? Thank you.

f-meloni commented 1 year ago

I have done the release, but the build failed because the new swiftlint requires bazel

JaviLorbada commented 1 year ago

Oh, no! I had no idea about that, sorry it broke the release.

f-meloni commented 1 year ago

No problem at all :) it can still be fixed or reverted, everything else but the container with swiftlint should be working ok

icecoffin commented 1 year ago

Any idea what could be the solution here to allow using the 3.16.0 container with SwiftLint? I believe Bazel can be installed via npm (npm install -g @bazel/bazelisk) which we already use to install Danger-JS. Alterrnatively, it can be installed using apt-get but the process looks a big more complicated (https://bazel.build/install/ubuntu). Would adding this extra step to the Dockerfile help?

f-meloni commented 1 year ago

Any idea what could be the solution here to allow using the 3.16.0 container with SwiftLint? I believe Bazel can be installed via npm (npm install -g @bazel/bazelisk) which we already use to install Danger-JS. Alterrnatively, it can be installed using apt-get but the process looks a big more complicated (https://bazel.build/install/ubuntu). Would adding this extra step to the Dockerfile help?

I had tried with apt get before, and had some issues with the versioning. I have tried npm install -g @bazel/bazelisk and that seemed to work well, but then I found out that I also need ruby 😢

Error in fail: Command 'ruby' not found. Set $PATH or specify interpreter_path interpreter_path
#6 29.37 ERROR: /_swiftlint/WORKSPACE:71:22: fetching ruby_runtime rule //external:org_ruby_lang_ruby_toolchain: Traceback (most recent call last):
#6 29.37    File "/root/.cache/bazel/_bazel_root/52554737be0413482e9bd72efb59fb14/external/bazelruby_rules_ruby/ruby/private/toolchains/ruby_runtime.bzl", line 128, column 13, in _ruby_runtime_impl
#6 29.37        fail(
#6 29.37 Error in fail: Command 'ruby' not found. Set $PATH or specify interpreter_path interpreter_path

After installing that and setting CC=clang as required, I still get

#6 38.12 ERROR: /root/.cache/bazel/_bazel_root/52554737be0413482e9bd72efb59fb14/external/local_config_cc/BUILD:47:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'darwin_arm64'