|
2024-09-10
| ||
| 12:15 | • Closed ticket [b9f3ff8fe6]: Errors/ambiguities in zipfs(n) manual page plus ... artifact: 3bb35ca066 user: tberg | |
|
2024-08-05
| ||
| 22:59 | also change zipfs.3 to match the resolution of ticket [b9f3ff8fe6] check-in: e49d28592d user: Torsten tags: zipfs-consolidation | |
| 22:25 | • Ticket [b9f3ff8fe6] Errors/ambiguities in zipfs(n) manual page status still ... artifact: 18462eb520 user: tberg | |
| 22:21 | resolution of ticket [b9f3ff8fe6] check-in: f6bfd7c52a user: Torsten tags: zipfs-consolidation | |
|
2024-08-03
| ||
| 06:16 | • Ticket [b9f3ff8fe6] Errors/ambiguities in zipfs(n) manual page status still ... artifact: 54c4ae8822 user: tberg | |
| 06:07 | correct wrong comment about safe subcommands, don't make zipfs a package anymore (ticket [b9f3ff8fe6... check-in: 9e4b08a4a7 user: Torsten tags: zipfs-consolidation | |
|
2024-08-02
| ||
| 21:27 | • Ticket [b9f3ff8fe6] Errors/ambiguities in zipfs(n) manual page status still ... artifact: 81628787bc user: tberg | |
| 03:21 | • Ticket [b9f3ff8fe6]: 3 changes artifact: 91b4562c0a user: griffin | |
|
2024-08-01
| ||
| 08:01 | • Ticket [b9f3ff8fe6]: 4 changes artifact: f96438d137 user: oehhar | |
| 06:30 | • Ticket [b9f3ff8fe6]: 3 changes artifact: 6aa17e54f0 user: tberg | |
|
2024-07-31
| ||
| 02:51 | • Ticket [b9f3ff8fe6]: 3 changes artifact: 648a848992 user: apnadkarni | |
|
2024-07-30
| ||
| 07:11 | • New ticket [b9f3ff8fe6]. artifact: 093454c956 user: tberg | |
Errors/ambiguities in zipfs(n) manual page
Here are some points which I think should be fixed in the zipfs(n) manual page. As I am not totally sure about them, this ticket asks for comments before I just change the manual page.
1. requiring the package
The manual page indicates to use
package require tcl::zipfs ?1.0?
in order to use the zipfs commands. In a normal Tcl9.0b3 interpreter, you can just use the commands without this line. I believe this fact should be documented or rather it should be documented under which circumstances the line is needed. The source code of zipfs does not give me any indication of when the line would be needed. (This is actually true for other packages as well, msgcat e.g.).
2. package version
The manual page states the version is 1.0, the zipfs.c source does:
Tcl_PkgProvide(interp, "tcl::zipfs", "2.0");
Shouldn't the documentation be brought in line with the implementation or is version 2.0 wrong as this is a new package and some aspects are even declared experimental? By the way, the zipfs.test file has a test and also expects "2.0" as result.
3. zipfs mount point
The manual page says the mount point for zipfs volumes is “//zipfs:/” on most platforms. This is a bit too loosely documented as it leaves the user with the burden to find out (using zipfs root). However, I cannot find any indication in the source code of the mount point being platform-dependent. It just says in line 89:
#define ZIPFS_VOLUME "//zipfs:/"
Am I correct that the mount point is actually platform-independent and always the same? If true, this needs fixed in the documentation. If this is not the case, the various possible mount points and the platforms for which they apply should be listed.
4. zipfs mkimg syntax
The [zipfs mkimg] syntax is specified like this:
zipfs mkimg outfile indir ?strip? ?password? ?infile?
This indicates one could leave out any of the three optional parameters and zipfs would figure out what is meant. This is not true. The syntax rather has four different forms:
zipfs mkimg outfile indir
zipfs mkimg outfile indir strip
zipfs mkimg outfile indir strip password
zipfs mkimg outfile indir strip password infile
So, e.g., you cannot really skip ?strip? and then specify ?password? only. When I misunderstand the way such syntax is to be read, then I propose we need a separate manual page explaining how to read Tcl syntax in general (it would be good practice anyway).
If I understand correct, it is not possible to create an unstripped image with a password. At least, this is not documented. Is my impression true? Of course, I can always provide empty strings for the parameters I don't care about but what happens then is not explicitly documented for ?strip?. I would thus rather have the syntax documented as written above instead of with three optional parameters that are not optional in this sense. Any insights?
5. experimental code?
The mkimg subcommand documentation contains the comment: "Caution: highly experimental, not usable on Android, only partially tested on Linux and Windows."
Is is unclear what this means. Which parts are tested and which not? Can the subcommand actually be used? It worked for me using macOS so this could also count as being partly tested. Further, there is an extensive zipfs.test file and testing Tcl9.0b2 and b3 has not resulted in any error being reported on any platform as far as I can tell. Is the sentence obsolete?
e49d28592dalso change zipfs.3 to match the resolution of ticket [b9f3ff8fe6] check-in2024-08-05 22:59:04f6bfd7c52aresolution of ticket [b9f3ff8fe6] check-in2024-08-05 22:21:069e4b08a4a7correct wrong comment about safe subcommands, don't make zipfs a package anymore (ticket [b9f3ff8fe6]) check-in2024-08-03 06:07:01
In order,
I think there should be no reason for a
package requirecall as zipfs is part of the core. As Donal said on the mailing list, there is no reason for zlib (and therefore zipfs) not to be part of every Tcl. Also, unlikemsgcat, the zipfs command is always present, not loaded on demand. My take would be to fix the documentation.See above which makes this moot. Removing the
Tcl_PkgProvidecall has no effect on Tcl and the test suite. The only question is third party extensions rely on it (doubtful since this is new in 8.7/9). My opinion is this line should be deleted so it is not a package at all.I prefer not to limit what [zipfs root] might be in some future release. There is no reason to document //zipfs:/ is there? People should be encouraged to use [zipfs root] and not hard code a literal.
Have not looked at mkimg. Afaik it is not covered in the test suite at all. Needs further investigation.
I do not know why it is marked experimental. Perhaps because the mechanism of appending the ZIP to the executable is not workable on all executable formats?
Yes, when
zipfsis considered part of the core commands, then it should not be a package at all. I agree. Thezlibis also not a package.Agree.
OK, good point and fair argument. I agree that it is the purpose of
zipfs rootto return the mount point, however it looks like. Removing the //zipfs:/ will also make documentation easier.You are right, I checked and
zipfs mkimgis not covered in the test suite. There should be at least some basic tests there, I believe, also to prove it is working on all platforms when testing the next beta!Writing some tests as a result of point 4) and getting them into the next beta of Tcl9 would be my preferred way of checking this. When we find problems then and have fixed those, the text can be removed from the manual page (we should not release "highly experimental code" anyway, should we??
Ashok, Torsten: great work and discussion, thank you for your time!
About 5 "experimental".
I suppose, this man page was originally writen by Donal Fellows and he is on the MAC platform. In the mean time, it was tested on all supported platforms. Android is not a supported platform.
So, I just would remove the phrase.
We can also not predict,in which circumstances it works. Also, executables are nowdays often digitally signed, which puts additional data at the end, and the unpack mechanism must know about this.
The documentation should say, what it should do, anything else is a bug. And I see no reason not to say, that this command works in general.
If there are restrictions in the future, they can be added later.
Torsten, it would be great if you could just edit the man page following this discussion.
Thank you all, Harald
WRT zipfs mkimg:
The empty string can be used for the strip and password arguments. This is how to, essentially, not provide the argument(s). However, it's much easier to get things correct if the strip value is always given. Otherwise, the possibility of getting it wrong increases.
The mkimg command is just a replacement for running zip + cat. That's pretty much all it does (but more efficiently.)
As for testing, make sure to test using Windows style path names for the strip argument.
OK, so I will do the following (in the main branch, in a few days) if no other objections or consideration are coming:
In the documentation, remove the
package require ...line.In the C source code in zipfs.c, remove the
Tcl_PkgProvidecall.In the documentation, remove the actual string mentioned for the root mount point and refer to the subcommand
zipfs rootfor retrieving the correct root mount pointIn the documentation, make clear how the behaviour is when specifying optional parameters as empty strings
In the documentation, remove the remark on the code being experimental. Also, I will try and add some basic tests for
zipfs mkimgin zipfs.test
Started a branch zipfs-consolidation now to work on the tickets related to zipfs: zipfs-tickets
After some more discussion with TCT members, the conclusion is to:
Remove the package requirement.
Remove the package declaration.
Remove the explicit literal string for the mount point and document that [zipfs root] should be used to retrieve the actual string.
Leave the syntax as it is and mention how to use empty strings for "missing" options. In future (after Tcl 9.0), another TIP might be issued proposing to use real options like this: "zipfs mkimg outfile indir ?-strip prefix? ?-password password? ?-infile fileName?". Similar syntax should then be implemented for the other subcommands as well. The fact that the current syntax is potentially not stable, will be mentioned in the manual page.
The statement on experimental code will be removed.
These changes are now implemented with commit f6bfd7c52a