8000 Remove the `examples` directory to fix `scala-steward` runs by Gedochao · Pull Request #2067 · VirtusLab/scala-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove the examples directory to fix scala-steward runs #2067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2023

Conversation

Gedochao
Copy link
Contributor
@Gedochao Gedochao commented Apr 28, 2023

This should fix the scala-steward failures on our repo.

2023-04-28 00:42:12,225 ERROR Steward VirtusLab/scala-cli failed
org.scalasteward.core.io.process$ProcessFailedException: 'scala-cli --power export --sbt --output tmp-sbt-build-for-scala-steward /opt/workspace/repos/VirtusLab/scala-cli' exited with code 1.
The 'export' sub-command is experimental.
Please bear in mind that non-ideal user experience should be expected.
If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
Exporting to a sbt project...
[error] ./examples/cross-build/Hello.js.scala:2:19
[error] Unrecognized directive: target with values: scala-js
[error] //> using target "scala-js"
[error]                   ^^^^^^^^
[error] ./examples/cross-build/Hello.native.scala:2:19
[error] Unrecognized directive: target with values: scala-native
[error] //> using target "scala-native"
[error]                   ^^^^^^^^^^^^

	at org.scalasteward.core.io.process$.$anonfun$slurp$7(process.scala:75)
	at org.scalasteward.core.io.process$.$anonfun$slurp$7$adapted(process.scala:69)
	at flatMap @ org.scalasteward.core.io.process$.$anonfun$slurp$5(process.scala:69)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at modify @ fs2.internal.Scope.close(Scope.scala:262)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at rethrow$extension @ fs2.Compiler$Target.$anonfun$compile$1(Compiler.scala:157)
	at as @ org.scalasteward.core.io.process$.$anonfun$readLinesIntoBuffer$1(process.scala:123)
	at get @ fs2.internal.Scope.openScope(Scope.scala:281)
	at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
	at flatMap @ fs2.Pull$.$anonfun$compile$21(Pull.scala:1214)
	at update @ fs2.internal.Scope.releaseChildScope(Scope.scala:224)

I removed the examples directory, since almost all of the examples there are included somewhere in the docs (or have tickets to be documented, like JMH).
scala-steward assumes that since we have using directives in our repo, scala-cli is one of the used build tools and wants the SBT export to pass (however nonsensical such an export would be).
In other words, scala-steward expects the following to pass:

scala-cli --power export --sbt .

Removing the examples directory seemingly fixes that.
I added a job on the CI to verify that passes on subsequent PRs.
We can remove it once scala-steward starts resolving stuff in a saner way.

@Gedochao Gedochao added the bug Something isn't working label Apr 28, 2023
@Gedochao Gedochao requested review from tgodzik and lwronski April 28, 2023 11:16
@Gedochao Gedochao force-pushed the fix-scala-steward branch from a7a913a to 377b0d4 Compare April 28, 2023 11:31
@Gedochao Gedochao marked this pull request as ready for review April 28, 2023 11:54
@Gedochao
Copy link
Contributor Author

I also bumped scala-cli-setup to v1.0.0-RC1.
That version deprecates ammonite imports, so it's important for scala-cli --power export --sbt . not to fail on build.sc, apparently.

it's also a bump we seem to have missed because scala-steward hasn't been running properly for us 🤦‍♂️

@Gedochao Gedochao force-pushed the fix-scala-steward branch from 377b0d4 to 802066e Compare April 28, 2023 12:30
Copy link
@ankit-gautam23 ankit-gautam23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gedochao Gedochao merged commit bf5103d into VirtusLab:main May 4, 2023
@Gedochao Gedochao deleted the fix-scala-steward branch May 4, 2023 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0