Skip to content

Make tests pass on Windows #1529

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
Dec 19, 2023
Merged

Conversation

crt-31
Copy link
Contributor

@crt-31 crt-31 commented Nov 30, 2023

Description

Bunch of changes. Here's some highlights:

Code Changes

  • added lineEndings=preserve to scalafmt.conf
  • added .bazelrc to enable needed flags for Windows
  • Refactored dependency-analyzer plugin's javaargs to use ‘;’ as a delimiter instead of ‘:’. (This made things simpler and easier since ':' as drive separator on windows and ':' is normal in a Bazel label.)
  • Refactored ScalacWorker to abstract common code between Scala 2 & 3. (This consolidates some duplicated code that needed to be changed).
  • Renamed a couple function names containing rpathlocation to rlocationpath

Test Changes

  • disable running tests for features not-supported on Windows
  • make tests handle fact that sh_binary outputs .exe on Windows
  • Handle other Windows specifics where needed (i.e. backslash as pathseparator, crlf linendings, dependence on bash)

Other notes:

  • It expects git's core.autocrlf=true on windows.

Motivation

Keeping the tests working on Windows greatly helps ensure continuous compatibility with Windows OS.

Bunch of changes. Here's some highlights:

Code Changes
- Refactored ScalacWorker to abstract common code between Scala 2 & 3
- Refactored dependency-analyzer plugin javaargs to use ‘;’ as a delimiter instead of ‘:’
- Renamed a couple function names containing rpathlocation to rlocationpath
- added lineEndings=preserve to scalafmt.conf
- added .bazelrc to enable needed flags for Windows

Test Changes
- disable running tests for features not-supported on Windows
- make tests handle fact that sh_binary outputs .exe on Windows
- Handle other Windows specifics where needed (i.e. backslash as pathseparator, crlf linendings, dependence on bash)
@@ -0,0 +1 @@
build --enable_runfiles
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can --enable_runfiles be put under windows config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

}

@annotation.tailrec
def tokenize(tokens:List[String], targetsStr:String, currTokenStartIdx:Int, currIdx:Int, isEscaped:Boolean) : List[String] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: return type probably can be Seq[String]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

bazel build //...
)
echo dude
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

haha...
Done.

@simuons simuons merged commit eac6f06 into bazel-contrib:master Dec 19, 2023
@crt-31 crt-31 mentioned this pull request Jan 13, 2024
@crt-31 crt-31 mentioned this pull request Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants