File tree Expand file tree Collapse file tree 6 files changed +48
-1
lines changed Expand file tree Collapse file tree 6 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 2626
2727 luaDrv = originalLuaDrv . overrideAttrs ( oa : {
2828 version = attrs . version or oa . version ;
29+ __intentionallyOverridingVersion = true ;
2930 rockspecVersion = oa . rockspecVersion ;
3031
3132 extraConfig = ''
4344 lua . pkgs . luarocksMoveDataFolder
4445 ] ;
4546 version = "${ originalLuaDrv . version } -unstable-${ oa . version } " ;
47+ __intentionallyOverridingVersion = true ;
4648 }
4749 )
4850 ) ;
Original file line number Diff line number Diff line change 6767
6868 cef = cef-binary . overrideAttrs ( oldAttrs : {
6969 version = "127.3.5" ;
70+ __intentionallyOverridingVersion = true ; # `cef-binary` uses the overridden `srcHash` values in its source FOD
7071 gitRevision = "114ea2a" ;
7172 chromiumVersion = "127.0.6533.120" ;
7273
Original file line number Diff line number Diff line change 2323let
2424 cef = cef-binary . overrideAttrs ( oldAttrs : {
2525 version = "126.2.18" ;
26+ __intentionallyOverridingVersion = true ; # `cef-binary` uses the overridden `srcHash` values in its source FOD
2627 gitRevision = "3647d39" ;
2728 chromiumVersion = "126.0.6478.183" ;
2829
Original file line number Diff line number Diff line change 3333let
3434 cef = cef-binary . overrideAttrs ( oldAttrs : {
3535 version = "120.1.10" ;
36+ __intentionallyOverridingVersion = true ; # `cef-binary` uses the overridden `srcHash` values in its source FOD
3637 gitRevision = "3ce3184" ;
3738 chromiumVersion = "120.0.6099.129" ;
3839
Original file line number Diff line number Diff line change 109109 rev = lib . last ( lib . splitString "-" ( lib . last rel ) ) ;
110110 in
111111 "${ date } -${ rev } " ;
112+ __intentionallyOverridingVersion = true ;
112113
113114 meta . broken = luaOlder "5.1" || luaAtLeast "5.5" ;
114115
Original file line number Diff line number Diff line change 8787 args = rattrs ( args // { inherit finalPackage overrideAttrs ; } ) ;
8888 # ^^^^
8989
90- overrideAttrs = f0 : makeDerivationExtensible ( lib . extends ( lib . toExtension f0 ) rattrs ) ;
90+ overrideAttrs =
91+ f0 :
92+ let
93+ extends' =
94+ overlay : f :
95+ (
96+ final :
97+ let
98+ prev = f final ;
99+ thisOverlay = overlay final prev ;
100+ warnForBadVersionOverride = (
101+ thisOverlay ? version
102+ && ! ( thisOverlay ? src )
103+ && ! ( thisOverlay . __intentionallyOverridingVersion or false )
104+ ) ;
105+ pname = args . pname or "<unknown name>" ;
106+ version = args . version or "<unknown version>" ;
107+ pos = builtins . unsafeGetAttrPos "version" thisOverlay ;
108+ in
109+ lib . warnIf warnForBadVersionOverride ''
110+ ${
111+ args . name or "${ pname } -${ version } "
112+ } was overridden with `version` but not `src` at ${ pos . file or "<unknown file>" } :${
113+ builtins . toString pos . line or "<unknown line>"
114+ } :${ builtins . toString pos . column or "<unknown column>" } .
115+
116+ This is most likely not what you want. In order to properly change the version of a package, override
117+ both the `version` and `src` attributes:
118+
119+ hello.overrideAttrs (oldAttrs: rec {
120+ version = "1.0.0";
121+ src = pkgs.fetchurl {
122+ url = "mirror://gnu/hello/hello-'' ${version}.tar.gz";
123+ hash = "...";
124+ };
125+ })
126+
127+ (To silence this warning, set `__intentionallyOverridingVersion = true` in your `overrideAttrs` call.)
128+ '' ( prev // ( builtins . removeAttrs thisOverlay [ "__intentionallyOverridingVersion" ] ) )
129+ ) ;
130+ in
131+ makeDerivationExtensible ( extends' ( lib . toExtension f0 ) rattrs ) ;
91132
92133 finalPackage = mkDerivationSimple overrideAttrs args ;
93134
You can’t perform that action at this time.
0 commit comments