-
Notifications
You must be signed in to change notification settings - Fork 1.2k
C-language API permits weaker backward compatibility requirements. #1798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4384918
to
6fa8189
Compare
Sorry, changing the base did not do what I'd hoped - please could you rebase this commit on to trunk? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem in compatibility.h. The rest looks OK.
You also need to rebase to trunk. (and also change the base? I'm not sure)
byterun/caml/memory.h
Outdated
@@ -465,6 +464,8 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ | |||
caml_modify (&Field ((block), caml__temp_offset), caml__temp_val); \ | |||
}while(0) | |||
|
|||
#if CAML_API_VERSION < 400 | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that Begin_roots
and End_roots
are used in code generated by the venerable CamlIDL tool (https://github.com/xavierleroy/camlidl/). The tool hasn't been updated in a long time but still has users. Forcing them to set CAML_API_VERSION
to 312 or something is not nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Now that this is on trunk
and not 4.07
I'll get around to this after my vacation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, first question about this: if the venerable CamlIDL doesn't set CAML_API_VERSION
then it defaults to 100, and Begin_roots
/End_roots
definitions are available accordingly. Am I mistaken?
- Add CAML_API_VERSION parameter in the "caml/compatibility.h" header. - Default value is 100. - Explicitly define CAML_NAME_SPACE if CAML_API_VERSION >= 400. - If CAML_API_VERSION < 403, then also #define caml_stat_heap_xxx_size. - If CAML_API_VERSION < 400, then also #define Modify, Begin_roots, End_roots. - Always include "caml/compatibility.h" from "caml/memory.h" header. - Never include "caml/compatibility.h" from other headers.
6fa8189
to
2f0769e
Compare
I have rebased this on trunk and addressed the "fishy" thing that @damiendoligez noticed. I'm ready to make whatever change @xavierleroy thinks is necessary to keep CamlIDL from being damaged, but I'm not sure I know what to do there. |
My problem is that I'm not sure what CAML_API_VERSION=100 means:
CamlIDL is a case where we need both old APIs (for code generated by CamlIDL) and newer APIs (for code hand-written by users to do things that CamlIDL cannot handle). |
I had this problem too, and I agree it's confusing. Here's a proposal, which I hope perhaps @stedolan or somebody else more central to the multicore effort will review, that would expand the set of configuration variables used for API backward compatibility selection.
This would allow consumers of the runtime API A) to assert their minimum API compatibility using definitions of the |
Gentle acknowledgement that I'm still holding the ball on this problem, and I'm not sure what to do with it. |
If I understand correctly, your |
That's what I think I was doing, yes. Again, I'm not sure this pull request is really the appropriate way to address the underlying problem, or even if the underlying problem is important enough to address. My interest in it developed when I tried to make some of my personal code with a few C-language foreign functions in it compile under the Multicore OCaml branch, which seems like it will need something in the runtime interface that allows extension implementations to compile according to the version of the runtime available. |
When I get a few spare cycles next, I'll see about resolving those merge conflicts. |
@johnwhitington will be this part of the 4.10 by any chance? |
@XVilka I assume that was autocomplete for @jhwoodyatt :-) |
Yes, sorry about that. |
This is superseded by #9167 in case it is accepted. Please see the discussion there. |
I'm tracking the progress of #9167 and will withdraw this if that achieves consensus. |
Abandoning this request as the basic concern was more recently considered in #9167 and keeping this open when that has been closed seems unnecessary. |
* Figma colors tailwind.config.js, old colors->legacy, tutorial block, hero section * split hero background in background and camel, scale background * remove featured+rating on book, book difficulty variant type, lang manual banner draft, books block draft * add two more book recommendations * exercises block * language manual banner background * better book recommendation text * move industrial user success story card to template * platform tools section learn landing, rename legacy cards class * update border color from Figma, adjust card hover shadow, transform paper cards to new class * refactor footer * refactor learn_sidebar into learn_layout * buttons from design system, substitute legacy primary by new primary, books page * exercises.eml * legacy primary-600 and primary-700 to new primary color
Change to the C-language API extracted from #1003 for introducing the CAML_API_VERSION mechanism to improve control of the backward compatibility requirement.