Skip to content

Commit

Permalink
Fix AssemblyTests on Windows (#3288)
Browse files Browse the repository at this point in the history
Windows has an env var called `PATHEXT` which is usually something like
this: `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC`
Basically a list of extensions considered as executable.  
So the file in Mill's case needs to be a `.bat` file.

Issue analyzed and fixed by @sake92 

Fix #3283

Pull request: #3288
---------

Co-authored-by: Sakib Hadziavdic <sakib@sake.ba>
  • Loading branch information
lefou and sake92 committed Jul 24, 2024
1 parent 79db2f2 commit c74a3fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .config/mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.7-17-17dea9
0.11.8
10 changes: 9 additions & 1 deletion scalalib/test/src/mill/scalalib/AssemblyTests.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mill.scalalib

import scala.util.Properties
import mill._
import mill.api.Result
import mill.eval.Evaluator
Expand Down Expand Up @@ -125,7 +126,14 @@ object AssemblyTests extends TestSuite {
test("small") {
workspaceTest(TestCase) { eval =>
val Right((res, _)) = eval(TestCase.exe.small.assembly)
runAssembly(res.path, TestCase.millSourcePath, checkExe = true)
val originalPath = res.path
val resolvedPath =
if (Properties.isWin) {
val winPath = originalPath / os.up / s"${originalPath.last}.bat"
os.copy(originalPath, winPath)
winPath
} else originalPath
runAssembly(resolvedPath, TestCase.millSourcePath, checkExe = true)
}
}
test("large-should-fail") {
Expand Down

0 comments on commit c74a3fa

Please sign in to comment.