Skip to content

refactor: add Windows ARM and macOS binaries, use a single Package class, deduplicate some common install code#403

Open
crueter wants to merge 16 commits intohendrikmuhs:mainfrom
crueter:master
Open

refactor: add Windows ARM and macOS binaries, use a single Package class, deduplicate some common install code#403
crueter wants to merge 16 commits intohendrikmuhs:mainfrom
crueter:master

Conversation

@crueter
Copy link

@crueter crueter commented Jan 5, 2026

Defines a Package class that takes in platform, version, arch, variant, and sha256. This class primarily has utility functions and is exposed as a singular install function that the runInner calls. Automatically handles package managers too, falls back to basic binary installation if that fails.

Also added native Windows/ARM and macOS binaries, and support for pacman.

Additionally an install option was added to handle the various forms of installation.

Signed-off-by: crueter <crueter@eden-emu.dev>
@crueter
Copy link
Author

crueter commented Jan 13, 2026

Went ahead and refactored it to use one Package class that defines installation, URLs etc. Also added Darwin binary installation and Arch Linux package manager support.

Versions are now separated as well, kept them all at the current for consistency's sake.

Installation now attempts the package manager first, and if that fails falls back to binary installation. Still very much a draft and untested, but should be much easier to extend in the future (though I wish the table of platforms could be autogenerated, but oh well)

@crueter crueter marked this pull request as draft January 13, 2026 23:09
@crueter crueter changed the title add native Windows/ARM64 binaries, update ccache/sccache refactor: add Windows ARM and macOS binaries, use a single Package class, deduplicate some common install code Jan 13, 2026
@crueter
Copy link
Author

crueter commented Jan 25, 2026

Been thinking on this for a bit. Ideas:

metadata

It's kind of tedious to have to change every single file hash every single time, especially given it's the executable itself, NOT the artifact. (perhaps this should be changed?)

An idea to fix this could be to generate a metadata file containing all the necessary information (could be a direct TypeScript file, or a json file read at runtime) from a simple json file that specifies versions, i.e.:

{
    "ccache": {
        "linux": {
            "x64": "4.12.2",
            "aarch64": "4.12.2"
        }
    }
}

...so on and so forth. A simple shell script or something in the npm run prepare command could then generate the aforementioned metadata with sums and such.

force-install, etc

Like that other PR

  • install, or force-install
    • yes: install/update through the package manager if possible, otherwise download a binary
    • binary: just install the binary directory
    • auto (default): run which, if not go to yes behavior
    • no: don't install at all. Maybe useful for MSYS2 or something? Or custom docker/cross-arch setups.

Let me know your thoughts, gonna fix some of the issues this has right now.

Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
Signed-off-by: crueter <crueter@eden-emu.dev>
@crueter
Copy link
Author

crueter commented Jan 25, 2026

Added install as well and fixed all remaining issues I could find.

Tested on all relevant platforms with all combinations and everything worked as expected. I'm not sure if the whole metadata feature is in scope of this PR, but I would absolutely love to visit it in the future because holy cow it is tedious to get all those sha256 sums.

Note: currently ccache binary will not work on musl-based distros, this will be fixed in v4.13 where they are adding a musl-linked binary.

@crueter crueter marked this pull request as ready for review January 25, 2026 15:48
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