rstudio / tinytex-releases

Windows/macOS/Linux binaries and installation methods of TinyTeX
https://yihui.org/tinytex/
GNU General Public License v2.0
263 stars 29 forks source link

Support ARM operating systems #37

Open colearendt opened 1 year ago

colearendt commented 1 year ago

@heath-r and I are having trouble getting TinyTeX installed on an ARM jammy (22.04) instance. It looks like the install script tries to install from source. Do we ship ARM binaries?

yihui commented 1 year ago

We don't, mainly because Github Actions doesn't support these operating systems

It's beyond my expertise to figure out how to build TinyTeX binaries for ARM operating systems on x84 platforms. If anyone can help, I'll be eager to work on it.

colearendt commented 1 year ago

Nice, thanks! https://github.com/actions/runner-images/issues/2187 suggested that buildjet.com may have an option, and we also do have some self-hosted runners internally that could potentially help (although I believe it is mostly used for private repos at present). I'm definitely hopeful we can make progress on this as we add ARM support for our R, Python, and product builds 😄 I'll do some poking internally

yihui commented 1 year ago

Thanks! If we have self-hosted runners and I can use them, I'd definitely love to build more types of TinyTeX binaries!

vk496 commented 1 year ago

you can do that directly on any x86 host!

Using Docker and https://github.com/multiarch/qemu-user-static you can easily buid & run on any architecture without the need of native host (or cross compiling)

yihui commented 1 year ago

@vk496 That sounds like exactly what we need! Thanks a lot for the tip!

vk496 commented 1 year ago

Sorry, I was not able to find a example that I did before. But essentially, you can do a basic Dockerfile that build as expected and then some script to enforce the architecture in some well-supported base image that have that architecture (ubuntu, debian, alpine, ....)

I think I did that with Travis, but can be done easily anywhere (maybe someone already did the work in the github workflows). If I found it, I will post it here

Salu2

vk496 commented 1 year ago

Yep, found it!

https://github.com/nfc-tools/mfoc-hardnested/blob/master/.github/workflows/build.yml

Hope it's useful :)

cderv commented 1 year ago

Really interesting ! thanks for sharing !

cderv commented 11 months ago

I have seen update on Github where M1 is now available:

yihui commented 11 months ago

The M1 macOS runner won't help, since TeX Live only has the universal-darwin version for macOS:

> tinytex:::.tl_platforms
 [1] "aarch64-linux"       "amd64-freebsd"       "amd64-netbsd"        "armhf-linux"        
 [5] "i386-freebsd"        "i386-linux"          "i386-netbsd"         "i386-solaris"       
 [9] "universal-darwin"    "windows"             "x86_64-cygwin"       "x86_64-darwinlegacy"
[13] "x86_64-linux"        "x86_64-linuxmusl"    "x86_64-solaris"   

What we need is ARM Linux runners, which I don't know if Github Action will ever support. The emulator mentioned by @vk496 is probably the best way to go.

cderv commented 3 months ago

It seems Linux ARM64 environment are available now (per https://github.com/actions/runner-images/issues/5631)

Not sure it is deployed yet, but probably soon to be available.

It was in private beta in January: https://github.blog/changelog/2023-10-30-accelerate-your-ci-cd-with-arm-based-hosted-runners-in-github-actions/

yihui commented 3 months ago

https://github.blog/ai-and-ml/product-ai-and-ml/arm64-on-github-actions-powering-faster-more-efficient-build-systems/#get-started-using-arm-hosted-runners-today

These runners are available to our customers on our GitHub Team and Enterprise Cloud plans. We expect to begin offering Arm runners for open source projects by the end of the year.

I just took a look at this repo's settings and it seems we can indeed enable arm-based runners (which are available to our rstudio org), but it involves with some manual download/config. Perhaps we can just wait for them to become publicly available by the end of the year.

As we are thinking about TinyTeX releases for different architectures, I think we also need to think more about our naming scheme for the release assets. In retrospect, I regret using filename extensions zip, tgz, and tar.gz to differentiate between operating systems. I should have added OS and architecture names to the filenames, e.g., TinyTeX-1-linux-arm64.tar.gz. It may be too late to make this change now (we would have to update our installation scripts and other people would have to do the same thing if they have their own installation scripts). For the possible new arm-based TinyTeX releases, we can probably just add arm64 to the filenames, e.g., TinyTeX-1-arm64.tar.gz.