This adds support for Windows.
The in-language path separator is still /, to ensure Pkl programs are cross-platform.
The specifics behind this design are detailed in https://github.com/apple/pkl-evolution/pull/7.
Log lines are written using CRLF endings on Windows.
Modules that are combined with --module-output-separator uses LF endings to ensure
consistent rendering across platforms.
jpkl does not work on Windows as a direct executable.
However, it can work with java -jar jpkl.
Additional details:
Adjust git settings for Windows
Add native executable for pkl cli
Add jdk17 windows Gradle check in CI
Adjust CI test reports to be staged within Gradle rather than by shell script.
Fix: encode more characters that are not safe Windows paths
Skip running tests involving symbolic links on Windows (these require administrator privileges to run).
Introduce custom implementation of IoUtils.relativize, because the current implementation delegates to Path, which will fail if the URI contains invalid Windows characters.
Allow Gradle to initialize ExecutableJar Property values
Add a way to enable remote debugging with ./gradlew test commands
Standard library pkl:platform's current.operatingSystem.name is "Windows" for all Windows OSes (match treatment of macOS/Linux).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/492
**Author:** [@bioball](https://github.com/bioball)
**Created:** 5/14/2024
**Status:** ✅ Merged
**Merged:** 5/29/2024
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `windows-build`
---
### 📝 Commits (10+)
- [`b3a72b7`](https://github.com/apple/pkl/commit/b3a72b768b45c28410cedf493710f66d364bc3cc) Add support for Windows
- [`8bd47c0`](https://github.com/apple/pkl/commit/8bd47c02e8cfb953a43bedf8644ca03cde651c7d) Run spotlessApply
- [`75102b9`](https://github.com/apple/pkl/commit/75102b91af9a842d576a4e7a95c08120743b8ba4) Fix parsing module names of windows absolute paths
- [`9c23fff`](https://github.com/apple/pkl/commit/9c23fff943a7592695bf52c516ae2800b5b26053) Fix encoding and triple-slash paths
- [`317ccfe`](https://github.com/apple/pkl/commit/317ccfecedc6ca3a9d72ea9d56010ae38acadcaa) Fix remaining build errors
- [`e1e6793`](https://github.com/apple/pkl/commit/e1e6793250c56b3800bd21c43168c8cd817156e8) Adjust note about jvm debugging
- [`78b73f6`](https://github.com/apple/pkl/commit/78b73f6785f0453cc3099a239dbb7818882b7d64) Docs adjustments
- [`4627c30`](https://github.com/apple/pkl/commit/4627c30920372d17a21000a16451fed3c7a8eb48) Adjustments from code review, set platform to Windows
- [`ea8aa46`](https://github.com/apple/pkl/commit/ea8aa461ba76bf7759b30319f49451d66d4f6628) Set union type on pkl.platform#OperatingSystem.name
- [`70e0216`](https://github.com/apple/pkl/commit/70e02167971252c22826b8eb5ae060d0b33b97fa) Apply suggestions from code review
### 📊 Changes
**76 files changed** (+903 additions, -400 deletions)
<details>
<summary>View changed files</summary>
📝 `.circleci/config.pkl` (+11 -1)
📝 `.circleci/config.yml` (+92 -112)
📝 `.circleci/jobs/BuildNativeJob.pkl` (+14 -6)
📝 `.circleci/jobs/DeployJob.pkl` (+3 -1)
📝 `.circleci/jobs/GradleCheckJob.pkl` (+15 -5)
📝 `.circleci/jobs/GradleJob.pkl` (+5 -10)
📝 `.circleci/jobs/SimpleGradleJob.pkl` (+3 -1)
📝 `.gitattributes` (+1 -0)
📝 `DEVELOPMENT.adoc` (+8 -0)
📝 `buildSrc/src/main/kotlin/BuildInfo.kt` (+11 -4)
📝 `buildSrc/src/main/kotlin/ExecutableJar.kt` (+6 -8)
📝 `buildSrc/src/main/kotlin/pklAllProjects.gradle.kts` (+25 -0)
📝 `buildSrc/src/main/kotlin/pklGraalVm.gradle.kts` (+12 -8)
📝 `docs/modules/language-reference/pages/index.adoc` (+11 -2)
📝 `docs/modules/pkl-cli/pages/index.adoc` (+26 -25)
📝 `gradle/libs.versions.toml` (+1 -0)
📝 `pkl-cli/pkl-cli.gradle.kts` (+42 -7)
📝 `pkl-cli/src/main/kotlin/org/pkl/cli/CliEvaluator.kt` (+17 -3)
📝 `pkl-cli/src/main/kotlin/org/pkl/cli/CliPackageDownloader.kt` (+5 -1)
📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/TestCommand.kt` (+2 -1)
_...and 56 more files_
</details>
### 📄 Description
Closes https://github.com/apple/pkl/issues/20
This adds support for Windows.
The in-language path separator is still `/`, to ensure Pkl programs are cross-platform.
The specifics behind this design are detailed in https://github.com/apple/pkl-evolution/pull/7.
Log lines are written using CRLF endings on Windows.
Modules that are combined with `--module-output-separator` uses LF endings to ensure
consistent rendering across platforms.
`jpkl` does not work on Windows as a direct executable.
However, it can work with `java -jar jpkl`.
Additional details:
* Adjust git settings for Windows
* Add native executable for pkl cli
* Add jdk17 windows Gradle check in CI
* Adjust CI test reports to be staged within Gradle rather than by shell script.
* Fix: encode more characters that are not safe Windows paths
* Skip running tests involving symbolic links on Windows (these require administrator privileges to run).
* Introduce custom implementation of `IoUtils.relativize`, because the current implementation delegates to `Path`, which will fail if the URI contains invalid Windows characters.
* Allow Gradle to initialize ExecutableJar `Property` values
* Add a way to enable remote debugging with `./gradlew test` commands
* Standard library `pkl:platform`'s `current.operatingSystem.name` is `"Windows"` for all Windows OSes (match treatment of macOS/Linux).
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/492
Author: @bioball
Created: 5/14/2024
Status: ✅ Merged
Merged: 5/29/2024
Merged by: @bioball
Base:
main← Head:windows-build📝 Commits (10+)
b3a72b7Add support for Windows8bd47c0Run spotlessApply75102b9Fix parsing module names of windows absolute paths9c23fffFix encoding and triple-slash paths317ccfeFix remaining build errorse1e6793Adjust note about jvm debugging78b73f6Docs adjustments4627c30Adjustments from code review, set platform to Windowsea8aa46Set union type on pkl.platform#OperatingSystem.name70e0216Apply suggestions from code review📊 Changes
76 files changed (+903 additions, -400 deletions)
View changed files
📝
.circleci/config.pkl(+11 -1)📝
.circleci/config.yml(+92 -112)📝
.circleci/jobs/BuildNativeJob.pkl(+14 -6)📝
.circleci/jobs/DeployJob.pkl(+3 -1)📝
.circleci/jobs/GradleCheckJob.pkl(+15 -5)📝
.circleci/jobs/GradleJob.pkl(+5 -10)📝
.circleci/jobs/SimpleGradleJob.pkl(+3 -1)📝
.gitattributes(+1 -0)📝
DEVELOPMENT.adoc(+8 -0)📝
buildSrc/src/main/kotlin/BuildInfo.kt(+11 -4)📝
buildSrc/src/main/kotlin/ExecutableJar.kt(+6 -8)📝
buildSrc/src/main/kotlin/pklAllProjects.gradle.kts(+25 -0)📝
buildSrc/src/main/kotlin/pklGraalVm.gradle.kts(+12 -8)📝
docs/modules/language-reference/pages/index.adoc(+11 -2)📝
docs/modules/pkl-cli/pages/index.adoc(+26 -25)📝
gradle/libs.versions.toml(+1 -0)📝
pkl-cli/pkl-cli.gradle.kts(+42 -7)📝
pkl-cli/src/main/kotlin/org/pkl/cli/CliEvaluator.kt(+17 -3)📝
pkl-cli/src/main/kotlin/org/pkl/cli/CliPackageDownloader.kt(+5 -1)📝
pkl-cli/src/main/kotlin/org/pkl/cli/commands/TestCommand.kt(+2 -1)...and 56 more files
📄 Description
Closes https://github.com/apple/pkl/issues/20
This adds support for Windows.
The in-language path separator is still
/, to ensure Pkl programs are cross-platform.The specifics behind this design are detailed in https://github.com/apple/pkl-evolution/pull/7.
Log lines are written using CRLF endings on Windows.
Modules that are combined with
--module-output-separatoruses LF endings to ensureconsistent rendering across platforms.
jpkldoes not work on Windows as a direct executable.However, it can work with
java -jar jpkl.Additional details:
IoUtils.relativize, because the current implementation delegates toPath, which will fail if the URI contains invalid Windows characters.Propertyvalues./gradlew testcommandspkl:platform'scurrent.operatingSystem.nameis"Windows"for all Windows OSes (match treatment of macOS/Linux).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.