Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Switch to using target triple like prefix for installed exes#429

Closed
Vexu wants to merge 3 commits intomasterfrom
triple-prefix
Closed

Switch to using target triple like prefix for installed exes#429
Vexu wants to merge 3 commits intomasterfrom
triple-prefix

Conversation

@Vexu
Copy link
Member

@Vexu Vexu commented May 24, 2025

@Vexu Vexu force-pushed the triple-prefix branch from 8715839 to 02c0e91 Compare May 24, 2025 12:59
@phiat
Copy link

phiat commented May 24, 2025

I think this should fix Failed to install Zig 0.14.1: file format not recognised, which just popped up for me after switching to Zig 0.14.1.

Thanks for the quick fix!

@Vexu Vexu requested a review from Techatrix May 24, 2025 16:32
Comment on lines +291 to +298
} else if (name.startsWith(prefixOld)) {
const version = name.substring(prefixOld.length + 1);
await vscode.workspace.fs.rename(
vscode.Uri.joinPath(storageDir, name),
vscode.Uri.joinPath(storageDir, `${prefix}-${version}`),
);
await setLastAccessTime(config, new semver.SemVer(version));
available.push(new semver.SemVer(version));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This converts all installed Zig and ZLS versions from $OS-$Arch-$Version to $Arch-$OS-$Version but this isn't how installGuarded will try to look them up. It still expects the old format for ZLS and older Zig versions.

const fileExtension = isWindows ? "zip" : "tar.xz";
const exeName = config.exeName + (isWindows ? ".exe" : "");
const subDirName = `${getZigOSName()}-${getZigArchName()}-${version.raw}`;
const subDirName = `${getHostZigName()}-${version.raw}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail for older Zig versions like 0.13.0. subDirName is also used to resolve the file name that should be downloaded.

@Techatrix
Copy link
Collaborator

I tried to resolve these issues myself and ended up with #430

@Vexu Vexu closed this May 25, 2025
@Vexu Vexu deleted the triple-prefix branch May 25, 2025 08:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants