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

Restore compatibility with 4.02 #5381

Merged
merged 3 commits into from
Jan 26, 2022
Merged

Conversation

nojb
Copy link
Collaborator

@nojb nojb commented Jan 25, 2022

I did some brief testing on my side, but would appreciate confirmation from some other dev (especially if this is not being tested in the CI).

@ejgallego ejgallego added this to the 2.9.3 milestone Jan 25, 2022
@ejgallego ejgallego self-assigned this Jan 25, 2022
Copy link
Collaborator

@ejgallego ejgallego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a changelog entry ?

This reverts commit 3f08057.

Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
CHANGES.md Show resolved Hide resolved
@nojb nojb force-pushed the deprecated_directive_table branch from ac63a54 to 7e82596 Compare January 26, 2022 10:20
@ejgallego
Copy link
Collaborator

I've tested a backport of this on lwt_react.1.1.5 + ocaml-base-compiler.4.02.3 which is the failure @kit-ty-kate reported.

Unfortunately it doesn't work:

#=== ERROR while compiling lwt_react.1.1.5 ====================================#
# context     2.1.0 | linux/x86_64 | ocaml-base-compiler.4.02.3 | https://opam.ocaml.org#ccfbafd8
# path        ~/.opam/dev-402/.opam-switch/build/lwt_react.1.1.5
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lwt_react -j 15
# exit-code   1
# env-file    ~/.opam/log/lwt_react-44273-2f38c9.env
# output-file ~/.opam/log/lwt_react-44273-2f38c9.out
### output ###
# Error: Syntax error: attributes not expected.
# [...]
# (cd src/ppx && /home/egallego/.opam/dev-402/bin/ocaml -I +compiler-libs /home/egallego/.opam/dev-402/.opam-switch/build/lwt_react.1.1.5/_build/.dune/default/src/ppx/dune.ml)
# File "/home/egallego/.opam/dev-402/.opam-switch/build/lwt_react.1.1.5/_build/.dune/default/src/ppx/dune.ml", line 27, characters 0-457:
# Error: Syntax error: attributes not expected.
#        ocaml (internal) (exit 2)
# (cd src/domain && /home/egallego/.opam/dev-402/bin/ocaml -I +compiler-libs /home/egallego/.opam/dev-402/.opam-switch/build/lwt_react.1.1.5/_build/.dune/default/src/domain/dune.ml)
# File "/home/egallego/.opam/dev-402/.opam-switch/build/lwt_react.1.1.5/_build/.dune/default/src/domain/dune.ml", line 27, characters 0-457:
# Error: Syntax error: attributes not expected.
#        ocaml (internal) (exit 2)
# (cd src/core && /home/egallego/.opam/dev-402/bin/ocaml -I +compiler-libs /home/egallego/.opam/dev-402/.opam-switch/build/lwt_react.1.1.5/_build/.dune/default/src/core/dune.ml)
# File "/home/egallego/.opam/dev-402/.opam-switch/build/lwt_react.1.1.5/_build/.dune/default/src/core/dune.ml", line 27, characters 0-457:
# Error: Syntax error: attributes not expected.

@nojb
Copy link
Collaborator Author

nojb commented Jan 26, 2022

Unfortunately it doesn't work:

OK, let me try something else.

@kit-ty-kate
Copy link
Member

Could the tests be enabled for 4.02 ?

@nojb nojb force-pushed the deprecated_directive_table branch from 7e82596 to 4c00d53 Compare January 26, 2022 11:03
@nojb
Copy link
Collaborator Author

nojb commented Jan 26, 2022

Unfortunately it doesn't work:

OK, let me try something else.

I pushed an alternative fix that should work on 4.02.

nojb added 2 commits January 26, 2022 12:11
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
@nojb nojb force-pushed the deprecated_directive_table branch from 4c00d53 to 190dabc Compare January 26, 2022 11:11
@nojb
Copy link
Collaborator Author

nojb commented Jan 26, 2022

Just thinking about this again, perhaps we want to simply pass -w -3 on the command line when executing the OCaml script (instead of disabling the warning just for Toplevel.directive_table)? That way we protect ourselves against any future deprecation as well, no?

@nojb
Copy link
Collaborator Author

nojb commented Jan 26, 2022

Just thinking about this again, perhaps we want to simply pass -w -3 on the command line when executing the OCaml script (instead of disabling the warning just for Toplevel.directive_table)? That way we protect ourselves against any future deprecation as well, no?

The downside is that 1) we may miss deprecations if we are not warned about them, and 2) the deprecation alerts will also not be triggered for the user code.

@ejgallego
Copy link
Collaborator

I confirm it works, thanks Nicolas. What to do w.r.t. "-w -3", that I'm unsure, indeed seems like a delicate tradeoof.

@nojb
Copy link
Collaborator Author

nojb commented Jan 26, 2022

I confirm it works, thanks Nicolas. What to do w.r.t. "-w -3", that I'm unsure, indeed seems like a delicate tradeoof.

OK, let's leave that for later and merge this PR as it is.

@ejgallego ejgallego merged commit 853638c into ocaml:main Jan 26, 2022
@nojb nojb deleted the deprecated_directive_table branch January 26, 2022 13:08
kit-ty-kate pushed a commit to ocaml/opam-repository that referenced this pull request Jan 28, 2022
…figurator, dune-build-info and dune-action-plugin (2.9.3)

CHANGES:

- Disable warning for deprecated Toploop functions used in dune files written in
  OCaml syntax. Restores 4.02 compatibility. (ocaml/dune#5381, @nojb)
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

Successfully merging this pull request may close these issues.

3 participants