Open ahaoboy opened 2 weeks ago
On Ubuntu, It will use the quickInstall source, and on Windows, fnm will compile from source.
@ahaoboy This sounds like a fun issue to work on! I'd love to pick it up.
My Approach is simple :
fnm
project following the required naming conventions:
fnm-x86_64-pc-windows-msvc.zip
fnm-arm64-pc-windows-msvc.zip
fnm
.I'll automate the building and uploading of these binaries via GitHub Actions for both Windows platforms (x86_64 and arm64), as well as other target platforms.
install.sh
script to ensure proper installation flow when using cargo-binstall
.Let me know if this approach works, and I'd be happy to get started!
This sounds good and I’d love to see that contributed! I suggest stacking these changes on a fork so we see that it works (all the release process has a very slow feedback loop). I think it will be best to first have both fnm-macos.zip etc along to the new files, so we can make sure all installers are updated (like winget, brew, apt etc). We just symlink or duplicate release artifacts to avoid breaking :) if there are any issues I can try to help
Making cross compile work faster and nicer is pretty cool. Maybe with cargo zigbuild
or whatever it is called
It is not clear whether fnm-macos is currently x86_64 or arm64, perhaps it should support both
Making cross compile work faster and nicer is pretty cool. Maybe with
cargo zigbuild
or whatever it is called
I often use this action, it is easier to use than cargo-dist
@Schniz @ahaoboy
Before I proceed with adding cargo-binstall
support and updating the release process, I wanted to check on the current binaries that are already available for fnm.
Could you confirm which binaries are currently being generated for each platform (e.g., fnm-x86_64-apple-darwin.zip
, fnm-arm64-apple-darwin.zip
, etc.)? This will help ensure I update the install script and CI process correctly without duplicating existing work.
This is in referrence to any existing work/ open PR's on the same
cargo-binstall has full list, but we don't need support all of them https://github.com/cargo-bins/cargo-binstall/releases
@ahaoboy @Schniz I have made a PR with the binstall.toml
and CI changes, can you help me with what other changes are required to support the same?
Because actions/upload-artifact@v4 is used to compress files, CRC calculation errors occur. https://github.com/cargo-bins/cargo-binstall/issues/1080. Therefore, zip packages such as fnm-windows.zip cannot be used even if metadata is added. It needs to be tested to prevent this problem.
You can test whether the local Cargo.toml is configured correctly by the following command
cargo binstall --manifest-path=./Cargo.toml fnm --force
WARN resolve: Error while downloading and extracting from fetcher github.com: Failed to extract zipfile: a computed CRC32 value did not match the expected value
Also, should the meta information be added to Cargo.toml? Using binstall.toml will duplicate package information, and I'm not sure if it will work.
[package.metadata.binstall]
pkg-fmt = "zip"
bin-dir = "fnm{ binary-ext }"
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-url = "{ repo }/releases/download/v{ version }/fnm-windows.zip"
[package.metadata.binstall.overrides.x86_64-apple-darwin]
pkg-url = "{ repo }/releases/download/v{ version }/fnm-macos.zip"
[package.metadata.binstall.overrides.x86_64-unknown-linux-musl]
pkg-url = "{ repo }/releases/download/v{ version }/fnm-linux.zip"
https://github.com/cargo-bins/cargo-binstall
cargo-binstall can skip the compilation process. fnm has released executable programs for different platforms, but it does not support cargo-binstall.