Skip to content
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

move toolchain: preserve .exe extension for windows #16218

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

rvantonder
Copy link
Contributor

@rvantonder rvantonder commented Feb 13, 2024

Description

Toolchain versioned builds on windows will use sui.exe and invoke sui.exe rather than just sui so that windows users don't need to strip the .exe extension in order for things to work.

(from #16182 (comment))

Test Plan

👀


If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Copy link

vercel bot commented Feb 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2024 10:23pm
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2024 10:23pm
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2024 10:23pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2024 10:23pm
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2024 10:23pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2024 10:23pm

let platform = detect_platform(&root, compiler_version, &dest_canonical_path)?;
if platform == "windows-x86_64" {
dest_canonical_binary.push(CANONICAL_WIN_BINARY_NAME);
} else {
dest_canonical_binary.push(CANONICAL_UNIX_BINARY_NAME);
}

if !dest_canonical_binary.exists() {
// Check the platform and proceed if we can download a binary. If not, the user should follow error instructions to sideload the binary.
let mut platform = detect_platform(&root, compiler_version, &dest_canonical_binary)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With this change we have to detect_platform before checking if the binary exists.

There's a method here close to the previous check where we can do "does binary exist?" by checking whether either sui or sui.exe exists. But with this PR though, we have to reuse knowledge of the platform to also invoke either sui or sui.exe depending on the platform. So I think it's more natural to get the platform and have the logic case out on that, than guess and persist sui vs sui.exe

Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

👍

@rvantonder rvantonder merged commit 6af96d1 into main Feb 15, 2024
41 checks passed
@rvantonder rvantonder deleted the rvt/win-exe branch February 15, 2024 00:50
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.

2 participants