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

Tweak the warning for arbitrary term hints. #12678

Merged
merged 3 commits into from Jul 23, 2020

Conversation

ppedrot
Copy link
Member

@ppedrot ppedrot commented Jul 10, 2020

Fixes #11970.

@ppedrot ppedrot added the kind: fix This fixes a bug or incorrect documentation. label Jul 10, 2020
@ppedrot ppedrot added this to the 8.12.0 milestone Jul 10, 2020
@ppedrot ppedrot requested a review from a team as a code owner July 10, 2020 17:03
@@ -64,11 +64,11 @@ let project_hint ~poly pri l2r r =
(info, false, true, Hints.PathAny, Hints.IsGlobRef (Names.GlobRef.ConstRef c))

let warn_deprecated_hint_constr =
CWarnings.create ~name:"deprecated-hint-constr" ~category:"deprecated"
CWarnings.create ~name:"fragile-hint-constr" ~category:"automation"
Copy link
Member

Choose a reason for hiding this comment

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

Note that @SkySkimmer recently introduced the "fragile" category, which could also be relevant in this case (so far, it only has one warning).

"Declaring arbitrary terms as hints is deprecated; declare a global \
reference instead")
"Declaring arbitrary terms as hints is fragile; it is recommended to \
declare a global reference instead")
Copy link
Member

Choose a reason for hiding this comment

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

The term "global reference" may be too technical in this context?

Copy link
Member Author

Choose a reason for hiding this comment

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

What would you prefer to have there?

Copy link
Member

Choose a reason for hiding this comment

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

No concrete idea, as discussed on the 8.12 release thread on Zulip I found the warning a bit confusing for users; in the sense that if I'm a user what I'm supposed to do here; why is this fragile? Am I in danger or not? It would be a bit messy that we have users adding dozens of new dummy definitions just to find out that we can support this better.

Maybe it would be good to add some documentation on the hint command itself.

Going back to the comment, I dunno, maybe "top-level constant" or "give the hint a name"; I'm sorry I don't have a better idea.

Copy link
Member

Choose a reason for hiding this comment

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

I think "global reference" is OK as it is used sometimes in the documentation, but I do prefer the suggestion of "top-level constant".

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Constructors are ok too though

Copy link
Contributor

Choose a reason for hiding this comment

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

and variables (eg from pose)

Copy link
Member Author

Choose a reason for hiding this comment

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

The warning will not trigger for those, so I think it's fine.

This is about the third time I try to kill this file but for some reason
it is still here.
@Zimmi48
Copy link
Member

Zimmi48 commented Jul 23, 2020

@ejgallego Can we merge this now?

@ejgallego
Copy link
Member

@ejgallego Can we merge this now?

I guess so; should we add an entry in the refman?

@Zimmi48
Copy link
Member

Zimmi48 commented Jul 23, 2020

I guess so; should we add an entry in the refman?

It would be good to do so if this does delay the release too much.

@ejgallego
Copy link
Member

It would be good to do so if this does delay the release too much.

I am not what is the sphinx magic to document a warning, the text could be something such as:

Warning : xxxx . Adding terms as hints may have some drawbacks, in particular ??? . We recommend instead using top-level constants as hints.

Indeed it was no 100% to me what the user-visible drawbacks are.

@ejgallego
Copy link
Member

@ppedrot would you mind filling in the ??? in

Adding terms as hints may have some drawbacks, in particular ???

@ejgallego
Copy link
Member

Anyways let's merge this one now and do the backport.

@coqbot coqbot added this to Request 8.12.0 inclusion in Coq 8.12 Jul 23, 2020
@ejgallego ejgallego merged commit 70bc0c7 into coq:master Jul 23, 2020
ejgallego added a commit to Zimmi48/coq that referenced this pull request Jul 23, 2020
@Zimmi48
Copy link
Member

Zimmi48 commented Jul 23, 2020

To document a warning, use .. warn::

@coqbot coqbot moved this from Request 8.12.0 inclusion to Shipped in 8.12.0 in Coq 8.12 Jul 23, 2020
@ppedrot ppedrot deleted the tweak-hint-constr-warning branch May 20, 2021 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: fix This fixes a bug or incorrect documentation.
Projects
No open projects
Coq 8.12
  
Shipped in 8.12.0
Development

Successfully merging this pull request may close these issues.

Why is the declaration of arbitrary terms as hints deprecated?
4 participants