Are you proposing that I add this feature in the Extra Tool Installers Plugin that extends AbstractExtraToolInstaller (which in turn extends ToolInstaller)? By extension points, you mean like BatchCommandInstaller and SharedDirectoryInstaller?
BR, Oleg
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/74aZNSlm3Yg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/15de6fd5-4403-40ce-9140-8b5b3b13b071%40googlegroups.com.
If this 7zip-installer is added to ExtraToolInstallers, where in custom tools plugin do you think I should call the 7zip-installer?
How does the current extraction of .tar.gz/.zip files handle this issue? As far as I know the extraction is done in hudson.tools.FilePath, but not sure how it handles different endianness.
2. Does the extractor code need to find out what kind of endian, big or little, that is being used and then extract the tool differently depending on the endianness? Or is this handled automatically somehow?
3. Should I consider a different format entirely, considering that 7z doesn't store user/group or permission bits etc? (See [3.1] below)
If yes, is RAR a better alternative perhaps?
Hello, Oleg!
Hope everything's good with you.I have a few questions about this project I'm working on (adding support for 7z-files) I was hoping you could answer.
So, using the format 7z might cause a problem due to the endianness of the format.
1. How does the current extraction of .tar.gz/.zip files handle this issue? As far as I know the extraction is done in hudson.tools.FilePath, but not sure how it handles different endianness.
2. Does the extractor code need to find out what kind of endian, big or little, that is being used and then extract the tool differently depending on the endianness? Or is this handled automatically somehow?
3. Should I consider a different format entirely, considering that 7z doesn't store user/group or permission bits etc? (See [3.1] below)
If yes, is RAR a better alternative perhaps?[3.1] SevenZ javadoc
"The format is very Windows/Intel specific, so it uses little-endian byte order, doesn't store user/group or permission bits, and represents times using NTFS timestamps (100 nanosecond units since 1 January 1601). Hence the official toolsrecommend against using it for backup purposes on *nix, and recommend .tar.7z or .tar.lzma or .tar.xz instead."
Best regards,
Martin Hjelmqvist
You are right, the extraction happens in FilePath. In the Jenkins project we rely on the implementation in org.apache.commons.compress.archivers. It supports endian bits at least for unarchive operations.
Yes and no, we rely on the library. So for the Jenkins project it's "automatic"
| try { if(archive.toExternalForm().endsWith(".zip")){ | |
| unzipFrom(cis); }else if(archive.toExternalForm().endsWith(".rar")){ unrarFrom(cis); | |
| }else{ | |
| untarFrom(cis,GZIP); } | |
| } catch (IOException e) { | |
| throw new IOException(String.format("Failed to unpack %s (%d bytes read of total %d)", | |
| archive,cis.getByteCount(),con.getContentLength()),e); | |
| } |
RAR has its own issues. For your case I'd recommend to stick to a particular format and to implement it. Not every tool needs permission bits. The advantage is that there is a big number of Windows tools being delivered by RAR. Hence such installer provides much more added alue than 7zip.
I would also like to mention that Jenkins' FilePath implementation supports files with size >8Gb (starting from 1.627) via LONGFILE_GNU extension. The most of the bits have been implemented here: https://github.com/jenkinsci/jenkins/commit/b6c7b83e7ba1a7538382d220d044626f2b2e65be . I would expect the tar installer to work on big files, but it does not decrease the potential added value of adding new installers , especially in the case of RAR files.
Aha, interesting. How does that work? Is there a way to select some sort of long name option before compressing files? Not familiar with it. Good to hear that the work won't be in vain at least.
Either way, I need to extend hudson's FilePath.java in order to recognize the format of the installation files. ... What do you think about this approach? Any other ideas?
Most likely you do not need it, because you can implement a standalone ToolInstaller. But such switch is a good option for generic installers as well.
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/74aZNSlm3Yg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/28a4e8a7-391b-4118-9765-25492e17f029%40googlegroups.com.