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
Fix \iow_open:N
in ConTeXt MkII
#1114
Conversation
Please can something go into the ChangeLog too |
It would be good to also run automated tests for ConTeXt MkII, so that we don't do these fixes blindly and know when things break. From my discussion with @josephwright in Witiko/lt3luabridge#3, I understand that we only check ConTeXt MkIV and later at the moment. |
@josephwright @FrankMittelbach Thank you for your reviews. I am coding on my phone over SSH from vacation, which is not very ergonomic, so I will do the finishing touches next week when I am in the office. I also welcome commits to this PR. |
I don't think that it make sense to spent time to setup tests for MkII in the LaTeX repo. As Joseph said, MkII is two generations behind.
Imho it would be better to ask context which test can be used and will stay stable so that we don't have to adjust all the time. |
@u-fischer Thank you for your review.
Such a setup should amount to one line in
That's just one concern. The other concern are false positives, which can result from users defining a command named |
I have checked with ConTeXt a few times, and I suspect that MkII should be fine. However, the issue is that it's not 'a one line change'. To use the tests locally, MkII requires Ruby, etc. I've no idea how easy that is on macOS (my setup), but I know it's non-trivial on Windows. In particular, MkII doesn't run with 'OS + TeX Live', which is what we typically expect. |
I suspect the best marker for ConTeXt is |
(I did check I think once with MkII, but mainly checked against MkIV as that's a lot easier to use - at the cost that an up-to-date setup might not align with TeX Live.) |
That is true, but it is as likely as Ideally, we would check some internal ConTeXt command that contains characters that are not letter in the normal regime, such as Failing that, we may want to check for the existence of several commands and require that they are all defined for robustness against user commands. It may be easiest to just ask with the ConTeXt mailing list as @u-fischer suggested. |
A typical test for LaTeX2e is |
In expl3 code? That does not seem safe. We may want to extract this into a separate testing function ( |
If that is a concern, could we mark the ConTeXt MkII tests as extra and not run them by default, only in the CI? It's also OK to only check ConTeXt in downstream packages such as lt3luabridge and markdown if you'd rather like to keep the focus here on LaTeX. |
No, I meant generally: it's often used to see if you need to load e.g. |
Certainly doable but like I said, ConTeXt MkII has been obsolete for about 15 years and ConTeXt really doesn't work like plain or LaTeX, in the sense that most ConTeXt users do update their sources as a matter of routine. |
As long as that happens outside the kernel code, that does not seem like a concern. However, if l3sys can provide a standard function to detect the format, that might also improve the situation on the package side of things. |
it is not enough to setup a test workflow in github. Someone will also have to write test files (and test them locally), and debug them if they fail. I have no idea how to setup and run such a context, and I don't want to have to spent hours to get it working. If something fails in MkII and someone is interested enough to provide code to correct this, we can try to add it. But we should not make the impression that we committed ourselves to support MkII by setting up a dedicated test suite in the latex repo. |
The consensus seems to be that we don't want to test ConTeXt MkIi here. |
Hans Hagen and Henri Menke suggest we use |
a very good suggestion. All letters is fine given that "context" is part of the name. I think we should use that throughout. |
Ah, but we already have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no issues with the changes as such based on what was there before, but I think that from a conceptional point of view we should not put conditional code into macros that are conditional based on the engine/format in use.
Instead the conditional should be outside and macros should have different definitions based on the given engine/format.
In this particular situation it doesn't make much of a difference I guess, but in my opinion we should always provide code in the way that such conditionals are not executed more often than necessary, i.e., not during runtime. I guess that should go into a separate pr to be resolved over time (there may be other places).
@FrankMittelbach I've merged the PR and will tidy up the conditionals :) |
@FrankMittelbach I've looked here: everything seems to be conditional during loading but not during usage - I think we are OK. |
@josephwright @FrankMittelbach Hans Hagen and Mojca Miklavec note that detecting ConTeXt using
Line 984 in cd8b163
Line 1064 in cd8b163
Line 1444 in cd8b163
Line 1508 in cd8b163
Lines 114 to 122 in cd8b163
I would like to add a branching conditional or a predicate to |
We don't have |
I'd be minded to force |
Can we do that in
As in force |
Yes, at the point of loading stuff one has to check on this, but I meant as a public interface.
We can use whatever: it's not really a major problem. |
Regardless, replacing the |
For ConTeXt MkII, we have to deal with the fact that
\newwrite
works like our own: it actually checks before altering definition. This pull request patches\__iow_new:N
accordingly. See Witiko/lt3luabridge#3 for a discussion of the issue with @josephwright.