libcosmicAppHook: use RUSTFLAGS instead of platform specific flags#464981
libcosmicAppHook: use RUSTFLAGS instead of platform specific flags#464981Aleksanaa merged 1 commit intoNixOS:masterfrom
Conversation
This ensures these flags are picked up correctly, after latest rust update. We can revert this if we solve the root cause later. See NixOS#464392
|
|
||
| # Temporarily use this simpler solution, it should work for simple cross compilation | ||
| # https://github.com/NixOS/nixpkgs/issues/464392 | ||
| local flags="RUSTFLAGS" |
There was a problem hiding this comment.
I don't think it will? It'll cause build scripts to try to link a bunch of libraries that won't be present for the build platform.
We need to understand what's actually changed here and why.
There was a problem hiding this comment.
From a simple search, we can see that this is the only one in nixpkgs that uses platform-specific RUSTFLAGS, while others only use RUSTFLAGS:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/li/libkrun/package.nix
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/as/asusctl/package.nix
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/al/alvr/package.nix
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/wo/woomer/package.nix
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/ve/veridian/package.nix
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/mi/miro/package.nix
There was a problem hiding this comment.
If the --target flag (or build.target) is used, then the flags will only be passed to the compiler for the target. Things being built for the host, such as build scripts or proc macros, will not receive the args. Without --target, the flags will be passed to all compiler invocations (including build scripts and proc macros) because dependencies are shared. If you have args that you do not want to pass to build scripts or proc macros and are building for the host, pass --target with the host triple.
Okay, so we just end up with extra linkage on build scripts and proc macros. That would still be best avoided, and so we should still be using the target-specific variables across the board once we figure out how to make them work again, but it's not urgent.
|
@ofborg test cosmic |
|
If this does fix the issue it should be backported |
|
I can confirm that |
|
Successfully created backport PR for |
…flags (NixOS#464981)" This reverts commit d2c6221. PR NixOS#464981 changed libcosmicAppHook to use the global RUSTFLAGS instead of target-specific CARGO_TARGET_*_RUSTFLAGS as a workaround for issue PR NixOS#464392. However, this broke cross-compilation for packages using the crabtime procedural macro (like cosmic-initial-setup). The root cause was that buildRustPackage was always setting env.RUSTFLAGS, which shadowed the target-specific flags. This has been fixed in commit PR NixOS#464707, which only sets RUSTFLAGS when explicitly needed. Fixes cross-compilation of cosmic-initial-setup and other cosmic packages that use crabtime proc macros. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
…flags (NixOS#464981)" This reverts commit d2c6221. PR NixOS#464981 changed libcosmicAppHook to use the global RUSTFLAGS instead of target-specific CARGO_TARGET_*_RUSTFLAGS as a workaround for issue PR NixOS#464392. However, this broke cross-compilation for packages using the crabtime procedural macro (like cosmic-initial-setup). The root cause was that buildRustPackage was always setting env.RUSTFLAGS, which shadowed the target-specific flags. This has been fixed in commit PR NixOS#464707, which only sets RUSTFLAGS when explicitly needed. Fixes cross-compilation of cosmic-initial-setup and other cosmic packages that use crabtime proc macros. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
…flags (NixOS#464981)" This reverts commit d2c6221. PR NixOS#464981 changed libcosmicAppHook to use the global RUSTFLAGS instead of target-specific CARGO_TARGET_*_RUSTFLAGS as a workaround for issue PR NixOS#464392. However, this broke cross-compilation for packages using the crabtime procedural macro (like cosmic-initial-setup). The root cause was that buildRustPackage was always setting env.RUSTFLAGS, which shadowed the target-specific flags. This has been fixed in commit PR NixOS#464707, which only sets RUSTFLAGS when explicitly needed. Fixes cross-compilation of cosmic-initial-setup and other cosmic packages that use crabtime proc macros. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
…flags (NixOS#464981)" This reverts commit d2c6221. PR NixOS#464981 changed libcosmicAppHook to use the global RUSTFLAGS instead of target-specific CARGO_TARGET_*_RUSTFLAGS as a workaround for issue PR NixOS#464392. However, this broke cross-compilation for packages using the crabtime procedural macro (like cosmic-initial-setup). The root cause was that buildRustPackage was always setting env.RUSTFLAGS, which shadowed the target-specific flags. This has been fixed in commit PR NixOS#464707, which only sets RUSTFLAGS when explicitly needed. Fixes cross-compilation of cosmic-initial-setup and other cosmic packages that use crabtime proc macros. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
…flags (NixOS#464981)" This reverts commit d2c6221. PR NixOS#464981 changed libcosmicAppHook to use the global RUSTFLAGS instead of target-specific CARGO_TARGET_*_RUSTFLAGS as a workaround for issue PR NixOS#464392. However, this broke cross-compilation for packages using the crabtime procedural macro (like cosmic-initial-setup). The root cause was that buildRustPackage was always setting env.RUSTFLAGS, which shadowed the target-specific flags. This has been fixed in commit PR NixOS#464707, which only sets RUSTFLAGS when explicitly needed. Fixes cross-compilation of cosmic-initial-setup and other cosmic packages that use crabtime proc macros. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
…flags (NixOS#464981)" This reverts commit d2c6221. PR NixOS#464981 changed libcosmicAppHook to use the global RUSTFLAGS instead of target-specific CARGO_TARGET_*_RUSTFLAGS as a workaround for issue PR NixOS#464392. However, this broke cross-compilation for packages using the crabtime procedural macro (like cosmic-initial-setup). The root cause was that buildRustPackage was always setting env.RUSTFLAGS, which shadowed the target-specific flags. This has been fixed in commit PR NixOS#464707, which only sets RUSTFLAGS when explicitly needed. Fixes cross-compilation of cosmic-initial-setup and other cosmic packages that use crabtime proc macros. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
This ensures these flags are picked up correctly, after latest rust update. We can revert this if we solve the root cause later.
See #464392
Temporary fix? But a fix, anyway. Tested
cosmic-settingsandcosmic-edit, the rpath and NEEDED libraries forlibEGL.so.1and others are added correctly.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.