Artifacts Associated With Ticket b9f3ff8fe6
Ticket change [093454c956] (rid 229617) by tberg on 2024-07-30 07:11:56:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-markdown"
- comment initialized to:
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](https://core.tcl-lang.org/tcl/file?name=generic/tclZipfs.c&ci=c971e6c7c4&ln=6270) 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](https://core.tcl-lang.org/tcl/file?name=generic/tclZipfs.c&ci=c971e6c7c4&ln=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?
- foundin initialized to: "9.0"
- is_private initialized to: "0"
- login: "tberg"
- priority initialized to: "5 Medium"
- private_contact initialized to: "94879582b1b42c382be6941728fabc85e28a2f74"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "tberg"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to: "Errors/ambiguities in zipfs(n) manual page"
- type initialized to: "Bug"
Ticket change [648a848992] (rid 229646) by apnadkarni on 2024-07-31 02:51:00:
- icomment:
In order, 1. I think there should be no reason for a `package require` call 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, unlike `msgcat`, the zipfs command is always present, not loaded on demand. My take would be to fix the documentation. 2. See above which makes this moot. Removing the `Tcl_PkgProvide` call 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. 3. 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. 4. Have not looked at mkimg. Afaik it is not covered in the test suite at all. Needs further investigation. 5. 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?
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [6aa17e54f0] (rid 229659) by tberg on 2024-08-01 06:30:30:
- icomment:
1. Yes, when `zipfs` is considered part of the core commands, then it should not be a package at all. I agree. The `zlib` is also not a package. 2. Agree. 3. OK, good point and fair argument. I agree that it is the purpose of `zipfs root` to return the mount point, however it looks like. Removing the //zipfs:/ will also make documentation easier. 4. You are right, I checked and `zipfs mkimg` is 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! 5. 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??
- login: "tberg"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [f96438d137] (rid 229660) by oehhar on 2024-08-01 08:01:28:
- icomment:
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
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [91b4562c0a] (rid 229673) by griffin on 2024-08-02 03:21:44:
- icomment:
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.
- login: "griffin"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [81628787bc] (rid 229684) by tberg on 2024-08-02 21:27:06:
- icomment:
OK, so I will do the following (in the main branch, in a few days) if no other objections or consideration are coming: 1. In the documentation, remove the `package require ...` line. 2. In the C source code in zipfs.c, remove the `Tcl_PkgProvide` call. 3. In the documentation, remove the actual string mentioned for the root mount point and refer to the subcommand `zipfs root` for retrieving the correct root mount point 4. In the documentation, make clear how the behaviour is when specifying optional parameters as empty strings 5. In the documentation, remove the remark on the code being experimental. Also, I will try and add some basic tests for `zipfs mkimg` in zipfs.test
- login: "tberg"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [54c4ae8822] (rid 229697) by tberg on 2024-08-03 06:16:40:
- icomment:
Started a branch zipfs-consolidation now to work on the tickets related to zipfs: [zipfs-tickets](/rptview/28)
- login: "tberg"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [18462eb520] (rid 229762) by tberg on 2024-08-05 22:25:06:
- icomment:
After some more discussion with TCT members, the conclusion is to: 1. Remove the package requirement. 2. Remove the package declaration. 3. Remove the explicit literal string for the mount point and document that \[zipfs root\] should be used to retrieve the actual string. 4. 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. 5. The statement on experimental code will be removed. These changes are now implemented with commit [f6bfd7c52a](/info/f6bfd7c52afda1a1)
- login: "tberg"
- mimetype: "text/x-markdown"
- resolution changed to: "Fixed"
- icomment:
Ticket change [3bb35ca066] (rid 233300) by tberg on 2024-09-10 12:15:06:
- closedate changed to: "2460564.01049765"
- closer changed to: "tberg"
- login: "tberg"
- mimetype: "text/plain"
- status changed to: "Closed"