packagedrone icon indicating copy to clipboard operation
packagedrone copied to clipboard

Can't create RPM greater than 2 GB

Open peterfrostdavid opened this issue 8 years ago • 5 comments

RpmWriter.finish() uses FileChannel.transferTo() to move data from a temporary file to the final RPM file. When the temporary file is greater than 2 GB, only 2GB of data are transferred. StackOverflow has some discussions about transferTo() and the 2GB size limit that seem to confirm the theory that the truncation is happening in FileChannel.transferTo().

peterfrostdavid avatar Jan 06 '17 11:01 peterfrostdavid

Sorry for the late reply on this. I am pretty busy with other stuff.

I will check this out. I am not sure this would be only issue with files +2GB though. If you have some experience, I would appreciate your help.

ctron avatar Jan 13 '17 07:01 ctron

Could you maybe provide a simple, reproducible code snippet for that?

ctron avatar Jan 13 '17 07:01 ctron

I tried to create a fix for that. Thanks to your stackoverflow link it was pretty easy to find out what I made wrong.

I created a manual build of this single bundle [1], as I don't have a real way to test it right now, it would be awesome if you could give it a try and let me know if this solved your issue.

[1] https://web.tresorit.com/l#GnCGiReydabQ24DGdp3NkA

ctron avatar Jan 13 '17 08:01 ctron

I tested the fix by invoking the new code indirectly through the de.dentrassi.maven.rpm Maven plugin and it successfully created a .rpm file larger than 2GB (the file created was 2487127517 bytes). I can no longer reproduce the problem, so I believe the fix works. At least on my system and use case.

peterfrostdavid avatar Jan 13 '17 14:01 peterfrostdavid

Cool. Thanks.

I will try to get out an update ASAP. However I cannot make any promises for this or next week.

ctron avatar Jan 18 '17 10:01 ctron