cross-platform-actions / action

Cross-platform GitHub action
MIT License
139 stars 19 forks source link

Can't install packages in FreeBSD #18

Closed Slackadays closed 1 year ago

Slackadays commented 1 year ago

I'm trying to use this action for Free/Open/NetBSD builds for Clipboard (https://github.com/Slackadays/Clipboard). However, the prerequisites for FreeBSD are GCC 10/11/12 and CMake. I can't install these packages with pkg because the user isn't root, and I can't get root with su because the user isn't in the right group. Would it be possible to fix this? Currently if I can't install these packages then this action is incompatible with Clipboard. The same issue might be present in Open/NetBSD but I haven't checked those out yet. :)

jacob-carlborg commented 1 year ago

Hmm, that should definitely be possible. sudo is configured during installation [1], but I will investigate. Which version of FreeBSD are you using?

[1] https://github.com/cross-platform-actions/freebsd-builder/blob/db63308a4092613077532e1ca6a14ee732ec04b9/resources/provision.sh#L79-L86

derobins commented 1 year ago

I'm trying to use FreeBSD 13.1 and pkg is not found

Slackadays commented 1 year ago

I'm using FreeBSD 13.1 too, but somehow pkg was available and only complained that I wasn't root.

Check https://github.com/Slackadays/Clipboard/blob/446708ce037a81f925517a8fc5ece75e8f10af39/.github/workflows/main.yml#L154 for my complete action

jacob-carlborg commented 1 year ago

Seems to work for me: https://github.com/cross-platform-actions/action/actions/runs/4018578271/jobs/6904364798.

Slackadays commented 1 year ago

Using sudo pkg... worked for me too, so I guess this issue is resolved.

https://github.com/Slackadays/Clipboard/actions/runs/4018816995/jobs/6904901916

jacob-carlborg commented 1 year ago

@derobins does it work for you?