-
Notifications
You must be signed in to change notification settings - Fork 700
Reorganize platform build instructions #4110
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
13a31e1
[docs] Reorganize build instructions
ricab 5d97e81
[docs] Detail Linux build instructions a little
ricab 71d1e58
[docs] Reformat Linux build instructions
ricab 9c7d3a5
[docs] Reformat macOS build instructions
ricab d755c4f
[docs] rename build-instructions file for macOS
ricab 68acc22
[docs] Reformat Windows build instructions
ricab 44e6855
[docs] Reformat readme
ricab c6a19ad
[docs] Add Coverage build type to Linux examples
ricab 113ffce
[docs] Move linker section to root readme
ricab 35f7e43
[docs] Point to policy earlier in README
ricab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Build instructions for Linux | ||
|
||
## Environment Setup | ||
|
||
### Build dependencies | ||
|
||
``` | ||
cd <multipass> | ||
sudo apt install devscripts equivs | ||
mk-build-deps -s sudo -i | ||
``` | ||
|
||
## Building | ||
|
||
First, go into the repository root and get all the submodules: | ||
|
||
``` | ||
cd <multipass> | ||
git submodule update --init --recursive | ||
``` | ||
|
||
If building on arm, s390x, ppc64le, or riscv, you will need to set the `VCPKG_FORCE_SYSTEM_BINARIES` environment | ||
variable: | ||
|
||
``` | ||
export VCPKG_FORCE_SYSTEM_BINARIES=1 | ||
``` | ||
|
||
Then create a build directory and run CMake. | ||
|
||
``` | ||
mkdir build | ||
cd build | ||
cmake ../ | ||
``` | ||
|
||
This will fetch all necessary content, build vcpkg dependencies, and initialize the build system. You can also specify | ||
the `-DCMAKE_BUILD_TYPE` option to set the build type (e.g., `Debug`, `Release`, `Coverage`, etc.). | ||
|
||
Finally, to build the project, run: | ||
|
||
``` | ||
cmake --build . --parallel | ||
``` | ||
|
||
Please note that if you're working on a forked repository that you created using the "Copy the main branch only" option, | ||
the repository will not include the necessary git tags to determine the Multipass version during CMake configuration. In | ||
this case, you need to manually fetch the tags from the upstream by running | ||
`git fetch --tags https://github.com/canonical/multipass.git` in the `<multipass>` source code directory. | ||
|
||
## Run the Multipass daemon and client | ||
|
||
First, install Multipass's runtime dependencies. On AMD64 architecture, you can do this with: | ||
|
||
``` | ||
sudo apt update | ||
sudo apt install libgl1 libpng16-16 libqt6core6 libqt6gui6 \ | ||
libqt6network6 libqt6widgets6 libxml2 libvirt0 dnsmasq-base \ | ||
dnsmasq-utils qemu-system-x86 qemu-utils libslang2 iproute2 \ | ||
iptables iputils-ping libatm1 libxtables12 xterm | ||
``` | ||
|
||
Then run the Multipass daemon: | ||
|
||
``` | ||
sudo <multipass>/build/bin/multipassd & | ||
``` | ||
|
||
Copy the desktop file that Multipass clients expect to find in your home: | ||
|
||
``` | ||
mkdir -p ~/.local/share/multipass/ | ||
cp <multipass>/data/multipass.gui.autostart.desktop ~/.local/share/multipass/ | ||
``` | ||
|
||
Optionally, enable auto-complete in Bash: | ||
|
||
``` | ||
source <multipass>/completions/bash/multipass | ||
``` | ||
|
||
Now you can use the `multipass` command from your terminal (for example | ||
`<multipass>/build/bin/multipass launch --name foo`) or launch the GUI client with the command | ||
`<multipass>/build/bin/multipass.gui`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,43 +3,54 @@ Build instructions for Windows 10 | |
|
||
Environment Setup | ||
----------------- | ||
|
||
### Chocolatey | ||
|
||
Install chocolatey, a package manager, to download the rest of the dependencies: <https://chocolatey.org/> | ||
|
||
Press Windows Key+X and Run Windows PowerShell(Admin) then follow the chocolatey instructions to "Install with Powershell.exe" | ||
Press Windows Key+X and Run Windows PowerShell(Admin) then follow the chocolatey instructions to "Install with | ||
Powershell.exe" | ||
|
||
After chocolatey is installed you can now install the rest of the dependencies: | ||
|
||
choco install visualstudio2019buildtools visualstudio2019-workload-vctools cmake ninja cmder qemu-img openssl -yfd | ||
|
||
You may have to disable Windows Defender Real-time protection if you want the packages to install quicker. | ||
Search for Windows Defender Security Center, go to Virus & threat protection, then Virus and thread protection settings, disable Real-time protection. | ||
You may have to disable Windows Defender Real-time protection if you want the packages to install quicker. Search for | ||
Windows Defender Security Center, go to Virus & threat protection, then Virus and thread protection settings, disable | ||
Real-time protection. | ||
|
||
NOTE: visualcpp-build-tools is only the installer package. For this reason, choco cannot detect any new compiler tool updates so choco upgrade | ||
will report no new updates available. To update the compiler and related tooling, you will need to search for "Add or remove programs", | ||
find "Microsoft Visual Studio Installer" and click "Modify". | ||
NOTE: visualcpp-build-tools is only the installer package. For this reason, choco cannot detect any new compiler tool | ||
updates so choco upgrade will report no new updates available. To update the compiler and related tooling, you will need | ||
to search for "Add or remove programs", find "Microsoft Visual Studio Installer" and click "Modify". | ||
|
||
### Git | ||
You need to enable symlinks in Windows Git, have a look at [the git-for-windows docs](https://github.com/git-for-windows/git/wiki/Symbolic-Links). | ||
|
||
You need to enable symlinks in Windows Git, have a look at | ||
[the git-for-windows docs](https://github.com/git-for-windows/git/wiki/Symbolic-Links). | ||
|
||
### Qt6 | ||
|
||
Install the latest stable version of Qt6 (6.2.4 at the moment): <https://www.qt.io/download-thank-you?os=windows/>. | ||
|
||
In the online installer, under Qt, select MSVC 2019 64-bit. | ||
|
||
If you already have Qt installed, run the MaintenanceTool included in the Qt directory to update to the latest version. | ||
|
||
Alternatively, download the [qtbase archive](https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_624/qt.qt6.624.win64_msvc2019_64/6.2.4-0-202203140926qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z) and extract it to `C:\Qt` (so it ends up in `C:\Qt\6.2.4`). | ||
Alternatively, download the | ||
[qtbase archive](https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_624/qt.qt6.624.win64_msvc2019_64/6.2.4-0-202203140926qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z) | ||
and extract it to `C:\Qt` (so it ends up in `C:\Qt\6.2.4`). | ||
|
||
### Path setup | ||
|
||
You'll have to manually add CMake and Qt to your account's PATH variable. | ||
|
||
Search for "Edit environment variables for your account" then edit your Path variable. | ||
Add the following: | ||
`C:\Program Files\CMake\bin` | ||
`C:\Qt\6.2.4\msvc2019_64\bin` | ||
Search for "Edit environment variables for your account" then edit your Path variable. Add the following: | ||
|
||
- `C:\Program Files\CMake\bin` | ||
- `C:\Qt\6.2.4\msvc2019_64\bin` | ||
|
||
### Cmder setup | ||
|
||
Cmder is a sane terminal emulator for windows, which includes git and SSH support among other things. | ||
|
||
The following will setup a task that you can use to build things with the VS2019 compiler toolchain. | ||
|
@@ -48,10 +59,10 @@ Run cmder which should be installed by default on C:\tools\cmder\Cmder.exe | |
Click on the green "+" sign on the right lower corner of cmder | ||
Select "Setup tasks..." | ||
Click the "+" button to add a new task | ||
In the task parameters box add (basically copying from cmd:Cmder task): | ||
``/icon "%CMDER_ROOT%\icons\cmder.ico"`` | ||
In the task parameters box add (basically copying from cmd:Cmder task): | ||
``/icon "%CMDER_ROOT%\icons\cmder.ico"`` | ||
In the commands box, add: | ||
``cmd /k ""%ConEmuDir%\..\init.bat" && "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64" -new_console:d:%USERPROFILE%`` | ||
``cmd /k ""%ConEmuDir%\..\init.bat" && "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64" -new_console:d:%USERPROFILE%`` | ||
|
||
Give the task a name (first box), such as vs2019 and click Save Settings. | ||
|
||
|
@@ -94,24 +105,28 @@ Running multipass | |
--------------------------------------- | ||
|
||
### Enable Hyper-V | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not strictly required 🤷 |
||
|
||
Before starting multipassd, you'll have to enable the Hyper-V functionality in Windows 10 Pro. | ||
See: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v | ||
|
||
Press Windows Key + X, Select Windows PowerShell (Admin) | ||
Run "Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All" | ||
|
||
### Start the daemon (multipassd) | ||
|
||
Press Windows Key + X, Select Windows PowerShell (Admin) | ||
Run multipassd (for example: multipassd --logger=stderr) | ||
Alternatively, you can install multipassd as a Windows Service (Run "multipassd /install") | ||
To stop and uninstall the Windows service, Run "multipassd /uninstall" | ||
|
||
### Run multipass | ||
|
||
With the multipassd daemon now running on another shell (or as a windows service) you can now run multipass. | ||
Press Windows Key + X, Select Windows PowerShell, or alternatively run cmd.exe on the search bar | ||
Try "multipass help" | ||
|
||
### Permissions/privileges for multipassd | ||
|
||
multipassd needs Administrator privileges in order to create symlinks when using mounts and to manage Hyper-V instances. | ||
|
||
If you don't need symlink support you can run multipassd on a less privileged shell but your user account | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6.2.4
is no longer the "latest" stable version.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we can just get rid of the version information, unless we want to pin QT to a specific stable version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either that or "latest stable version". But this is kind of outside scope here, I just want to have all platforms linked from the Readme... I'll open an issue for improvements specifically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6.2.4
is a specific version that we align with. It's just that there newer LTS versions, so it's not exactly the "latest" anymore.