Skip to content
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

Won't build. "alert deprecated". #28

Open
SysGh-st opened this issue Nov 10, 2020 · 3 comments
Open

Won't build. "alert deprecated". #28

SysGh-st opened this issue Nov 10, 2020 · 3 comments

Comments

@SysGh-st
Copy link

SysGh-st commented Nov 10, 2020

I get a bunch of "alert deprecated" errors when trying to build this on Arch. "See attached file."
error.txt

@sashaaaaaaaaa
Copy link

same here on slackware 64 current

@lambdadog
Copy link

lambdadog commented Dec 8, 2020

The full error text is useful in this context so I'm going to go ahead and inline it into this reply at the bottom.

Strictly speaking (alert deprecated) doesn't mean anything other than that a module or function is deprecated and without knowing which module it's not very useful. In this case those deprecated bits are:

  1. module Core_kernel.Unix [since 2020-03]
    • Core_kernel shadows Unix. Use Core.Unix, which overrides some of Unix's behavior. If necessary, Unix is available and unshadowed as Caml_unix.
  2. Core_kernel.sexp_option [since 2019-03]
    • use [@sexp.option] instead
  3. Core_kernel.sexp_list [since 2019-03]
    • use [@sexp.list] instead

Additional notes:

  • Unix.gettimeofday is unbound, probably as a result of Core_kernel.Unix being deprecated so long that they felt it was safe to clean up. (bolded for emphasis)

I'm not the most versed in OCaml, but I wouldn't be surprised if Unix.gettimeofday becoming unbound is the real build error here, seeing as 2 of those deprecations are from March 2019 and haven't been stopping the builds up until now. They mark as errors during the build but I imagine must be more akin to "warnings".

Full text of error.txt

File "src/colors.ml", line 34, characters 27-44:
34 |   let h = Float.mod_float (Unix.gettimeofday ()) period /. period *. 360. in
                                ^^^^^^^^^^^^^^^^^
Error (alert deprecated): module Core_kernel.Unix
[since 2020-03] Core_kernel shadows Unix. Use Core.Unix, which overrides some of Unix's behavior. If necessary, Unix is available and unshadowed as Caml_unix.
File "src/colors.ml", line 34, characters 27-44:
34 |   let h = Float.mod_float (Unix.gettimeofday ()) period /. period *. 360. in
                                ^^^^^^^^^^^^^^^^^
Error: Unbound value Unix.gettimeofday
File "src/splits.ml", line 6, characters 57-74:
6 |     let curr_time = match now with Some t -> t | None -> Unix.gettimeofday () in
                                                             ^^^^^^^^^^^^^^^^^
Error (alert deprecated): module Core_kernel.Unix
[since 2020-03] Core_kernel shadows Unix. Use Core.Unix, which overrides some of Unix's behavior. If necessary, Unix is available and unshadowed as Caml_unix.
File "src/splits.ml", line 6, characters 57-74:
6 |     let curr_time = match now with Some t -> t | None -> Unix.gettimeofday () in
                                                             ^^^^^^^^^^^^^^^^^
Error: Unbound value Unix.gettimeofday
File "src/duration.ml", line 106, characters 22-39:
106 |   between time_float (Unix.gettimeofday ())
                            ^^^^^^^^^^^^^^^^^
Error (alert deprecated): module Core_kernel.Unix
[since 2020-03] Core_kernel shadows Unix. Use Core.Unix, which overrides some of Unix's behavior. If necessary, Unix is available and unshadowed as Caml_unix.
File "src/duration.ml", line 106, characters 22-39:
106 |   between time_float (Unix.gettimeofday ())
                            ^^^^^^^^^^^^^^^^^
Error: Unbound value Unix.gettimeofday
File "src/loadsave.ml", line 5, characters 16-27:
5 |   time : string sexp_option;
                    ^^^^^^^^^^^
Error (alert deprecated): Core_kernel.sexp_option
[since 2019-03] use [@sexp.option] instead
File "src/loadsave.ml", line 24, characters 20-31:
24 |   duration : string sexp_option;
                         ^^^^^^^^^^^
Error (alert deprecated): Core_kernel.sexp_option
[since 2019-03] use [@sexp.option] instead
File "src/loadsave.ml", line 50, characters 21-32:
50 |   golds : gold array sexp_option;
                          ^^^^^^^^^^^
Error (alert deprecated): Core_kernel.sexp_option
[since 2019-03] use [@sexp.option] instead
File "src/loadsave.ml", line 51, characters 31-42:
51 |   personal_best : archived_run sexp_option;
                                    ^^^^^^^^^^^
Error (alert deprecated): Core_kernel.sexp_option
[since 2019-03] use [@sexp.option] instead
File "src/loadsave.ml", line 52, characters 30-41:
52 |   world_record : archived_run sexp_option;
                                   ^^^^^^^^^^^
Error (alert deprecated): Core_kernel.sexp_option
[since 2019-03] use [@sexp.option] instead
File "src/loadsave.ml", line 53, characters 25-34:
53 |   history : archived_run sexp_list;
                              ^^^^^^^^^
Error (alert deprecated): Core_kernel.sexp_list
[since 2019-03] use [@sexp.list] instead
Done: 95/109 (jobs: 1)%

@lambdadog
Copy link

A quick fix is definitely possible for this -- as the deprecation message notes, replacing Core_kernel.Unix with Caml_unix would do it, but I'm not convinced I'd be happy with the idea of leaving two deprecated functions from early 2019 being called in the codebase, and it'd likely be preferable to move over to using Core.Unix as well, because the deprecation message makes it sound much more standardized/"OCaml-ized".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants