File tree 3 files changed +12
-4
lines changed
otherlibs/build-info/test
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 27
27
28
28
- Inline tests are now sandboxed by default (#6079 , @rgrinberg )
29
29
30
+ - Fix build-info version when used with flambda (#6089 , fixes #6075 , @jberdine )
31
+
30
32
3.4.1 (26-07-2022)
31
33
------------------
32
34
Original file line number Diff line number Diff line change @@ -100,9 +100,9 @@ Check what the generated build info module looks like:
100
100
None
101
101
[@@ inline never]
102
102
103
- let p1 = eval " %% DUNE_PLACEHOLDER :64:vcs-describe:1:a%%%%%%%%%%%%%%%%%%%%%%%%%%"
104
- let p2 = eval " %% DUNE_PLACEHOLDER :64:vcs-describe:1:b%%%%%%%%%%%%%%%%%%%%%%%%%%"
105
- let p0 = eval " %% DUNE_PLACEHOLDER :64:vcs-describe:1:c%%%%%%%%%%%%%%%%%%%%%%%%%%"
103
+ let p1 = eval (Sys . opaque_identity " %% DUNE_PLACEHOLDER :64:vcs-describe:1:a%%%%%%%%%%%%%%%%%%%%%%%%%%" )
104
+ let p2 = eval (Sys . opaque_identity " %% DUNE_PLACEHOLDER :64:vcs-describe:1:b%%%%%%%%%%%%%%%%%%%%%%%%%%" )
105
+ let p0 = eval (Sys . opaque_identity " %% DUNE_PLACEHOLDER :64:vcs-describe:1:c%%%%%%%%%%%%%%%%%%%%%%%%%%" )
106
106
107
107
let version = p0
108
108
Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ let build_info_code cctx ~libs ~api_version =
150
150
((Lib. name lib, v) :: libs, placeholders))
151
151
in
152
152
let libs = List. rev libs in
153
+ let context = CC. context cctx in
154
+ let ocaml_version = Ocaml.Version. of_ocaml_config context.ocaml_config in
153
155
let buf = Buffer. create 1024 in
154
156
(* Parse the replacement format described in [artifact_substitution.ml]. *)
155
157
pr buf
@@ -167,7 +169,11 @@ let build_info_code cctx ~libs ~api_version =
167
169
None
168
170
[@@ inline never]
169
171
| ocaml};
170
- let fmt_eval : _ format6 = " let %s = eval %S" in
172
+ let fmt_eval : _ format6 =
173
+ if Ocaml.Version. has_sys_opaque_identity ocaml_version then
174
+ " let %s = eval (Sys.opaque_identity %S)"
175
+ else " let %s = eval %S"
176
+ in
171
177
Path.Source.Map. iteri placeholders ~f: (fun path var ->
172
178
pr buf fmt_eval var
173
179
(Artifact_substitution. encode ~min_len: 64 (Vcs_describe path)));
You can’t perform that action at this time.
0 commit comments