lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.07k stars 591 forks source link

make minimal is too minimal, does not install all templates #2641

Open nirs opened 1 week ago

nirs commented 1 week ago

Description

This is what I'm doing in CI to get a minimal build (since it takes 4 minutes instead of 11 minutes), and use the vmnet template:

      - name: Install lima
        run: |
          cd lima

          # Miniaml build is 3 times faster than full make..
          make minimal                                                                                                                                                                                                         

          # But it adds only the default template, so lets fix it: 
          rm -rf _output/share/lima/templates
          cp -aL examples _output/share/lima/templates
          ln -sf templates _output/share/lima/examples

          # And install
          sudo make install
          limactl --version

Possible fixes:

The second option seems better, keeping the current behavior, and providing more options for developers with special needs.

I can post a PR if we have an agreement on the wanted solution.

jandubois commented 1 week ago
  • Provide a templates target to install all templates,

This is already proposed in #2638 (except it has separate templates and template_experimentals targets).

So I think this issue could be closed as a duplicate.

nirs commented 1 week ago

This may be resolved by #2638 but the issue it is solving is not unrelated (#2638). Refactor makefiles cannot change the behavior (since refactoring is changing the design without changing the behaviour). So maybe add this issue to the #2638?

afbjorklund commented 1 week ago

This was supposed to be done by supplying a .config file, but it could have been better documented.

I think we could move the Source installation to a separate page? https://lima-vm.io/docs/installation/

To change the build configuration, run make config or make menuconfig.

This requires kconfig tools installed, it is also possible to edit .config. The default configuration can be found in the file config.mk (make syntax).

afbjorklund commented 1 week ago

Also in CI it should not be a major issue, if the build results are being put in the CI cache?

i.e. there is no need to install go and to build it from source, if there already is a binary...

nirs commented 5 days ago

Also in CI it should not be a major issue, if the build results are being put in the CI cache?

i.e. there is no need to install go and to build it from source, if there already is a binary...

It depends on what you want to test. I want to lima from master in the ramen CI so we can validate that ramen code using lima does not break because of new changes in lima. The CI runners are very slow and building lima can take more than 10 minutes for a full build.

afbjorklund commented 17 hours ago

Sorry about your CI runners, I just find the cache to be even more valuable on the small systems like the Raspberry Pi...

It is off-topic to the discussion on what to build and install with make, like which OS and Arch should be supported etc.