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

Fixes #18434: arguments of --external in coqdoc were inadvertently swapped #18448

Merged

Conversation

herbelin
Copy link
Member

@herbelin herbelin commented Dec 30, 2023

Fixes / closes #18434

  • Added / updated test-suite.
  • Added changelog.

Should go to 8.18.1 (if any) or 8.19.0

@herbelin herbelin added kind: fix This fixes a bug or incorrect documentation. part: coqdoc The coqdoc binary for building documentation. labels Dec 30, 2023
@herbelin herbelin added this to the 8.18.1 milestone Dec 30, 2023
@herbelin herbelin requested a review from a team as a code owner December 30, 2023 11:01
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Dec 30, 2023
herbelin added a commit to herbelin/github-coq that referenced this pull request Dec 30, 2023
if Array.length Sys.argv < !Arg.current + 3 ||
Sys.argv.(!Arg.current + 2).[0] = '-' then
raise (Arg.Bad ("Two arguments expected: <url> and <path>"))
else
Arg.current := !Arg.current + 1;
f s Sys.argv.(!Arg.current + 1))
f Sys.argv.(!Arg.current + 1) url)
Copy link
Contributor

Choose a reason for hiding this comment

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

While the fix is fine, I think the resulting code will be very confusing for anyone that reads it later on, since it surreptitiously swaps the arguments. Rather than modifying the function above, it might better to just replace its call arg_url_path Index.add_external_library below by arg_url_path (fun url lp -> Index.add_external_library lp url).

Copy link
Member Author

Choose a reason for hiding this comment

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

To have to twist less our minds, we could also swap the arguments in Index.add_external_library?

Copy link
Member

Choose a reason for hiding this comment

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

You could also use labels, they're a great way to disambiguate arguments with the same type.

Copy link
Contributor

Choose a reason for hiding this comment

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

To have to twist less our minds, we could also swap the arguments in Index.add_external_library?

I did consider it, but since it involves changing the API, I refrained from suggesting it. (And I consider the API to be fine here, since having the logical path as the first argument is the sensible choice, in my opinion. As a user, I did mess a few times the order of the arguments of --external becomes it is not natural to me.) That said, I would not oppose it, since I doubt anyone other than Coq itself is using that API.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, then, to preserve the API, I adopted arg_url_path (fun url lp -> Index.add_external_library lp url).

@silene silene self-assigned this Jan 8, 2024
@herbelin herbelin force-pushed the master+fix18434-coqdoc-external-regression branch from 4068017 to efd6634 Compare January 8, 2024 19:10
@silene
Copy link
Contributor

silene commented Jan 9, 2024

@coqbot run full ci

@coqbot-app coqbot-app bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Jan 9, 2024
@silene
Copy link
Contributor

silene commented Jan 9, 2024

@coqbot merge now

@SkySkimmer mention, just in case it goes under the radar for 8.19.0

@coqbot-app coqbot-app bot merged commit 50ca6d5 into coq:master Jan 9, 2024
6 checks passed
@coqbot-app coqbot-app bot added this to Request 8.18.1 inclusion in Coq 8.18 Jan 9, 2024
SkySkimmer pushed a commit to SkySkimmer/coq that referenced this pull request Jan 10, 2024
(cherry picked from commit efd6634)
SkySkimmer added a commit to SkySkimmer/coq that referenced this pull request Jan 10, 2024
@ejgallego ejgallego added this to Request 8.19.0 inclusion in Coq 8.19 Jan 18, 2024
@ejgallego
Copy link
Member

Backport seems done, however the 8.19.0 project page was not updated, added this PR to the "request" list so it can be properly processed.

@SkySkimmer SkySkimmer moved this from Request 8.19.0 inclusion to Shipped in 8.19.0 in Coq 8.19 Jan 22, 2024
louiseddp pushed a commit to louiseddp/coq that referenced this pull request Feb 27, 2024
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. part: coqdoc The coqdoc binary for building documentation.
Projects
Coq 8.18
Request 8.18.1 inclusion
Coq 8.19
Shipped in 8.19.0
Development

Successfully merging this pull request may close these issues.

regression in coqdoc 8.18.0 (--external stopped working)
4 participants