Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ jobs:
- os: macos-13
swift: 'latest'
development: false
- os: windows-latest
swift: '5.9'
development: false
- os: ubuntu-latest
swift: '5.3.0'
development: false
Expand Down
15 changes: 10 additions & 5 deletions src/installer/windows/installation/approach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@ export async function firstDirectoryLayout(root?: string) {
await fs.access(toolchain)
const winsdk = path.join('Developer', 'SDKs', 'Windows.sdk')
const sdkroot = path.join(devdir, 'Platforms', 'Windows.platform', winsdk)
const runtime = path.join(location, 'Swift', 'runtime-development')
const runtimeRoot = path.join(location, 'Swift')
const runtime = path.join(runtimeRoot, 'runtime-development')
const devPath = path.join(systemDrive, 'Program Files', 'Swift')
try {
await fs.access(devPath)
await fs.cp(devPath, runtimeRoot, {recursive: true})
} catch (error) {
core.debug(`Runtime check failed with "${error}"`)
}
core.debug('First installation approach succeeded')
return new Installation(location, toolchain, sdkroot, runtime, devdir)
}

export async function secondDirectoryLayout(root?: string) {
core.debug('Trying secong installation approach')
core.debug('Trying second installation approach')
const systemDrive = root ?? process.env.SystemDrive ?? 'C:'
const location = path.join(systemDrive, 'Program Files', 'Swift')
const toolchainName = '0.0.0+Asserts'
Expand All @@ -28,9 +36,6 @@ export async function secondDirectoryLayout(root?: string) {
const winsdk = path.join('Developer', 'SDKs', 'Windows.sdk')
const sdkroot = path.join(location, 'Platforms', 'Windows.platform', winsdk)
const runtime = path.join(location, 'Runtimes', '0.0.0')
const runtimeRoot = path.join(location, 'Swift')
const devPath = path.join(systemDrive, 'Program Files', 'Swift')
await fs.cp(devPath, runtimeRoot, {recursive: true})
core.debug('Second installation approach succeeded')
return new Installation(location, toolchain, sdkroot, runtime)
}
2 changes: 1 addition & 1 deletion src/installer/windows/installation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Installation.get = async (install?: string) => {
core.debug(`Development directory at "${installation.devdir}"`)
return installation
} catch (error) {
core.debug(`Failed ${counter} time(s)`)
core.debug(`Failed ${counter} time(s), recent error "${error}"`)
}
}
return undefined
Expand Down
Loading