Skip to content

Support for Windows #13

@kant2002

Description

@kant2002

In order to install rust-std-hermit on Windows, since it does not have Bash, I have to resort to this dirty script. It absolutely not production ready, but you can call it one time. I don't know yet, if produced binary can be run on Windows under QEMU, but at least it's step in forward direction.

$RUSTC_SYSROOT = $args[0] # sysroot path obtained from rustc
$componentsDirectory = $PSScriptRoot
$componentsDirectory = $args[1] # Directory containing the component to install (usually where rust-install.sh is located)
$componentName = $args[2] # Name of the component to install (e.g., rust-std-x86_64-unknown-hermit)

function Install-RustComponent($component) {
    $sourcePath = Join-Path -Path $componentsDirectory -ChildPath $component
    $manifestFile = Join-Path -Path $sourcePath -ChildPath "manifest.in"
    Copy-Item -Path $manifestFile -Destination "$RUSTC_SYSROOT\lib\rustlib\manifest_$component" -Force
    if (Test-Path $sourcePath) {
        Write-Host "Installing component $component"
        Copy-Item -Path "$sourcePath\lib" -Destination "$RUSTC_SYSROOT\" -Recurse -Force
    } else {
        Write-Host "Component $component not found at $sourcePath"
    }

    Add-Content -Path "$RUSTC_SYSROOT\lib\rustlib\components" -Value "$component"  
}
Install-RustComponent $componentName

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions