-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
"failed to build archive" with ImDisk ram disk #90780
Comments
I have transferred this to rust-lang/rust, as this error is being generated by rustc when generating the archive. |
ImDisk ram disks cause a lot of problems because they don't implement essential kernel interfaces. Usually it's |
On further investigation this does seem to be an LLVM issue. The "function not supported" error seems to be what LLVM maps |
To ask the obvious: since people keep stumbling over this every now and then, has anyone reported the issue to ImDisk? |
It seems like a fundamental issue that they're aware of https://www.ltr-data.se/opencode.html/#ImDisk
Other than the aforementioned Arsenal Image Mounter there's also free (as in price) software such as Radeon Ramdisk or Ultra RAMDisk lite. However, ImDisk has the name recognition so I suspect we'll continue seeing these issues crop up. |
Thanks to the above comment, I was able to find a solution to these problems. Edit: I created a repo with all the steps to do what I said below. Recommend to check the repo for the most recent updates to the script Download and install the driver for arsenal image mounter, then go to this page and download aim_ll.zip, then you can create a volume (as a startup script task scheduler) like so %~dp0\aim_ll -a -t vm -s 3G -p "/fs:ntfs /v:RamDisk /q /y" -o rw,fix,hd -m R: See the cmdline details for more info, but with This does work with cargo, cause I just tested it! As a bonus, I'll also include a custom powershell proxy script I made which redirects all cargo builds to the temp folder automatically (what you do is, set your temp folder env var to your ramdrive). It changes Also has some powershell commands:
Powershell scriptfunction _Get-FNVHash {
param(
[string]$InputString
)
# Initial prime and offset chosen for 32-bit output
# See https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function
[uint32]$FNVPrime = 16777619
[uint32]$offset = 2166136261
# Convert string to byte array, may want to change based on input collation
$bytes = [System.Text.Encoding]::UTF8.GetBytes($InputString)
# Copy offset as initial hash value
[uint32]$hash = $offset
foreach($octet in $bytes)
{
# Apply XOR, multiply by prime and mod with max output size
$hash = $hash -bxor $octet
$hash = $hash * $FNVPrime % [System.Math]::Pow(2,32)
}
return $hash
}
$rustBaseDir = "$env:TMP\rust"
function _Get-RustTmpDir {
return "$rustBaseDir\$(Split-Path (Get-Location) -Leaf)-$(_Get-FNVHash (Get-Location))"
}
function Set-Location {
[CmdletBinding(DefaultParameterSetName='Path', HelpUri='https://go.microsoft.com/fwlink/?LinkID=2097049')]
param(
[Parameter(ParameterSetName='Path', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
[string]
${Path},
[Parameter(ParameterSetName='LiteralPath', Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[Alias('PSPath','LP')]
[string]
${LiteralPath},
[switch]
${PassThru},
[Parameter(ParameterSetName='Stack', ValueFromPipelineByPropertyName=$true)]
[string]
${StackName})
dynamicparam
{
try {
$targetCmd = $ExecutionContext.InvokeCommand.GetCommand('Microsoft.PowerShell.Management\Set-Location', [System.Management.Automation.CommandTypes]::Cmdlet, $PSBoundParameters)
$dynamicParams = @($targetCmd.Parameters.GetEnumerator() | Microsoft.PowerShell.Core\Where-Object { $_.Value.IsDynamic })
if ($dynamicParams.Length -gt 0)
{
$paramDictionary = [Management.Automation.RuntimeDefinedParameterDictionary]::new()
foreach ($param in $dynamicParams)
{
$param = $param.Value
if(-not $MyInvocation.MyCommand.Parameters.ContainsKey($param.Name))
{
$dynParam = [Management.Automation.RuntimeDefinedParameter]::new($param.Name, $param.ParameterType, $param.Attributes)
$paramDictionary.Add($param.Name, $dynParam)
}
}
return $paramDictionary
}
} catch {
throw
}
}
begin
{
try {
$outBuffer = $null
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))
{
$PSBoundParameters['OutBuffer'] = 1
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Microsoft.PowerShell.Management\Set-Location', [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
$steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
throw
}
}
process
{
try {
$steppablePipeline.Process($_)
} catch {
throw
}
}
end
{
try {
$steppablePipeline.End()
$env:CARGO_BUILD_TARGET_DIR = _Get-RustTmpDir
} catch {
throw
}
}
<#
.ForwardHelpTargetName Microsoft.PowerShell.Management\Set-Location
.ForwardHelpCategory Cmdlet
#>
}
function Rust-TargetDir {
$location = $env:CARGO_BUILD_TARGET_DIR
if (Test-Path -Path $location) {
explorer $location
} else {
Write-Host "No Rust target folder exists for this directory"
}
}
function _Clean-Rust {
param(
[string]$location
)
if (Test-Path -Path $location) {
Remove-Item $location -Recurse -Force
Write-Host "Cleaned out temp rust folder: $location"
} else {
Write-Host "Temp Rust folder already clean"
}
}
function Clean-RustDir {
_Clean-Rust "$env:CARGO_BUILD_TARGET_DIR\*"
}
function Clean-Rust {
_Clean-Rust "$rustBaseDir\*"
}
# Set the initial value
$env:CARGO_BUILD_TARGET_DIR = _Get-RustTmpDir To install it, create |
Triage: Closing as duplicate of #48249 since the root cause is the same. |
Problem
Cargo fails to compile on ImDisk ram disk
Steps
Possible Solution(s)
No response
Notes
The resulting log of cargo will look like:
Version
The text was updated successfully, but these errors were encountered: