Provides better compatibility for primitive %string_safe_set#772
Provides better compatibility for primitive %string_safe_set#772bobzhang wants to merge 4 commits intoocaml:4.04from
Conversation
Changes
Outdated
| - GPR#772 %string_safe_set is treated the same as %bytes_safe_set, | ||
| and %string_safe_set is only used to set bytes instead of string, it is | ||
| strongly recommended to use `%bytes_safe_set`, `%string_safe_set` | ||
| maybe removed in the future. |
|
I'm in favor of not breaking existing code, but I believe that only the change in translcore.ml is required to achieve that. (And bootstrapping does not seem required either.) |
|
I agree with Alain. |
|
To clarify: the compatibility breakage I've seen in the wild comes from changing the primitive name of the string-related externals, which are advertised in the interfaces of some libraries that basically |
|
I don't have opinions here, my current PR will not break any existing code, should we use "%bytes_safe_set" somewhere, like |
|
Yes, I think I think that once this PR lands in 4.04 it would be nice to have a second beta to fish out the remaining issues -- there are already a few fixes in the branch that it would be nice to have users test. I updated Batteries with the post-#596 state (changing all |
Thanks, I see. This could also be addressed by having the compiler normalize %string_safe_set to %bytes_safe_set early enough so as not to break the inclusion check, but I'm also ok with the current solution. Any opposition to merging this PR in its current state? |
|
Code-wise, I like the current state -- I haven't checked yet that it does restore buildability of affected packages but we can always adjust after the fact. Do we need the bootstrap part? |
|
we need do at least one bootstrap pass, doing once is the same as doing twice. (I did it twice just in case) |
|
I am in favour of this patch, having recently encountered this breakage... |
|
@damiendoligez can we get this into 4.04? Thinking about this, I think that a reviewed version of the |
|
@gasche let me test this PR. It seems to me that |
|
completed and removed the bootstrap, then merged into 4.04 (commit 9b0da03) Now the |
|
(Batteries hasn't had a release with the previous primitive states so there is no compatibility issues with rolling back the changes. If users took the habit of following trunk more closely, some of them would similarly have to roll back on changes we cancel for compatibility reasons.) |
See ocaml/ocaml#772 "Provides better compatibility for primitive %string_safe_set #772" ocaml/ocaml#772
Now %string_safe_set is treated the same as %bytes_safe_set, and %string_safe_set is only used to set
bytesinstead ofstringThis is a follow-up of GRP #596