Skip to content

Consider setting CONFIG_GUESTAGENT_ARCH_{ARMV7L, RISCV64, S390X, ...} to n (for Homebrew) #3321

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

Closed
AkihiroSuda opened this issue Mar 9, 2025 · 6 comments · Fixed by #3503
Labels
Milestone

Comments

@AkihiroSuda
Copy link
Member

armv7l, riscv64, and s390x (being added via #3319) are very rarely used and should not waste the disk space by default:

$ ls -lh ~/.local/share/lima/lima-guestagent.Linux-*
-rw-r--r--  1 suda  staff    53M  3  9 05:04 /Users/suda/.local/share/lima/lima-guestagent.Linux-aarch64
-rw-r--r--  1 suda  staff    52M  3  9 05:04 /Users/suda/.local/share/lima/lima-guestagent.Linux-armv7l
-rw-r--r--  1 suda  staff    53M  3  9 05:04 /Users/suda/.local/share/lima/lima-guestagent.Linux-riscv64
-rw-r--r--  1 suda  staff    58M  3  9 05:04 /Users/suda/.local/share/lima/lima-guestagent.Linux-s390x
-rw-r--r--  1 suda  staff    55M  3  9 05:04 /Users/suda/.local/share/lima/lima-guestagent.Linux-x86_64

My suggestion is:

Dist Config
Source distribution Just compile aarch64 and x86_64 by default. Probably, there should be a script like ./configure --guestagent-arch=all to allow keeping compiling everything.
Homebrew Split the lima formula to lima and lima-extra-guestagents. Needs to be negotiated with Homebrew maintainers.
Binary distribution in https://github.com/lima-vm/lima/releases Should follow the same convention as Homebrew?

The same should apply to other potential guestagents in future too (ppc64le, FreeBSD-x86_64, etc.)

@afbjorklund
Copy link
Member

Probably, there should be a script like ./configure --guestagent-arch=all to allow keeping compiling everything.

Normally (with konfig) this is handled by providing different config files.

You can even keep the defaults as they are, and only change config.mk

config.mk

CONFIG_GUESTAGENT_ARCH_X8664=y
CONFIG_GUESTAGENT_ARCH_AARCH64=y
CONFIG_GUESTAGENT_ARCH_ARMV7L=n
CONFIG_GUESTAGENT_ARCH_RISCV64=n
CONFIG_GUESTAGENT_ARCH_S390X=n

defconfig (kconfig-conf --savedefconfig defconfig Kconfig)

# CONFIG_GUESTAGENT_ARCH_ARMV7L is not set
# CONFIG_GUESTAGENT_ARCH_RISCV64 is not set
# CONFIG_GUESTAGENT_ARCH_S390X is not set

alldefconfig (kconfig-conf --alldefconfig Kconfig)

CONFIG_GUESTAGENT_ARCH_X8664=y
CONFIG_GUESTAGENT_ARCH_AARCH64=y
CONFIG_GUESTAGENT_ARCH_ARMV7L=y
CONFIG_GUESTAGENT_ARCH_RISCV64=y
CONFIG_GUESTAGENT_ARCH_S390X=y

@jandubois
Copy link
Member

I'm confused; can't we already build whatever we want with a combination of these:

lima/Makefile

Lines 97 to 101 in 4a88b71

@echo 'Targets for files in _output/share/lima/:'
@echo '- guestagents : Build guestagents for archs enabled by CONFIG_GUESTAGENT_ARCH_*'
@echo '- native-guestagent : Build guestagent for native arch'
@echo '- additional-guestagents : Build guestagents for archs other than native arch'
@echo '- <arch>-guestagent : Build guestagent for <arch>: $(sort $(LINUX_GUESTAGENT_ARCHS))'

Personally I always thought that the kconfig mechanism is kind of weird.

@afbjorklund
Copy link
Member

Personally I always thought that the kconfig mechanism is kind of weird.

I think at this point, the makefile targets could probably replace the Kconfig?

It's a bit doubled up, and having dedicated targets seemed to be preferred.

I mostly used it (as an alternative to autoconf), because I was familar with it...

@AkihiroSuda
Copy link
Member Author

I think at this point, the makefile targets could probably replace the Kconfig?

👍

@AkihiroSuda
Copy link
Member Author

@lima-vm/maintainers

Are we safe to do this in v1.1, or do we want to revisit this in v1.2?

Dist Config
Source distribution Just compile aarch64 and x86_64 by default. Probably, there should be a script like ./configure --guestagent-arch=all to allow keeping compiling everything.
Homebrew Split the lima formula to lima and lima-extra-guestagents. Needs to be negotiated with Homebrew maintainers.
Binary distribution in https://github.com/lima-vm/lima/releases Should follow the same convention as Homebrew?

@jandubois
Copy link
Member

jandubois commented Apr 15, 2025

I don't like the idea of an additional configure script. I think we should just add an all-guestagents target, and redefine guestagents to mean aarch64 and x86_64 unconditionally.

For Homebrew it makes sense to me to just include aarch64 and x86_64 guestagents. I don't think the additional guestagents need to be packaged, but it is up to the Homebrew maintainers.

For the binary distribution I don't mind including all guestagents. I don't know who is using the binary releases, but the download numbers are small compared to Homebrew installs:

$ gh api repos/lima-vm/lima/releases --jq '
  [ ["Tag", "Asset", "Downloads"] ] +
  (map( .tag_name as $tag | .assets | map([ $tag, .name, .download_count ]) ) | add)
  | .[] | @tsv' | grep -vE '(alpha|beta|go-mod|SHA)' | column -s $'\t' -t
Tag      Asset                             Downloads
v1.0.7   lima-1.0.7-Darwin-arm64.tar.gz    1052
v1.0.7   lima-1.0.7-Darwin-x86_64.tar.gz   1547
v1.0.7   lima-1.0.7-Linux-aarch64.tar.gz   35
v1.0.7   lima-1.0.7-Linux-x86_64.tar.gz    5172
v1.0.6   lima-1.0.6-Darwin-arm64.tar.gz    1287
v1.0.6   lima-1.0.6-Darwin-x86_64.tar.gz   2225
v1.0.6   lima-1.0.6-Linux-aarch64.tar.gz   84
v1.0.6   lima-1.0.6-Linux-x86_64.tar.gz    6059
brew info lima
==> lima: stable 1.0.7 (bottled), HEAD

==> Analytics
install: 14,704 (30 days), 51,154 (90 days), 192,827 (365 days)
install-on-request: 7,899 (30 days), 28,141 (90 days), 122,289 (365 days)

I just checked brew info lima on Intel, and the Analytics are the same, so these look like combined platform numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants