-
Notifications
You must be signed in to change notification settings - Fork 277
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
Cross-compile with Scala Native #4279
Conversation
@@ -0,0 +1,3 @@ | |||
apt-get install -y clang-12.0 | |||
PATH=/usr/lib/llvm-12.0/bin:${PATH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is needed? I never had to install clang for native, I think it's included in the images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's a leftover from the previous iteration, I wonder if I even needed it then? Removing now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe at some point?
@@ -0,0 +1,12 @@ | |||
package org.scalafmt.cli.difflib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
difflib is now published as munit-diff
so you can use that
e27b6ad
to
03b20b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a huge change, thank you for this. however, i have to admit that i lost track of all the changes halfway through.
here my request: split into separate prs:
- pure renames (code, tests, etc)
- refactoring of jvm code which might need to have a custom implementation in native later
- removing things like difflib, or adding fastparse (still haven't figured out why)
- adding native at the end
looking at srcLine, I'm afraid there was some manual typing, rather than copy-paste, I'd strongly advise against that, as I can't eyeball everything
.github/workflows/ci.yml
Outdated
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: olafurpg/setup-scala@v13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still used? i thought we replaced with setup-java a while ago...
.github/workflows/ci.yml
Outdated
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macOS-latest, ubuntu-latest] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you check for windows-latest below but it's not here...
.github/workflows/ci.yml
Outdated
run: ./bin/scala-native-setup/windows-setup.sh | ||
- if: matrix.os == 'macOS-latest' | ||
name: setup macOS environment | ||
run: ./bin/scala-native-setup/macos-setup.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to implement just one script, say, platform-setup.sh, and in that determine whether we are in Linux, macos or windows, so that we don't need to have this complexity here? after all, someone might want to run stuff from the command line, without GitHub actions
@@ -0,0 +1,3 @@ | |||
apt-get install -y clang-12.0 | |||
PATH=/usr/lib/llvm-12.0/bin:${PATH} | |||
clang --version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing newline
@@ -0,0 +1,3 @@ | |||
apt-get install -y clang-12.0 | |||
PATH=/usr/lib/llvm-12.0/bin:${PATH} | |||
clang --version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing newline... could you please check other files as well?
@@ -457,7 +450,7 @@ object State { | |||
adjustMargin: Int => Int, | |||
firstLength: Int, | |||
): (Int, Int) = { | |||
val matcher = getStripMarginPattern(pipe).matcher(syntax) | |||
val matcher = getStripMarginPatternWithLineContent(pipe).matcher(syntax) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you need to add WithLineContent?
@@ -0,0 +1,9 @@ | |||
package org.scalafmt.interfaces; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
semicolon?
@@ -1,6 +1,6 @@ | |||
package org.scalafmt | |||
|
|||
import org.scalafmt.CompatCollections.ParConverters._ | |||
import org.scalafmt.CompatCollections.CompatParConverters._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is needed. we have our own package already, why not define everything there?
@@ -0,0 +1,8 @@ | |||
binPack.literalArgumentLists = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a new test?
@@ -314,6 +330,7 @@ trait CliTestBehavior { | |||
} | |||
|
|||
test(s"scalafmt (no matching files) is okay with --mode diff and --stdin: $label") { | |||
assumeNotDynamicOnNative() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not create a method which wraps test() and calls this method before the rest of the body?
also, please add macros separately. i don't know why, but I didn't see them at all, they somehow got lost in the sea of changes. |
2a9bd3a
to
5d96b36
Compare
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github is complaining:
[Error](https://github.com/scalameta/scalafmt/actions/runs/10925443463/workflow)
a step cannot have both the `uses` and `run` keys
5d96b36
to
f99af17
Compare
Co-authored-by: Tomasz Godzik <tgodzik@users.noreply.github.com>
f99af17
to
3cd6da4
Compare
Merged via related PRs |
I intend to split this into smaller PR's starting with the macro replacing java reflection. This PR is only meant to showcase the larger picture of the changes and probably will not be merged (although finished and, as of writing, up to date). Nevertheless it would be very helpful to me to see if the CI is able to pass here.