@@ -95,6 +95,52 @@ import, same as the ``.local`` file for projects.
9595 ``.local `` file is imported last, after the ``.freeze `` file, giving the
9696 user a final say in the setting of any fields that have override semantics.
9797
98+ .. Warning ::
99+
100+ A project or package that may build with a variety of compiler versions will
101+ be locked to a particular compiler version by freezing. For instance, if
102+ ``cabal init `` is used to create an executable package,
103+ ``unconstrained-base-exe.cabal ``, after removing version constraints on base
104+ it can be frozen with various compiler versions that will each bring in
105+ their set of boot libraries as dependencies.
106+
107+ .. code-block :: cabal
108+
109+ executable unconstrained-base-exe
110+ build-depends: base >0
111+
112+ .. code-block :: diff
113+
114+ $ cabal freeze --with-compiler=ghc-8.10.7
115+ $ mv cabal.project.freeze ghc-8.10.7.freeze
116+
117+ $ cabal freeze --with-compiler=ghc-9.10.1
118+ $ mv cabal.project.freeze ghc-9.10.1.freeze
119+
120+ $ cabal freeze --with-compiler=ghc-9.12.1
121+ $ mv cabal.project.freeze ghc-9.12.1.freeze
122+
123+ $ diff ghc-8.10.7.freeze ghc-9.12.1.freeze --unified
124+ -constraints: any.base ==4.14.3.0,
125+ - any.ghc-prim ==0.6.1,
126+ - any.integer-gmp ==1.0.3.0,
127+ - any.rts ==1.0.1
128+ +constraints: any.base ==4.21.0.0,
129+ + any.ghc-bignum ==1.3,
130+ + any.ghc-internal ==9.1201.0,
131+ + any.ghc-prim ==0.13.0,
132+ + any.rts ==1.0.2
133+
134+ $ diff ghc-9.10.1.freeze ghc-9.12.1.freeze --unified
135+ -constraints: any.base ==4.20.0.0,
136+ +constraints: any.base ==4.21.0.0,
137+ any.ghc-bignum ==1.3,
138+ - any.ghc-internal ==9.1001.0,
139+ - any.ghc-prim ==0.11.0,
140+ + any.ghc-internal ==9.1201.0,
141+ + any.ghc-prim ==0.13.0,
142+ any.rts ==1.0.2
143+
98144 Do you need to freeze?
99145^^^^^^^^^^^^^^^^^^^^^^
100146
0 commit comments