Skip to content
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

update mill.bat to handle -native extension #4290

Merged
merged 8 commits into from
Jan 12, 2025

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Jan 11, 2025

No description provided.

@lihaoyi
Copy link
Member Author

lihaoyi commented Jan 11, 2025

The download logic and url/path mangling logic seems to work, but I can't test the executable since my windows laptop is on ARM. @ayewo maybe you could give this a try and see if it works for you (as long as you have an x64 windows machine)?

@ayewo
Copy link
Contributor

ayewo commented Jan 11, 2025

@lihaoyi sure will test it on Windows today. I'm currently AFK.

@lihaoyi lihaoyi marked this pull request as ready for review January 11, 2025 13:24
@lihaoyi
Copy link
Member Author

lihaoyi commented Jan 11, 2025

CI is mostly green, which indicates that this does work at least on GHA, and I did a control experiment in 6f11357 to make sure we are exercising the new code path. But would still be good to test out on an actual person's machine

@lihaoyi
Copy link
Member Author

lihaoyi commented Jan 11, 2025

Should just need to copy the mill.bat file and update the version to 0.12.5-68-e4bf78-native

@ayewo
Copy link
Contributor

ayewo commented Jan 11, 2025

@lihaoyi

I tested it on 64-bit Windows (Windows 10 Pro) and it worked 🚀!


  1. I first attempted to install the non-native build of mill by following1 the docs using a command prompt:

    curl -L https://github.com/com-lihaoyi/mill/releases/download/0.12.5/0.12.5.bat -o mill.bat
    
    echo 0.12.5 > .mill-version
    
    .\mill --version
    Downloading mill 0.12.5  from https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/0.12.5 /mill-dist-0.12.5 .jar ...
    curl: (3) URL rejected: Malformed input to a URL function
    Could not download mill 0.12.5

    It failed because echo 0.12.5 > .mill-version added a trailing space at the end of 0.12.5 .

    The correct command on Windows should be:

    echo 0.12.5>.mill-version
  2. After fixing .mill-version, I ran.\mill --version which downloaded mill correctly but it failed because I didn't have any JDK installed yet:

    .\mill --version
    '"java.exe"' is not recognized as an internal or external command,
    operable program or batch file.

    So I installed the Microsoft Build of OpenJDK for Windows and tried again:

    .\mill --version
    Mill Build Tool version 0.12.5
    Java version: 11.0.25, vendor: Microsoft, runtime: C:\Microsoft\jdk-11.0.25.9-hotspot
    Default locale: en_US, platform encoding: Cp1252
    OS name: "Windows 10", version: 10.0, arch: amd64
  3. Next, I removed .mill-version, mill.bat and C:\Users\dev\.mill so I could install mill-native from your PR:

    curl -L https://github.com/com-lihaoyi/mill/raw/1e4371a378628074adbaa9e1d1d7c58ca391cffb/mill.bat -o mill.bat
    
    echo 0.12.5-68-e4bf78-native>.mill-version
    
    .\mill --version
    
    Downloading mill 0.12.5-68-e4bf78 from https://repo1.maven.org/maven2/com/lihaoyi/mill-dist-native-windows-amd64/0.12.5-68-e4bf78/mill-dist-native-windows-amd64-0.12.5-68-e4bf78.jar ...
    ...
            1 file(s) moved.
    Mill Build Tool version 0.12.5-68-e4bf78
    Java version: 11.0.25, vendor: Microsoft, runtime: C:\Microsoft\jdk-11.0.25.9-hotspot
    Default locale: en_US, platform encoding: Cp1252
    OS name: "Windows 10", version: 10.0, arch: amd64

Footnotes

  1. I visited https://mill-build.org/mill/index.html and it took me more than a minute to find information on how to install Mill on Windows. There's not a single call-to-action on the homepage that hits you on the head on how to download or install Mill. I then remembered that I had actually raised this before.

@lihaoyi lihaoyi merged commit 0a63cf7 into com-lihaoyi:main Jan 12, 2025
27 checks passed
@lefou lefou added this to the 0.12.6 milestone Jan 12, 2025
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