-
Notifications
You must be signed in to change notification settings - Fork 90
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
4.08 support #193
4.08 support #193
Conversation
This bumps the lower bound on OCaml from 4.02 to 4.02.2. Debian stable uses 4.02.3, and Debian oldstable uses 4.01 so it was already not covered.
Sorry, obviously #195 should be a part of this. |
I included #195 in the PR, thanks! Let's see what the CI results are. |
type nonrec 'a lazy_t = 'a lazy_t | ||
type nonrec bytes = bytes | ||
|
||
#if OCAML_VERSION >= (4, 08, 0) |
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, this is merged and published, so I don't know if this is the best place to raise this — but using cppo
in the runtime, specifically, is going to cause me … a whole, whole lot of problems over in bs-deriving
land (not in the least, because #if OCAML_VERSION
actually already means something over there — with a different semantic!). )=
Not y'all's problem, of course; but before I go try and make my rickety, arcane build-system about ten times as rickety and arcane as it already is … is there any chance there's an easy, alternative way to do this upstream? Since this is the only occurrence in the runtime?
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 happy to try to make the bs-deriving life easier, but I'm worried that there may not be a very easy way to avoid having two different logics here -- it's solving several delicate problems (deprecation of Pervasives
, semantics of include
, etc.) and it is actually scoping over most of the runtime definition, not just a small part of it.
What would be your recommendation for a conditional-compilation approach that works with both cppo and bspp? Would you avoid all in-file logic and use two different .ml
, selected by the build system?
Maybe it is possible to use both build systems to define one variable (OCAML_VERSION_GTE_408
), and use a test on that variable in a syntax that is compatible with both preprocessors?
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.
Hmmmmmmmmmm. Well, I'd like to avoid "partially upstreaming" bs-deriving (in the sense of making weird changes like adding OCAML_VERSION_but_not_because_some_other_thing_not_related_to_this_codebase_is_weird
, that you've then gotta document somewhere, test, avoid breaking in the future …)
If OCAML_VERSION
is idiomatic in the way it's used here, I'm not sure what to do; I'm not exactly a high-wizard of OCaml, unfortunately, just a dude gluing some stuff together. Poorly. 🤣
Two files might work, but is still teetering on just … upstreaming the maintenance burden. I was mostly, vaguely hoping that “hey! wow! there just happen to be two equally-good ways to do this upstream, and the other one won't be as big a problem for Elliott! Yay!”, but doesn't look like it.
I'm gonna keep this in mind and ruminate on it for a while; maybe I can figure something simple out in the coming weeks. (Thanks for the quick replies, by the way!)
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 don't personally mind having some changes in the upstream repo that are solely justified by bs-deriving, especially if they only touch the implementation (so we have to document the code but the end-users will not see a difference). I would keep the extra-maintenance-burden in mind, but maybe there is a way that works and isn't actually that burdensome.
(Yes, OCAML_VERSION
is used in the idiomatic way here. I think it would have made sense for the Bucklescript people to use the de-facto standard syntax of cppo in their preprocessor syntax, but well...)
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.
(Note that I've opened rescript-lang/rescript#3820 about this.)
CHANGES: 5.0 (26/10/2020) ---------------- * Migrate to ppxlib ocaml-ppx/ppx_deriving#206, ocaml-ppx/ppx_deriving#210 (Anton Kochkov, Gabriel Scherer, Thierry Martinez) 4.5 --- * Add support for OCaml 4.11. - `Ppx_deriving.string_of_{constant,expression}_opt` to destruct `Pconst_string` in a version-independent way ocaml-ppx/ppx_deriving#220, ocaml-ppx/ppx_deriving#222 (Kate Deplaix, Thierry Martinez, review by Gabriel Scherer) * Stronger type equalities in `Ppx_deriving_runtime` (for instance, `Ppx_deriving_runtime.result` and `Result.result` are now compatible with all OCaml versions) ocaml-ppx/ppx_deriving#223, ocaml-ppx/ppx_deriving#225 (Thierry Martinez, review by Gabriel Scherer) * `Ppx_deriving_runtime.Option` compatibility module ocaml-ppx/ppx_deriving#222 (Thierry Martinez, review by Gabriel Scherer) 4.4.1 ----- * Add support for OCaml 4.10 ocaml-ppx/ppx_deriving#211 (Kate Deplaix, review by Gabriel Scherer) 4.4 --- * Restore support for OCaml 4.02.3 ocaml-ppx/ppx_deriving#188 (ELLIOTTCABLE) * workaround Location.input_filename being empty when using reason-language-server ocaml-ppx/ppx_deriving#196 (Ryan Artecona) * Add support for OCaml 4.08.0 ocaml-ppx/ppx_deriving#193, ocaml-ppx/ppx_deriving#197, ocaml-ppx/ppx_deriving#200 (Gabriel Scherer) 4.3 --- * use Format through Ppx_deriving_runtime to avoid deprecation warning for users of JaneStreet Base (Stephen Bastians and Gabriel Scherer, review by whitequark) * silence a ambiguous-field warning (41) in generated code ocaml-ppx/ppx_deriving#163 (Étienne Millon, review by Gabriel Scherer) * use dune ocaml-ppx/ppx_deriving#170 (Rudi Grinberg, Jérémie Dimino) * silence an unused-value warning for show ocaml-ppx/ppx_deriving#179 (Nathan Rebours) 4.2.1 ----- * Add support for OCaml 4.06.0 ocaml-ppx/ppx_deriving#154, ocaml-ppx/ppx_deriving#155, ocaml-ppx/ppx_deriving#156, ocaml-ppx/ppx_deriving#159 (Gabriel Scherer, Fabian, Leonid Rozenberg) * Consider { with_path = false } when printing record fields ocaml-ppx/ppx_deriving#157 (François Pottier) 4.2 --- * Add support for OCaml 4.05.0. * Use the `ocaml-migrate-parsetree` library to support multiple versions of OCaml. * Fix comparison order of fields in records (ocaml-ppx/ppx_deriving#136). * Silence an `unused rec flag` warning in generated code (ocaml-ppx/ppx_deriving#137). * Monomorphize comparison function for builtin types (ocaml-ppx/ppx_deriving#115) * Raise an error when `type nonrec` is encountered (ocaml-ppx/ppx_deriving#116). * Display an error message when dynamic package loading fails. * Add a `with_path` option to `@@deriving` to skip the module path in generated code (ocaml-ppx/ppx_deriving#120). The homepage for the project has now moved to: <https://github.com/ocaml-ppx/ppx_deriving> 4.1 --- * Fix type error with inheritied polymorphic variant type in [@@deriving map]. * Fix incorrect handling of multi-argument constructors in [@@deriving show]. * Add API hooks for ppx_type_conv. 4.0 --- * Show, eq, ord, map, iter, fold: add support for `Result.result`. * Ppx_deriving.Arg: use Result.result instead of polymorphic variants. * Ppx_deriving.sanitize: parameterize over an opened module. * Add support for `[@@deriving]` in module type declarations. * Add support for loading findlib packages instead of just files in ppx_deriving_main. * Treat types explicitly qualified with Pervasives also as builtin. * Compatibility with statically linked ppx drivers. 3.1 --- * Show, eq, ord: hygienically invoke functions from referenced modules (such as X.pp for X.t when deriving show) to coexist with modules shadowing ones from standard library. * Iter, map, fold: hygienically invoke List and Array functions. 3.0 --- * Implement hygiene: Ppx_deriving.{create_quoter,quote,sanitize,with_quoter}. * Show, eq, ord: add support for `lazy_t`. * Add support for `[@nobuiltin]` attribute. * Add Ppx_deriving.hash_variant. * Remove allow_std_type_shadowing option. * Remove Ppx_deriving.extract_typename_of_type_group. 2.1 --- * Fix breakage occurring with 4.02.2 w.r.t record labels * Fix prefixed attribute names (`[@deriving.foo.attr]` and `[@foo.attr]`). * Add allow_std_type_shadowing option for eq and show. 2.0 --- * Add support for open types. 1.1 --- * New plugin: create. * Show, eq, ord: handle `_`. * Show, eq, ord, map, iter, fold: handle inheriting from a parametric polymorphic variant type. * Make `Ppx_deriving.poly_{fun,arrow}_of_type_decl` construct functions in correct order. This also fixes all derivers with types with more than one parameter. * Add `Ppx_deriving.fold_{left,right}_type_decl`. 1.0 --- * Make deriver names lowercase. * Remove Findlib+dynlink integration. All derivers must now be explicitly required. * Allow shortening [%derive.x:] to [%x:] when deriver x exists. * Make `Ppx_deriving.core_type` field optional to allow ignoring unsupported [%x:] shorthands. * Add support for [@@deriving foo { optional = true }] that does not error out if foo is missing, useful for optional dependencies. * Rename ~name and ~prefix of `Ppx_deriving.attr` and `Ppx_deriving.Arg.payload` to `~deriver`. * Renamed `Ppx_deriving.Arg.payload` to `get_attr`. * Add `Ppx_deriving.Arg.get_expr` and `get_flag`. 0.3 --- * Show, Eq, Ord, Iter, Fold: handle ref. * Show: handle functions. * Show: include break hints in format strings. * Show: pull fprintf into local environment. * Show: add `[@polyprinter]` and `[@opaque]`. * Add `Ppx_deriving.Arg.expr`. 0.2 --- * New plugins: Enum, Iter, Map, Fold. * All plugins: don't concatenate affix if type is named `t`. * Add `[%derive.Foo:]` shorthand. * Show, Eq, Ord: add support for list, array, option. * Show: include full module path in output, including for types with manifest. * A lot of changes in `Ppx_deriving interface`. 0.1 --- * Initial release.
No description provided.