Commit a216344 1 parent 2a07dec commit a216344 Copy full SHA for a216344
File tree 4 files changed +16
-7
lines changed
4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 94
94
## Opamfile
95
95
* Make all writes atomic [ #5489 @kit-ty-kate ]
96
96
* Propagate future opamfile parse errors correctly [ #6199 @dra27 ]
97
+ * Ensure future syntax errors are only reported when the syntax version is greater than the client, not the format library [ #6199 @dra27 - fix #6188 ]
97
98
98
99
## External dependencies
99
100
* Always pass --no-version-check and --no-write-registry to Cygwin setup [ #6046 @dra27 ]
Original file line number Diff line number Diff line change @@ -874,9 +874,17 @@ module Syntax = struct
874
874
let filename = OpamFilename. to_string filename in
875
875
lexbuf.Lexing. lex_curr_p < - { lexbuf.Lexing. lex_curr_p with
876
876
Lexing. pos_fname = filename };
877
- try OpamParser. main OpamLexer. token lexbuf filename with
878
- | OpamLexer. Error msg -> error msg
879
- | Parsing. Parse_error -> error " Parse error"
877
+ match OpamParser. main OpamLexer. token lexbuf filename with
878
+ | {file_contents =
879
+ [{pelem = Variable ({pelem = " opam-version" ; _},
880
+ {pelem = String ver; _}); _ };
881
+ {pelem = Section {section_kind = {pelem = " #" ; _}; _}; _}]; _}
882
+ when OpamVersion. (compare (nopatch (of_string ver))
883
+ (nopatch OpamVersion. current)) < = 0 ->
884
+ error " Parse error"
885
+ | opamfile -> opamfile
886
+ | exception OpamLexer. Error msg -> error msg
887
+ | exception Parsing. Parse_error -> error " Parse error"
880
888
881
889
882
890
let pp_channel filename ic oc =
Original file line number Diff line number Diff line change @@ -1267,11 +1267,11 @@ ${BASEDIR}/future/pin-at-two-one.opam: Errors.
1267
1267
# Return code 1 #
1268
1268
### opam lint future/pin-at-two-two.opam
1269
1269
${BASEDIR}/future/pin-at-two-two.opam: Errors.
1270
- error 2: File format error: unsupported or missing file format version; should be 2.0 or older
1270
+ error 2: File format error at line 11, column 0: Parse error
1271
1271
# Return code 1 #
1272
1272
### opam lint future/pin-at-two-three.opam
1273
1273
${BASEDIR}/future/pin-at-two-three.opam: Errors.
1274
- error 2: File format error: unsupported or missing file format version; should be 2.0 or older
1274
+ error 2: File format error at line 11, column 0: Parse error
1275
1275
# Return code 1 #
1276
1276
### opam lint future/pin-at-future.opam
1277
1277
${BASEDIR}/future/pin-at-future.opam: Errors.
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ echo GARBAGE>>"$1"
353
353
Parse error [skipped]
354
354
355
355
[ERROR] Invalid opam file in pin-at-two-two source from file://${BASEDIR}/pin-at-two-two:
356
- error 2: File format error: unsupported or missing file format version; should be 2.0 or older
356
+ error 2: File format error at line 11, column 0: Parse error
357
357
[ERROR] No package named pin-at-two-two found.
358
358
# Return code 5 #
359
359
### sh junk.sh pin-at-two-three/pin-at-two-three.opam
@@ -367,7 +367,7 @@ echo GARBAGE>>"$1"
367
367
Parse error [skipped]
368
368
369
369
[ERROR] Invalid opam file in pin-at-two-three source from file://${BASEDIR}/pin-at-two-three:
370
- error 2: File format error: unsupported or missing file format version; should be 2.0 or older
370
+ error 2: File format error at line 11, column 0: Parse error
371
371
[ERROR] No package named pin-at-two-three found.
372
372
# Return code 5 #
373
373
### sh junk.sh pin-at-future/pin-at-future.opam
You can’t perform that action at this time.
0 commit comments