Search harder for INCLUDEOS_VMRUNNER and INCLUDEOS_CHAINLOADER paths#37
Search harder for INCLUDEOS_VMRUNNER and INCLUDEOS_CHAINLOADER paths#37alfreb merged 2 commits intoincludeos:masterfrom
Conversation
Now that vmrunner is a python package we can use the metadata to find the script location. If INCLUDEOS_VMRUNNER is not set, this adds support for finding the location automatically. If vmrunner is installed with nix, the chainloader will be in a path listed in the propagatedBuildInputs environment variable. If INCLUDEOS_CHAINLOADER is not set, search for `/bin/chainloader` in this path to attempt to find it.
|
This update also accidentally fixed loading the default config, which requires an existing network bridge or the |
|
Nice - so with these changes, the tests which depend on network devices etc. will have to provide vm.json's to accomodate. I think that makes a lot of sense actually, but will it require a lot of cleaning up in the integration tests? |
|
The path was wrong -- it tried to load it from Tests are green - I think all of them already configure the network in |
| if INCLUDEOS_VMRUNNER is None: | ||
| from importlib.metadata import files | ||
| for p_ in files('vmrunner'): | ||
| if '__init__.py' in str(p_): |
| if os.path.isfile(chainloader_candidate): | ||
| chainloader = c_path + "/bin" | ||
| break | ||
|
|
Now that vmrunner is a python package we can use the metadata to find the script location. If
INCLUDEOS_VMRUNNERis not set, this adds support for finding the location automatically.If vmrunner is installed with nix, the chainloader will be in a path listed in the
propagatedBuildInputsenvironment variable. This adds support for searching for./bin/chainloaderin this path ifINCLUDEOS_CHAINLOADERis not set.With these changes vmrunner can be used from a nix shell without having to set the environment variables.
Tested with includeos' ./test.sh to verify that the tests still work with this change (without env variables)