Closed jgfoster closed 1 year ago
Thanks for opening your first issue! Please check the CONTRIBUTING documents for some tips about which information should be provided. You can find information of how to do a Pull Request here: https://github.com/pharo-project/pharo/wiki/Contribute-a-fix-to-Pharo
GitHubThe Sources for Pharo. Contribute to pharo-project/pharo development by creating an account on GitHub.
As with other packages we need to analyze dependencies and the potential rearrangement of the load order and removal from the minimal build
The term "minimal" is open to interpretation. There is:
super minimal, really the tiniest it can be made minimal, I want to fit on an embedded microprocessor (someday) minimal, want to run remotely a web service and don't want any graphics baggage The first might not want LanguageEnvironment while the latter probably does. Perhaps in a while we need a separate bit less minimal image called "headless" to match the "headless vm".
PR was merged
@MarcusDenker This issue is about something else than what was done in the PR.
It appears that ZipArchive
depends on Locale
:
LanguageEnvironment class>>currentPlatform
LanguageEnvironment class>>defaultSystemConverter
String>>convertToSystemString
ZipArchiveMember>>writeCentralDirectoryFileHeaderTo:
ZipArchive>>writeCentralDirectoryTo:
So, I'll try bringing the System-Localization
package into the minimal image.
I'm checking the Zip implementation there:
writeCentralDirectoryFileHeaderTo: aStream
"C2 v3 V4 v5 V2"
| systemFileName systemFileComment systemCdExtraField endianStream |
systemFileName := fileName asVmPathName.
systemFileComment := fileComment convertToSystemString.
systemCdExtraField := cdExtraField.
aStream nextPutAll: CentralDirectoryFileHeaderSignature.
endianStream := ZnEndianessReadWriteStream on: aStream.
endianStream nextLittleEndianNumber: 1 put: self versionMadeBy.
endianStream nextLittleEndianNumber: 1 put: fileAttributeFormat.
endianStream nextLittleEndianNumber: 2 put: versionNeededToExtract.
endianStream nextLittleEndianNumber: 2 put: self bitFlag.
endianStream nextLittleEndianNumber: 2 put: desiredCompressionMethod.
endianStream nextLittleEndianNumber: 4 put: lastModFileDateTime asDosTimestamp.
"These next 3 should have been updated during the write of the data"
endianStream nextLittleEndianNumber: 4 put: crc32.
endianStream nextLittleEndianNumber: 4 put: (desiredCompressionMethod = CompressionStored
ifTrue: [ uncompressedSize ] ifFalse: [ compressedSize ]).
endianStream nextLittleEndianNumber: 4 put: uncompressedSize.
endianStream nextLittleEndianNumber: 2 put: systemFileName size.
endianStream nextLittleEndianNumber: 2 put: systemCdExtraField size.
endianStream nextLittleEndianNumber: 2 put: systemFileComment size.
endianStream nextLittleEndianNumber: 2 put: 0. "diskNumberStart"
endianStream nextLittleEndianNumber: 2 put: internalFileAttributes.
endianStream nextLittleEndianNumber: 4 put: externalFileAttributes.
endianStream nextLittleEndianNumber: 4 put: writeLocalHeaderRelativeOffset.
aStream nextPutAll: systemFileName asByteArray.
aStream nextPutAll: systemCdExtraField asByteArray.
aStream nextPutAll: systemFileComment asByteArray
And I wonder whether the offending line (fileComment convertToSystemString
) really requires the system's encoding... We should maybe dig on the Zip specs because maybe it requires that we somehow tell the encoding? Otherwise the results may not be "unzippable" in a different machine with different encoding.
Wikipedia talks about encoding file names in utf8 (see https://en.wikipedia.org/wiki/Zip_(file_format)#Data_descriptor). But nothing on the comments.
Appendix D in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT specifies that a bit can be set to 1 to specify the encoding used is UTF8, which is IMHO the safest thing to do...
Also to document this a bit better, there are no senders of fileComment:
and the only assignments to it set an empty string during initialization fileComment := ''
.
To limit bug bankruptcy (see https://www.joelonsoftware.com/2012/07/09/software-inventory/) this issue has been automatically marked as stale because it has not had any activity in 6 months. If no further activity occurs, it might be closed. If this issue remains important to you, please comment to reactivate the issue. Thank you for your contributions.
Joel on SoftwareImagine, for a moment, that you came upon a bread factory for the first time. At first it just looks like a jumble of incomprehensible machinery with a few people buzzing around. As your eyes adjus…
Still relevant
Indeed!
This issue (the original one) looks more like a small project than an actionable issue. I propose we move it to a wiki with potential projects for people to contribute. I'm collecting all these. Could be a great basis for GSOC.
The cleanup to ZipArchive
is on the other hand easily actionable. I'll open another issue for it.
In #3832 @noha suggested that LanguageEnvironment be removed from the minimal image. This issue is available for that discussion (and so that the earlier PR can proceed).