Qtbase is provided by qt5.qtbase defined here. After spending days trying different things, I have been unable to stop -O3 from getting added to qtbase.
I think I had tried this before. Here’s what I get:
$ sudo nix-instantiate '<nixpkgs/nixos>' -A system --show-trace
error: while evaluating the attribute 'activationScript' of the derivation 'nixos-system-illustris-thinkpad-20.09.2016.19db3e5ea27' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:95:5:
while evaluating the attribute 'system.activationScripts.script' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:68:9:
while evaluating 'textClosureMap' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings-with-deps.nix:70:35, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:89:18:
while evaluating 'id' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:14:5, called from undefined position:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:9:5:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings-with-deps.nix:77:38:
while evaluating the attribute 'sources' of the derivation 'etc' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:12:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute 'source' at undefined position:
while evaluating 'g' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:98:72, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:465:9:
while evaluating the option `environment.etc.dbus-1.source':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:497:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:499:17, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:499:12:
while evaluating 'check' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:256:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:499:22:
while evaluating the attribute 'serviceDirectories' of the derivation 'dbus-1' at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:265:14, called from undefined position:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:510:27:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:499:17, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:499:12:
while evaluating 'check' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:256:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:499:22:
while evaluating the attribute 'passAsFile' of the derivation 'system-path' at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating the attribute 'out.outPath' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/customisation.nix:156:13:
while evaluating the attribute 'buildInputs' of the derivation 'virt-manager-2.2.1' at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/development/interpreters/python/mk-python-derivation.nix:108:5:
while evaluating the attribute 'propagatedBuildInputs' of the derivation 'spice-gtk-0.37' at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'buildInputs' of the derivation 'gst-plugins-good-1.16.2' at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating 'getOutput' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:464:23, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/stdenv/generic/make-derivation.nix:143:17, called from undefined position:
while evaluating 'addMetaAttrs' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/meta.nix:15:28, called from /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/top-level/all-packages.nix:14107:12:
attribute 'callPackage' missing, at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/top-level/all-packages.nix:18577:15
The line mentioned in the error is pkgs/top-level/all-packages.nix:18577:
But if you’re modifying nixpkgs this extensively, it will probably be easier to use a modified nixpkgs directly rather than try to make the changes you need via overlays
Thanks! This made some progress.
Instead of appending O2 (which would be ignored in favor of the O3 already present), I replaced it with the value it would otherwise have
This partially works. Now there are two instances of qtbase-5.15.0.drv, one with “-march=skylake -O3” and the other with “-march=skylake”.
The immediate parents of the O3 one are:
I mean git cloning the nixpkgs repo, making the changes you need locally, and setting export NIX_PATH=nixpkgs=/path/to/your/checkout so that nix commands use your local clone instead of whatever channel you are currently using.