19 Aug 2024 |
emily | I'll probably end up touching that code for We Should Improve Rust Somewhat but it seems like it should be a two line fix so maybe someone else should just do it | 03:08:29 |
Sashanoraa.gay (she/her, ze/zir) | I might look at it if I have time in the next few days | 03:42:29 |
Šimon Brandner | I am seeing a peculiar issue: nix build works just fine but when using the flake from my NixOS config I get complaints about Rust version:
error: builder for '/nix/store/p7dajki1blbc0wlsjk86ymh3pi3zh0mk-oblichey-0.0.1.drv' failed with exit code 101;
last 10 log lines:
> Finished cargoSetupPostPatchHook
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Running phase: buildPhase
> Executing cargoBuildHook
> ++ env CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqw
qlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CC_X86_64_UNKNOWN
_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/
bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu HOST_C
C=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc HOST_CXX=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/c++ cargo build -j 8 --ta
rget x86_64-unknown-linux-gnu --frozen --profile release
> error: package `cubecl v0.1.1 (https://github.com/tracel-ai/cubecl?rev=dd274b6515f853ab1c82db410d6fc7697060f69e#dd274b65)` cannot be built because it requires rustc
1.79 or newer, while the currently active rustc version is 1.77.2
> Either upgrade to rustc 1.79 or newer, or use
> cargo update cubecl@0.1.1 --precise ver
> where `ver` is the latest version of `cubecl` supporting rustc 1.77.2
For full logs, run 'nix log /nix/store/p7dajki1blbc0wlsjk86ymh3pi3zh0mk-oblichey-0.0.1.drv'.
error: 1 dependencies of derivation '/nix/store/mxwvym1s7dd4szzs3ccxnwxfx4iqsqbb-ags.pam.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fbzf0cszdcds4h93m52w7sicav68cfa0-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8s9wxgvic20f6pxp5cr6nmii9y25pirl-nixos-system-Simon-s-Tuxedo-InfinityBook-14-Gen8-24.11.20240529.ad57eef.drv' failed to build
Has anyone ever seen this?
(originally posted elsewhere but this room might be more appropriate)I am seeing a peculiar issue: nix build works just fine but when using the flake from my NixOS config I get complaints about Rust version:
error: builder for '/nix/store/p7dajki1blbc0wlsjk86ymh3pi3zh0mk-oblichey-0.0.1.drv' failed with exit code 101;
last 10 log lines:
> Finished cargoSetupPostPatchHook
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Running phase: buildPhase
> Executing cargoBuildHook
> ++ env CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqw
qlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CC_X86_64_UNKNOWN
_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/
bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu HOST_C
C=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc HOST_CXX=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/c++ cargo build -j 8 --ta
rget x86_64-unknown-linux-gnu --frozen --profile release
> error: package `cubecl v0.1.1 (https://github.com/tracel-ai/cubecl?rev=dd274b6515f853ab1c82db410d6fc7697060f69e#dd274b65)` cannot be built because it requires rustc
1.79 or newer, while the currently active rustc version is 1.77.2
> Either upgrade to rustc 1.79 or newer, or use
> cargo update cubecl@0.1.1 --precise ver
> where `ver` is the latest version of `cubecl` supporting rustc 1.77.2
For full logs, run 'nix log /nix/store/p7dajki1blbc0wlsjk86ymh3pi3zh0mk-oblichey-0.0.1.drv'.
error: 1 dependencies of derivation '/nix/store/mxwvym1s7dd4szzs3ccxnwxfx4iqsqbb-ags.pam.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fbzf0cszdcds4h93m52w7sicav68cfa0-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8s9wxgvic20f6pxp5cr6nmii9y25pirl-nixos-system-Simon-s-Tuxedo-InfinityBook-14-Gen8-24.11.20240529.ad57eef.drv' failed to build
Has anyone ever seen this?
(originally posted elsewhere but this room might be more appropriate)
| 07:19:06 |
Šimon Brandner | * I am seeing a peculiar issue: nix build works just fine but when using the flake from my NixOS config I get complaints about Rust version:
error: builder for '/nix/store/p7dajki1blbc0wlsjk86ymh3pi3zh0mk-oblichey-0.0.1.drv' failed with exit code 101;
last 10 log lines:
> Finished cargoSetupPostPatchHook
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Running phase: buildPhase
> Executing cargoBuildHook
> ++ env CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqw
qlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CC_X86_64_UNKNOWN
_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/
bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu HOST_C
C=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/cc HOST_CXX=/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/c++ cargo build -j 8 --ta
rget x86_64-unknown-linux-gnu --frozen --profile release
> error: package `cubecl v0.1.1 (https://github.com/tracel-ai/cubecl?rev=dd274b6515f853ab1c82db410d6fc7697060f69e#dd274b65)` cannot be built because it requires rustc
1.79 or newer, while the currently active rustc version is 1.77.2
> Either upgrade to rustc 1.79 or newer, or use
> cargo update cubecl@0.1.1 --precise ver
> where `ver` is the latest version of `cubecl` supporting rustc 1.77.2
For full logs, run 'nix log /nix/store/p7dajki1blbc0wlsjk86ymh3pi3zh0mk-oblichey-0.0.1.drv'.
error: 1 dependencies of derivation '/nix/store/mxwvym1s7dd4szzs3ccxnwxfx4iqsqbb-ags.pam.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fbzf0cszdcds4h93m52w7sicav68cfa0-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8s9wxgvic20f6pxp5cr6nmii9y25pirl-nixos-system-Simon-s-Tuxedo-InfinityBook-14-Gen8-24.11.20240529.ad57eef.drv' failed to build
Has anyone ever seen this?
(originally posted elsewhere but this room might be more appropriate)I am seeing a peculiar issue: nix build works just fine but when using the flake from my NixOS config I get complaints about Rust version:
| 07:20:15 |
Curid | which rust version does your nixos config use? | 07:31:36 |
Šimon Brandner | Currently none - I made sure I have no rustup, rustc or cargo installed and I am still seeing this... | 07:50:02 |
Šimon Brandner | But seems awfully like the oblichey flake is pulling nixpkgs from my system instead of its own... | 07:51:09 |
Curid | you obviously can't use rust programs without a rust compiler | 07:51:37 |
Šimon Brandner | Well I am using pkgs.rustPlatform.buildRustPackage to build the oblichey flake | 07:52:57 |
Šimon Brandner | Which as far as I understand it should get the correct Rust version and compile in a sandboxed env | 07:53:29 |
Šimon Brandner | The same way it does this when doing nix build | 07:53:40 |
blitz | In reply to @simon.brandner:envs.net But seems awfully like the oblichey flake is pulling nixpkgs from my system instead of its own... Did you use a 'input.nixpkgs.follows' when pulling in the flake? | 08:04:20 |
Šimon Brandner | Nope, it's a simple: oblichey.url = "git+file:///home/simon/GIT/Rust/oblichey"; | 08:04:46 |
Šimon Brandner | I wonder if this is somehow related to a bug I had some time ago: https://github.com/rafaelrc7/wayland-pipewire-idle-inhibit/issues/7 | 08:05:01 |
blitz | Can you post a complete failing example? | 08:06:51 |
Šimon Brandner | Sure!
App flake.nix :
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = {nixpkgs, ...}: let
pkgs = import nixpkgs {system = "x86_64-linux";};
in {
packages.x86_64-linux = {
default = nixpkgs.legacyPackages.${"x86_64-linux"}.callPackage ./nix/package.nix {inherit pkgs;};
devShells.default = import ./nix/shell.nix;
};
nixosModules.default = import ./nix/module.nix;
};
}
package.nix :
{
lib,
pkgs,
}: let
cargoTomlPath = ../Cargo.toml;
cargoTomlContent = builtins.fromTOML (builtins.readFile cargoTomlPath);
in
pkgs.rustPlatform.buildRustPackage rec {
pname = "oblichey";
version = cargoTomlContent.workspace.package.version;
src = lib.cleanSource ../.;
cargoToml = cargoTomlPath;
cargoLock = {
lockFile = ../Cargo.lock;
outputHashes = {
"burn-0.14.0" = "sha256-ChBlLKeq0WuINP+6mfZ0vFMYOKWnqT2dEMuM0UZJnbc=";
"cubecl-0.1.1" = "sha256-tLNC2KRRYrRRKL9HkhTYHg8tvxkJDm9fM8GrSQWNXeM=";
};
};
nativeBuildInputs = with pkgs; [
clang
fontconfig
pkg-config
libxkbcommon
libGL
cmake
wayland
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libX11
vulkan-headers
vulkan-loader
rustfmt
];
buildInputs = with pkgs; [
fontconfig
vulkan-headers
vulkan-loader
pam
];
preInstall = ''
mkdir -p $out/bin
cp -r target/x86_64-unknown-linux-gnu/release/weights $out/bin/weights
'';
postFixup = ''
patchelf --add-rpath ${with pkgs; lib.makeLibraryPath [libGL libxkbcommon wayland vulkan-loader vulkan-headers]}/lib $out/bin/oblichey-cli
'';
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
}
My system flake.nix :
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
oblichey.url = "git+file:///home/simon/GIT/Rust/oblichey";
...
};
outputs = {
nixpkgs,
hyprland,
...
} @ inputs: {
nixosConfigurations = {
"TuxedoInfinityBook14Gen8" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs.inputs = inputs;
modules = [./nixos/machines/TuxedoInfinityBook14Gen8/system.nix];
};
...
};
};
}
./nixos/machines/TuxedoInfinityBook14Gen8/system.nix :
{
config,
lib,
pkgs,
modulesPath,
inputs,
...
}: {
imports = [
../../system.nix
(modulesPath + "/installer/scan/not-detected.nix")
inputs.oblichey.nixosModules.default
...
];
programs.oblichey = {
enable = true;
settings = {
camera = {
path = "/dev/video2";
};
};
};
...
}
| 08:14:25 |
Šimon Brandner | Let me know if this will do | 08:14:40 |
Šimon Brandner | Otherwise I can push some stuff to GitHub | 08:15:00 |
Šimon Brandner | (or add a file here if I forgot something...) | 08:15:30 |
blitz | Do you have module.nix as well? | 08:18:27 |
Šimon Brandner | Sure | 08:18:35 |
Šimon Brandner | {
lib,
config,
pkgs,
...
}: let
cfg = config.programs.oblichey;
in
with lib; {
options.programs.oblichey = {
enable = mkEnableOption "oblichey";
package = mkOption {
type = types.package;
default = pkgs.callPackage ./package.nix {};
description = ''
The oblichey package to use.
'';
};
settings = {
camera = {
path = mkOption {
type = types.str;
description = "Path to the IR camera to be used.";
};
};
};
};
config = mkIf cfg.enable {
environment.etc."oblichey.toml".text = ''
[camera]
path=${cfg.settings.camera.path}
'';
};
}
| 08:19:17 |
blitz | In module.nix you do pkgs.callPackage to build your program. This pkgs is the one where you use the module. I assume this is where your problem comes from | 08:20:30 |
blitz | The quick fix would be in your NixOS config to manually set the package option of this module to the package output of the flake | 08:21:31 |
blitz | This is a pretty common issue with flakes and modules. | 08:21:56 |
samasaur | I think the real fix is running nix flake lock --update-input nixpkgs in your nixos config | 08:22:10 |
blitz | But it 'works as designed' | 08:22:11 |
blitz | Or that :) | 08:22:19 |
Šimon Brandner | Not sure I follow - I would think this would be the pkgs specified in the flake.lock of the app's flake... | 08:23:04 |
Šimon Brandner | In reply to @samasaur:matrix.org I think the real fix is running nix flake lock --update-input nixpkgs in your nixos config (I am blocked by a few things 😅) | 08:23:24 |