Fixes: Env var & delimiters, unversionned opam file pin, doc#3404
Fixes: Env var & delimiters, unversionned opam file pin, doc#3404rjbou merged 5 commits intoocaml:masterfrom
Conversation
src/core/opamJson.ml
Outdated
| | '\\' -> flush b start i; adds b "\\\\"; loop next next | ||
| | '\x00' .. '\x1F' | '\x7F' (* US-ASCII control chars *) as c -> | ||
| | '\x00' .. '\x1F' | '\x7F' (* US-ASCII control chars *) | ||
| | '\x80' .. '\xFF' (* Extended ASCII chars *) as c -> |
There was a problem hiding this comment.
You can't do this here, this will break UTF-8 output. The module assumes strings are UTF-8 encoded.
Btw. could you please make one PR per issue you fix.
AltGr
left a comment
There was a problem hiding this comment.
Awesome, thanks! I'll trust you have checked the many corner-cases :)
| OpamConsole.warning | ||
| "Couldn't retrieve opam file from versionned source, \ | ||
| using the one found locally."; | ||
| Some local |
There was a problem hiding this comment.
I am wondering if the case when both are defined and different (Some local, Some vers when local <> vers; or maybe when not (OpamFile.OPAM.effectively_equal local vers)) would not deserve a warning too: "not using uncommitted version of opam file xxx".
But there is already the warning about uncommitted changes, so that might be redundant.
There was a problem hiding this comment.
I really think this "fix" muddies again the semantis of git pins and should not be merged. I don't see a clear ux benefit in doing so.
There was a problem hiding this comment.
@AltGr It would be complementary: on update, uncommitted changes warning is shown, in pinning, uncommitted opam changes warning is shown.
|
Also on #3403 I wonder if there's really anything to fix. For me it works as expected, a |
|
@dbuenzli there was still a consistency problem, because then we shouldn't use the non-versionned |
Then why do you use the non-versionned With this the system becomes idiosyncratic to understand. Now if I have an |
See also #3408 I really think the way this is done too complicated and should be carefully reviewed (better, documented so that one can see if one can explains the behaviour in simple words, which will inform the design). I think the confusion by @bobbypriambodo in #3403 is a confusion due to a change in defaults (and it's right to be confused by a change in defaults), I don't think it's a confusion in expectations. |
I confirm this, it did throw me off because I remembered opam v1.2 worked that way. However I do agree with @dbuenzli that the behavior is consistent and reasonable. Perhaps it only warrants a documentation and/or a warning if opam cannot find an |
Indeed, it should be added in the new documentation. For the UX part, user is alerted by messages when uncommitted changes are discarded on upgrade, when an unversioned opam file is taken on pinning, when uncommitted opam file changes are discarded, etc. |
This PR closes #3391.
OpamStd.split_delimimplementation which had the same behaviour thanOpamStd.split. Now they respectively keep & clean empty strings from the returned list.OpamStd.Sys.split_path_variable, permiiting to retrieve a cleaned path or no.edit:
Fix # 3398: Escape json extended ascii characters