[PATCH] fix: config support with vms
with config.nix, the build of vms fails with
error: undefined variable 'pkgs'
..
49|
50| kernel = pkgs.linux_latest.override {
| ^
This fixes the issue for all default vms
Signed-off-by: Ville Ilvonen
Ville Ilvonen
with config.nix, the build of vms fails with error: undefined variable 'pkgs' .. 49| 50| kernel = pkgs.linux_latest.override { | ^
This fixes the issue for all default vms
Signed-off-by: Ville Ilvonen
---
Hi Ville, I was wondering how I'd have missed something like the default VMs not evaluating, but indeed I'm not able to reproduce this. And when I look at the default.nix files for the default VMs, I see: 50 kernel = buildPackages.linux.override { So unless I've missed something, I don't think this issue exists in the current upstream. (I checked commit 3aa2f8a.) Although this does make me wonder /why/ buildPackages is used here — I think that would be incorrect in the case of cross compilation. Possibly it was just a hack I used to work around some pkgsStatic issue with the kernel at the time, and then forgot to change back. The right thing to do here would be for linux_latest to be an argument to the function passed to callPackage.
On 9/20/22 14:31, Alyssa Ross wrote:
Ville Ilvonen
writes: with config.nix, the build of vms fails with error: undefined variable 'pkgs' .. 49| 50| kernel = pkgs.linux_latest.override { | ^
This fixes the issue for all default vms
Signed-off-by: Ville Ilvonen
--- Hi Ville, I was wondering how I'd have missed something like the default VMs not evaluating, but indeed I'm not able to reproduce this. And when I look at the default.nix files for the default VMs, I see:
50 kernel = buildPackages.linux.override {
So unless I've missed something, I don't think this issue exists in the current upstream. (I checked commit 3aa2f8a.)
I'm not testing with default but with new config.nix support. Have you tested with any config.nix? -Ville
Although this does make me wonder /why/ buildPackages is used here — I think that would be incorrect in the case of cross compilation. Possibly it was just a hack I used to work around some pkgsStatic issue with the kernel at the time, and then forgot to change back. The right thing to do here would be for linux_latest to be an argument to the function passed to callPackage.
Ville Ilvonen
On 9/20/22 14:31, Alyssa Ross wrote:
Ville Ilvonen
writes: with config.nix, the build of vms fails with error: undefined variable 'pkgs' .. 49| 50| kernel = pkgs.linux_latest.override { | ^
This fixes the issue for all default vms
Signed-off-by: Ville Ilvonen
--- Hi Ville, I was wondering how I'd have missed something like the default VMs not evaluating, but indeed I'm not able to reproduce this. And when I look at the default.nix files for the default VMs, I see:
50 kernel = buildPackages.linux.override {
So unless I've missed something, I don't think this issue exists in the current upstream. (I checked commit 3aa2f8a.)
I'm not testing with default but with new config.nix support. Have you tested with any config.nix?
I'm not sure I understand what you mean. config.nix support is already present in the commit I tested. I created a simple config.nix file that just set "pkgs" to "import <nixpkgs> {}" in case the presence of the config file made a difference, and ran: nix-instantiate vm/*/* img/live To test evaluating VMs both directly and as part of the whole system, and it worked fine.
On 9/20/22 14:42, Alyssa Ross wrote:
Ville Ilvonen
writes: On 9/20/22 14:31, Alyssa Ross wrote:
Ville Ilvonen
writes: with config.nix, the build of vms fails with error: undefined variable 'pkgs' .. 49| 50| kernel = pkgs.linux_latest.override { | ^
This fixes the issue for all default vms
Signed-off-by: Ville Ilvonen
--- Hi Ville, I was wondering how I'd have missed something like the default VMs not evaluating, but indeed I'm not able to reproduce this. And when I look at the default.nix files for the default VMs, I see:
50 kernel = buildPackages.linux.override {
So unless I've missed something, I don't think this issue exists in the current upstream. (I checked commit 3aa2f8a.)
I'm not testing with default but with new config.nix support. Have you tested with any config.nix?
I'm not sure I understand what you mean. config.nix support is already present in the commit I tested.
I created a simple config.nix file that just set "pkgs" to "import <nixpkgs> {}" in case the presence of the config file made a difference, and ran:
nix-instantiate vm/*/* img/live
Interesting. I created a simple config.nix in the root of Spectrum source tree - https://spectrum-os.org/doc/build-configuration.html It only overrides the kernel - to imx8 - and sets crossSystem for aarch64. Build of vms fails without this patch. -Ville
To test evaluating VMs both directly and as part of the whole system, and it worked fine.
Ville Ilvonen
On 9/20/22 14:42, Alyssa Ross wrote:
Ville Ilvonen
writes: On 9/20/22 14:31, Alyssa Ross wrote:
Ville Ilvonen
writes: with config.nix, the build of vms fails with error: undefined variable 'pkgs' .. 49| 50| kernel = pkgs.linux_latest.override { | ^
This fixes the issue for all default vms
Signed-off-by: Ville Ilvonen
--- Hi Ville, I was wondering how I'd have missed something like the default VMs not evaluating, but indeed I'm not able to reproduce this. And when I look at the default.nix files for the default VMs, I see:
50 kernel = buildPackages.linux.override {
So unless I've missed something, I don't think this issue exists in the current upstream. (I checked commit 3aa2f8a.)
I'm not testing with default but with new config.nix support. Have you tested with any config.nix?
I'm not sure I understand what you mean. config.nix support is already present in the commit I tested.
I created a simple config.nix file that just set "pkgs" to "import <nixpkgs> {}" in case the presence of the config file made a difference, and ran:
nix-instantiate vm/*/* img/live
Interesting. I created a simple config.nix in the root of Spectrum source tree - https://spectrum-os.org/doc/build-configuration.html It only overrides the kernel - to imx8 - and sets crossSystem for aarch64. Build of vms fails without this patch.
Are you testing with an upstream Spectrum commit, or with one from the TII branch with cross compilation support? It's likely that making cross compilation work would have required changing line 50 you posted above, because as I explained I don't think it's correct. So if you're using that branch, that could explain why you're seeing this and I'm not.
On 9/20/22 14:59, Alyssa Ross wrote:
Ville Ilvonen
writes: On 9/20/22 14:42, Alyssa Ross wrote:
Ville Ilvonen
writes: On 9/20/22 14:31, Alyssa Ross wrote:
Ville Ilvonen
writes: with config.nix, the build of vms fails with error: undefined variable 'pkgs' .. 49| 50| kernel = pkgs.linux_latest.override { | ^
This fixes the issue for all default vms
Signed-off-by: Ville Ilvonen
--- Hi Ville, I was wondering how I'd have missed something like the default VMs not evaluating, but indeed I'm not able to reproduce this. And when I look at the default.nix files for the default VMs, I see:
50 kernel = buildPackages.linux.override {
So unless I've missed something, I don't think this issue exists in the current upstream. (I checked commit 3aa2f8a.)
I'm not testing with default but with new config.nix support. Have you tested with any config.nix?
I'm not sure I understand what you mean. config.nix support is already present in the commit I tested.
I created a simple config.nix file that just set "pkgs" to "import <nixpkgs> {}" in case the presence of the config file made a difference, and ran:
nix-instantiate vm/*/* img/live
Interesting. I created a simple config.nix in the root of Spectrum source tree - https://spectrum-os.org/doc/build-configuration.html It only overrides the kernel - to imx8 - and sets crossSystem for aarch64. Build of vms fails without this patch.
Are you testing with an upstream Spectrum commit, or with one from the
Testing with an upstream Spectrum commit - using a branch rebased with spectrum/main and from which I dropped the cross-compilation configuration hacks and moved them to config.nix. It has got 3aa2f8a (which is a copyright update).
TII branch with cross compilation support? It's likely that making cross compilation work would have required changing line 50 you posted above, because as I explained I don't think it's correct. So if you're using that branch, that could explain why you're seeing this and I'm not.
participants (2)
-
Alyssa Ross
-
Ville Ilvonen