Skip to content
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

Separate nix-file for example and vmbuild, fix conflicts #2238

Merged
merged 2 commits into from
May 17, 2024

Conversation

MagnusS
Copy link
Member

@MagnusS MagnusS commented May 16, 2024

This adds vmbuild.nix to build the vmbuild-tools and moves the example from default.nix to example.nix.

They can be built separately with:

nix-build ./vmbuild.nix
nix-build ./example.nix

This should also remove the conflicts from #2236

vmbuild doesn't require the includeos build environment, but needs the source code.
To avoid a circular dependency, this creates a vmbuild.nix in the root directory
and includes the parts of the source code that vmbuild needs.

`nix-build ./vmbuild.nix` produces vmbuild and elf_syms binaries in result/bin.

This commit also removes conan specific details from vmbuild/CMakeLists.txt
Moves the example to a separate nix-file.

To link the example binary, run:

nix-build ./example.nix
@MagnusS
Copy link
Member Author

MagnusS commented May 16, 2024

After #2236 is merged, we could hopefully also move the current default.nix to includeos.nix and make a toplevel nix-file that builds everything - but I haven't tested this yet.

Copy link
Contributor

@alfreb alfreb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! (and builds cleanly with nix-build example.nix / nix-build vmbuild.nix). I like that they are decoupled and that I can do this:

~/IncludeOS$ nix-build
/nix/store/12fvih0pm1g98r7z3vikh74f9h2ww6y1-includeos-static-x86_64-unknown-linux-musl-dev

to get my IncludeOS package and not just the example binary.

I think we'll want the example to also depend on vmbuild but right now it doesn't so we can hook that up when needed. It's a TODO in cmake/os.cmake to hook elf_syms back in - not sure if we want to do it in cmake or nix actually - I think I prefer nix; it reduces dependencies between cmake files and nix is a nicer language.

Maybe it's a postBuild step of the example - maybe optional - to create a vm with vmbuild, or grubify.sh once we recover that script.

Unless @bjornfor has objections or thinks we should do this differently, please merge.

@MagnusS
Copy link
Member Author

MagnusS commented May 17, 2024

Thanks - I'll merge this to unblock #2236

@MagnusS MagnusS merged commit d14c9d6 into includeos:master May 17, 2024
alfreb pushed a commit to alfreb/IncludeOS that referenced this pull request Jun 3, 2024
Separate nix-file for example and vmbuild, fix conflicts
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.

None yet

2 participants