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

feat(install): Add support for ARM64 architecture #5154

Merged
merged 8 commits into from Sep 27, 2022
Merged

Conversation

rashil2000
Copy link
Member

@rashil2000 rashil2000 commented Sep 17, 2022

Description

Enables installing ARMv8 apps

Motivation and Context

Closes #3146

Supercedes #4071

How Has This Been Tested?

image

First fzf is from main bucket. Second fzf is a modified version, as follows:

{
    "version": "0.33.0",
    "description": "A general-purpose command-line fuzzy finder",
    "homepage": "https://github.com/junegunn/fzf",
    "license": "MIT",
    "architecture": {
        "64bit": {
            "url": "https://github.com/junegunn/fzf/releases/download/0.33.0/fzf-0.33.0-windows_amd64.zip",
            "hash": "f2ddd0ce44f2ebd52009c0f36d99270d711234a605529e01fd97fef87223fd1e"
        },
        "arm64": {
            "url": "https://github.com/junegunn/fzf/releases/download/0.33.0/fzf-0.33.0-windows_arm64.zip",
            "hash": "ff222c81fda88f42b6893216c4a63b733680741d439fb9a67ac2d1a00ab03065"
        }
    },
    "bin": "fzf.exe",
    "checkver": "github",
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://github.com/junegunn/fzf/releases/download/$version/fzf-$version-windows_amd64.zip"
            },
            "arm64": {
                "url": "https://github.com/junegunn/fzf/releases/download/$version/fzf-$version-windows_arm64.zip"
            }
        }
    }
}

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

@rashil2000
Copy link
Member Author

rashil2000 commented Sep 17, 2022

Stuff remaining:

  • Add fallback for arm64 to first 64bit, then 32bit
  • Modify Get-UserAgent in core.ps1 accordingly. I'm not really sure what should go here. Are there any servers that even check for ARM Windows agents? 😅

Food for thought: Should we compile and add different shim binaries for different architectures? That is, shim.64bit.exe, shim.32bit.exe and shim.arm64.exe.

@rashil2000
Copy link
Member Author

rashil2000 commented Sep 17, 2022

7zip ships an MSI installer for x86 and x64 archs, but only a self-extracting executable for ARM64. We would need to request ipavlov to provide an MSI installer which Scoop can use in the 7zip manifest. See https://sourceforge.net/p/sevenzip/support-requests/431.

@rashil2000 rashil2000 changed the title feat: Initial support for ARMv8 feat(install): Add support for ARM64 architecture Sep 17, 2022
@niheaven
Copy link
Member

Make some changes:

  • Use ${env:ProgramFiles(Arm)} to detect ARM64
  • Move default_architecture() to core.ps1
  • Rename default_architecture() to Get-DefaultArchitecture()
  • Rename ensure_architecture() to Format-ArchitectureString()
  • Refactor supports_architecture() to Get-SupportedArchitecture()
  • Add corresponding tests

Testing manifests are pushed to Tests bucket. (7zip and winget)

@niheaven
Copy link
Member

@rashil2000 I've test it and LGTM, any comments?

@rashil2000 rashil2000 merged commit 7a599f0 into develop Sep 27, 2022
@rashil2000 rashil2000 deleted the rashil2000-arm branch September 27, 2022 22:49
pynappo pushed a commit to pynappo/Scoop that referenced this pull request Sep 29, 2022
* Initial support for ARMv8

* Add fallback mechanism

* Update changelog

* Update useragent

* Some typo and format changes

* Use `env:ProgramFiles(Arm)` to detect ARM64

- Move `default_architecture()` to `core.ps1`

* Rename 'ensure_architecture()' and 'default_architecture()'

* Refactor 'supports_architecture()' to 'Get-SupportedArchitecture()'

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
@@ -1240,5 +1263,8 @@ $globaldir = $env:SCOOP_GLOBAL, (get_config GLOBAL_PATH), "$env:ProgramData\scoo
# Use at your own risk.
$cachedir = $env:SCOOP_CACHE, (get_config CACHE_PATH), "$scoopdir\cache" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1

# OS information
$WindowsBuild = [System.Environment]::OSVersion.Version.Build
Copy link
Member

Choose a reason for hiding this comment

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

A bit late, but why has this to be a global variable?

Copy link
Member

Choose a reason for hiding this comment

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

Aha, since there're some apps that have minimal Windows version requirement, I've planned to add a manifest field that shows minimal Windows version, and use this variable to check it.

But, this is not implemented now...

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.

None yet

3 participants