Skip to content

fix(build): use invariantSeparatorsPath for PROJECT_DIR to ensure cross-platform consistency#4310

Merged
landonxjames merged 4 commits intosmithy-lang:mainfrom
PeterUlb:main
Sep 18, 2025
Merged

fix(build): use invariantSeparatorsPath for PROJECT_DIR to ensure cross-platform consistency#4310
landonxjames merged 4 commits intosmithy-lang:mainfrom
PeterUlb:main

Conversation

@PeterUlb
Copy link
Contributor

Motivation and Context

On windows, the task :smithy-rs:codegen-core:compileKotlin fails:

> Task :smithy-rs:codegen-core:compileKotlin FAILED
e: file:///C:/Users/.../.../smithy/smithy-rs/codegen-core/build/generated/src/main/kotlin/BuildEnvironment.kt:6:40 Unsupported escape sequence.

This means I cannot run the task to generate the server sdk crate on windows (smithyBuild)

Example generated file:

object BuildEnvironment {
    const val MSRV: String = "1.86.0"
    const val PROJECT_DIR: String = "C:\Users\...\smithy\smithy-rs"
}

Description

Using invariantSeparatorsPath to use the invariant separator '/' to separate the names in the name sequence. The forward slashes as seperator still work on windows.

Testing

Executed task on windows and inspected BuildEnvironment.kt files. Now has forward slashes.

object BuildEnvironment {
    const val MSRV: String = "1.86.0"
    const val PROJECT_DIR: String = "C:/Users/.../smithy/smithy-rs"
}

Checklist

Not applicable


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@PeterUlb PeterUlb requested review from a team as code owners September 17, 2025 19:39
@landonxjames landonxjames merged commit b42f118 into smithy-lang:main Sep 18, 2025
44 of 45 checks passed
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