last day (15 days later) » 

3:16 PM
1
Q: File permissions with l3build ctan

gusbrsI'm trying use l3build ctan to prepare a .zip file appropriate for CTAN upload. In particular, I'd like the resulting .zip file to meet the file permissions requirements for CTAN (at https://ctan.org/file/help/ctan/CTAN-upload-addendum#filepermissions). The relevant part is: Files submitted to ...

 
We've never had a request in this area, not least because on Windows such issues never arise :) I think this looks more like a feature request for l3build than a question here.
It has occurred to me that at present some aspects of the zip support are ... suboptimal
 
@JosephWright thanks for your comment. I'm new to the process, so I was in doubt whether the fault is on my side. Would github.com/latex3/l3build/issues be the correct place to make such a request?
 
Yes, that would be it: the only (easy) way to address the question is for me, Marcel or Paulo to adjust the code and release it :)
 
@JosephWright Feature request made: github.com/latex3/l3build/issues/197. Thank you!
 
I'm not sure this is going to be easy: that I can see, there's no way to tell zip to ignore file attributes
 
3:16 PM
@JosephWright Why not just run chmod (if OS has it) on the directories to be zipped?
Apparently, tar can handle file permissions "on the fly": stackoverflow.com/a/20414651. But then, arguments such as -ll and the exclusions are hard-coded in l3build-ctan.lua...
 
@gusbrs tar can't that I know make zip files
@gusbrs Like I said, I've known for a while that things were hard-coded for zip, but no-one has asked
@gusbrs Probably I'll adjust to make this more flexible or add a hook or something
 
@JosephWright I thought it could compress with some equivalent library (gzip, lzip). And can CTAN only take .zip? or is there some similar format that would be acceptable?
 
@gusbrs CTAN take gz files too, but from my POV that's no good as they are not natively supported on Windows: we are cross-platform
@gusbrs Zip files are the standard for compression
 
@JosephWright I see. Are you sure tar can't spit a .zip? (I don't know, I'm not really acquainted with this).
 
@gusbrs No, I'm not sure, but I'd still need to fix the l3build approach as, like you say, some things assume zip; I'll look at that and then you can make a .tar.gz or whatnot
 
3:25 PM
@JosephWright That would be very welcome. It is not "me", anyone using l3build does the same. For this reason, I doubt I'd be the only one affected by this (I doubt I'm the last LaTeX user on Linux ;-), which means CTAN must be also handling the issue on their side, regardless of the stated requirements.
@JosephWright I'm new to lua but I could investigate whether tar could handle a .zip and which would the "incantation" for it, if you think that would be helpful.
@JosephWright I'm afraid tar can compress its archived files with different libraries, but it does not produce a .zip file: gnu.org/software/tar/manual/tar.html#gzip. I think you are right in the cross-platform concern, so I guess, zip it must be indeed.
Also, I still think it is not such a bad idea to just run chmod on the relevant directories. After all, they are created for this sole purpose.
 
@gusbrs I'm not sure: the only other file permissions issue we've had was some stray +x (I have a Mac at present, most of the builds are done on a CI running Linux, etc.)
 
3:42 PM
@JosephWright I'm not sure I understand. You are saying that just running chmod would actually risk of setting an undue +x permission?
@JosephWright Another question of procedure. You mentioned CTAN can receive a gz file too. But if it does receive one, it will process the file and distribute a zip anyway, wouldn't it? If that's really the case, uploading a tar.gz would not hurt in any way the cross-platform scope of the distributed files.
 
@gusbrs No, I mean we ended up in one of our repos with a stray +x on some random file, which we then had to fix. But there are cases people want +x, so you can't assume it can always be removed (people submitting scripts to CTAN)
@gusbrs We do ready-to-install zip files, and they have to be zip not anything else, otherwise they are no use to the target audience. For CTAN themselves, they don't care: they take your upload, uncompress it then install the files
 
@JosephWright Undestood. But it is easy to ensure chmod only adds reading permission to group and others, and not remove any +x permissions.
 
@gusbrs Er, that depends: I'd expect something which hard-sets all of them chmod 666 *.tex or whatever
 
@JosephWright And regarding gz, that's a good point, though CTAN is the main entry point, l3build should not assume it is the only distribution channel of the generated files. So yes, agreed, and back to zip then.
Oh, yes! One can screw things up with chmod if one makes an effort! ;-)
 
@gusbrs Well true, I guess if one is thinking about site-specific classes or whatever, but for general material CTAN is the way to go
 
4:01 PM
Well, @JosephWright, I think those are all the ideas I could come up with as to alternatives. If there's anything you think I might do here, I'm at your disposal. Otherwise, I'll be happy with whatever the Team decides on this. And I will be uploading what l3build outputs, as everyone else.
And thank you!
 
4:53 PM
@JosephWright Please allow me an off-topic comment. I'm releasing my first package today. ;-) And I'd like to thank you very, and the Team! siunitx was a frequent reference for "best practices" and ideas on how to solve particular technical problems (the package has nothing to do with it). Also, from my perspective, I have to say LaTeX3 has significantly decreased the entry barrier to programming in LaTeX.
... I didn't know that, I thought it was the contrary until not long ago, when I tried to actually get into it. So, you and the Team deserve a shout out!!! You have my deepest appreciation for the outstanding work. And my thank you very much!
 
@gusbrs Thanks
@gusbrs That was one of the aims for v3: we've worked out a lot of best practice stuff since I wrote v2, and I've made sure that as far as I can, everything is 'spot on' in siunitx now: it's intended to be the reference package for how expl3 code is supposed to be written
 
@JosephWright I'm sure I've missed many details you've built in there, but siunitx was extremely useful, from naming conventions, indentation, option handling, CI, you name it! And, about expl3 in general, I mean it. I'm a "curious user" at best, "interested" and perhaps "well acquainted" if you wish, but far from having a "solid grip" on TeX, and I doubt I'd be able to handle more complex tasks if it was not for it.
 
5:20 PM
@JosephWright I added a possible solution in github.com/latex3/l3build/pull/198: Skip the zip program and generate ZIP files directly. That gives us much more control.
 
@MarcelKrüger Thank you!
 
 
3 hours later…
8:07 PM
@gusbrs I think that the unfamiliar syntax is a little frightening at first with all the underscores and colons, but once you get past that, yes it makes things much simpler. A lot of code that used to be dozens of lines long is now a short and clear alternative.
 
 
1 hour later…
9:08 PM
@DonHosek Indeed it does, that's what I learned this past month, and that's what meant to say to Joseph in my comment/compliment. But the thing is more than familiarity or not. I'm still baffled by a lot of TeX / LaTeX2e I read, even though I'm acquainted with it for longer. But I could get a grasp of expl3 within the span of a month. At least enough of it to get some useful stuff done. It is a higher level language. And does spare the "non-wizard" folks such as myself of quite a lot of pain.
I was thrilled to learn this. And that's why I commented on this.
 

last day (15 days later) »