heroku / heroku-buildpack-apt

Buildpack that installs APT based dependencies
1 stars 2 forks source link

Unable to locate package if Windows-style CR+LF newlines used in Aptfile #53

Open weslord opened 5 years ago

weslord commented 5 years ago

If I create a new heroku dyno with the buildpacks: https://github.com/heroku/heroku-buildpack-apt heroku/python

And then I push a commit with an empty requirements.txt and an Aptfile containing:

poppler-utils

I get different results depending on if the file was created in MacOS or Windows. If the file was created in MacOS, everything works as expected, poppler-utils is installed just fine. On a Windows machine, the release contains an error message: E: Unable to locate package poppler-utils.

I noticed that the Windows version of the Aptfile uses CR+LF for linebreaks, while the MacOS version uses LF for linebreaks - I'm assuming that's what's causing the problem, because I can't see any other difference at all.

hexdump of (non-working) Aptfile from Windows:

0000000 70 6f 70 70 6c 65 72 2d 75 74 69 6c 73 0d 0a   
000000f

hexdump of (working) Aptfile from MacOS:

0000000 70 6f 70 70 6c 65 72 2d 75 74 69 6c 73 0a      
000000e
howlettga commented 4 years ago

thanks, this was an issue for me as well. Strangely one package would install and all the rest would fail. It would be great if this buildpack could check for line-ending in the Aptfile and issue a warning or add to the documentation that in must use linux file endings

brandoncc commented 2 years ago

Someone opened a ticket on one of my buildpacks that ended up being this issue. Is there any movement on this?