cross-rs/cross

Wishlist: Add a feature to support installing packages in the Docker image when cross runs

autarch opened this issue · 3 comments

I know I can use custom Docker images for this but creating and maintaining several (possibly 10+) images just to add a git binary seems very heavyweight and painful.

I would think that it'd be possible for cross to invoke apt-get in the image before it calls cargo (or xargo). I could look into implementing this if there's agreement that this is a thing that should be possible.

Damn, I was wondering why my builds would constantly fail before I realised I'm running Docker instances 🤷‍♂

Would love if you could implement this! 😄

As using their images doesn't work for my dependencies either, I just forked the project, removed the Dockerfiles that I do not need and bumped them up to xenial which allowed me to install my library dependencies without any issues. I modified the images directly and published them under a new organisation for my project that mentions that the images are only used to cross compile my project.

Edit: I was trying to get it somehow working with Github Actions but I either do not really understand Github Actions and their filesystem interactions or it doesn't work as of now.
I have no clue on how to actually retrieve the compiled binary and upload it as an artifact within the same workflow. I thought that all steps share the same filesystem but it didn't really work for me.

This was implemented in #678, and the documentation on how to use pre-build hooks or custom Dockerfiles can be found on the wiki.