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

Replace plain TeX primitives with \iow_* l3file functions #3

Merged
merged 4 commits into from Aug 8, 2022

Conversation

Witiko
Copy link
Owner

@Witiko Witiko commented Jun 26, 2022

Closes #1.

@Witiko Witiko added the enhancement New feature or request label Jun 26, 2022
@Witiko Witiko added this to the 1.0.1 milestone Jun 26, 2022
@Witiko Witiko self-assigned this Jun 26, 2022
@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch 3 times, most recently from c25a100 to 7412984 Compare June 26, 2022 03:17
@Witiko
Copy link
Owner Author

Witiko commented Jun 26, 2022

Replacing the (plain) TeX primitives with \iow_* expl3 functions (the reverse of Witiko/markdown@09f4b24) is blocked by latex3/latex3#1105. We will need to wait until the fix (latex3/latex3@a98fde5) from 2022-06-26 has trickled down to the texlive/texlive:latest Docker image.

@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch from d5a2611 to 7412984 Compare June 26, 2022 11:45
@Witiko Witiko marked this pull request as draft June 26, 2022 11:59
@Witiko Witiko changed the title Replace plain TeX primitives with \iow_* expl3 functions. Replace plain TeX primitives with \iow_* l3file functions. Jun 26, 2022
@Witiko Witiko marked this pull request as ready for review June 26, 2022 18:37
@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch from 8b0e15e to 42be10e Compare June 26, 2022 18:38
@Witiko Witiko changed the title Replace plain TeX primitives with \iow_* l3file functions. Replace plain TeX primitives with \iow_* l3file functions Jun 26, 2022
@Witiko Witiko removed this from the 1.0.1 milestone Jun 26, 2022
@Witiko Witiko force-pushed the main branch 5 times, most recently from e919586 to a906ee5 Compare June 27, 2022 09:12
@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch 5 times, most recently from aa1757e to 6ab758b Compare July 12, 2022 14:51
@Witiko
Copy link
Owner Author

Witiko commented Jul 12, 2022

Dear @josephwright, can you please advise why ce1cb85 would cause the CI to fail? My reading of the l3file documentation is that \iow_open:Nn, \iow_now:Nn, and \iow_close:N should have the same semantics as the \immediate variants of \openout, \write, and \closeout. Yet, replacing the latter with the former leads to failure. I am unsure if this is a bug in l3file or my misapprehension of its semantics.

@josephwright
Copy link

Did you allocate first? We use a pool of streams, so you need \iow_new:N before you can open.

@Witiko
Copy link
Owner Author

Witiko commented Jul 12, 2022

@josephwright I used \g_tmpa_iow and thought it was always allocated.

@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch 3 times, most recently from cfa28f9 to b1616b9 Compare July 13, 2022 14:24
@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch 4 times, most recently from c56cb73 to bb08ef0 Compare July 13, 2022 15:03
@Witiko
Copy link
Owner Author

Witiko commented Jul 13, 2022

@josephwright I tried to zero in on the cause of the issue with the following results:

  1. After excluding ConTeXt tests and replacing the \immediate variants of \openout, \write, and \closeout with the \iow_open:Nn, \iow_now:Nn, and \iow_close:N functions from expl3-generic in f38c3c9 and b0c8939, all tests pass.
  2. After including the ConTeXt MkIV test in bb08ef0, all tests still pass.
  3. After including the ConTeXt MkII test in e694f3c, the MkII test fails.

This leads me to the conclusion that there might be an issue with using l3file from expl3-generic in the ConTeXt MkII format that needs to be fixed. I will try to come up with an MWE after I have returned from the vacation next week.

@josephwright
Copy link

Testing on ConTeXt is minimal, and MkII is now two versions 'obsolete' (and hard to set up, as it needs Ruby): I very much doubt there are many real users.

@Witiko
Copy link
Owner Author

Witiko commented Jul 13, 2022

@josephwright That may well be, but I won't break compatibilty without a reason. MkII may be old but it is a superset of plain and usually well-behaved. Would you be interested in a patch to expl3-generic when I discover the cause?

@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch 5 times, most recently from a29273e to bc1d9cc Compare July 14, 2022 21:19
@Witiko
Copy link
Owner Author

Witiko commented Jul 14, 2022

@josephwright Mystery solved: It seems that in ConTeXt MkII, \__iow_new:N needs to be patched similarly to how we already patch \__ior_new:N for ConTeXt MkIV, see bc1d9cc. I offer a patch for LaTeX3 in latex3/latex3#1114.

@Witiko
Copy link
Owner Author

Witiko commented Jul 14, 2022

For my future reference: If latex3/latex3#1114 gets merged, we revert 110c8d4 and bc1d9cc, and squash before merging #3. Otherwise, we revert only 110c8d4, better document bc1d9cc, and squash main..e694f3c before merging #3.

@Witiko Witiko marked this pull request as draft July 14, 2022 22:09
@Witiko Witiko force-pushed the main branch 2 times, most recently from 2e533ec to afcb9ed Compare July 29, 2022 18:47
@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch from bc1d9cc to 8a22a5b Compare July 29, 2022 18:59
@Witiko Witiko marked this pull request as ready for review July 29, 2022 20:25
@Witiko
Copy link
Owner Author

Witiko commented Jul 29, 2022

Try again on Saturday. If successful, revert 82cb941 and merge the PR.

@Witiko Witiko force-pushed the fix/replace-plain-tex-primitives branch from 75a184a to 8a22a5b Compare August 8, 2022 10:02
@Witiko Witiko merged commit ff149d0 into main Aug 8, 2022
@Witiko Witiko deleted the fix/replace-plain-tex-primitives branch August 8, 2022 11:00
@Witiko Witiko added this to the 2.0.0 milestone Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace plain TeX primitives with \iow_* l3file functions
2 participants