chainguard-dev/melange

How to build packages with `vendor` folder?

fwilhe2 opened this issue · 1 comments

Hi, I'm looking into how wolfi is built and try to rebuild a few core packages.

I've looked into the wolfi git repo and I see it uses wolfictl as a wrapper for melange. I'd like to use 'plain' melange. I've rebuilt a few packages successfully, but so far I don't know how to handle cases of packages that use a vendor dir like wolfi-baselayout or glibc.

The issue is that when trying to build I get an error like cp: can't stat 'vendor/hello.txt': No such file or directory. I assume I'd need to mount this directory into the build container somehow, but I have not found an option in melange to do that. Also I found no example or documentation on this issue.

I have put a reduced example up here https://github.com/fwilhe2/melange-vendor-test

Please help me understand: Can melange do this, or do I need to use wolfictl?

Btw: Kudos, great work overall. melange, apko, wolfi are pretty awesome projects.

Ok, it seems like pwd is mounted automatically, so the solution seems to be to prefix the package-directory like in this commit.

This seems to mean that wolfi files need to be edited to work with plain melange, unless I still miss something. Leaving the ticket open in case some one has a more elegant solution, but feel free to close if this is intended.