Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install software (dependency) on OpenBSD? #75

Open
alexander-naumov opened this issue Nov 29, 2023 · 5 comments
Open

How to install software (dependency) on OpenBSD? #75

alexander-naumov opened this issue Nov 29, 2023 · 5 comments

Comments

@alexander-naumov
Copy link

alexander-naumov commented Nov 29, 2023

Hello,
I'm trying to use this action for OpenBSD build. I need to install dependency inside OpenBSD.
As I can see, it runs as runner user. This user is not allowed to install packages.

pkg_add package_name doesn't work.
We get an error pkg_add: pkg_add must be run as root. This is correct. Normally we execute pkg_add as a root user or via doas.

doas pkg_add package_name doesn't work.
We get an error doas: doas is not enabled, /etc/doas.conf: No such file or directory

So, my question is: how to install software inside OpenBSD?

@manxorist
Copy link

sudo works for me (https://github.com/OpenMPT/openmpt/blob/91768c03cdca42dc0a293576c351008d39bd26df/.github/workflows/OpenBSD-7.4-Makefile.yml#L30)

@jacob-carlborg
Copy link
Contributor

jacob-carlborg commented Nov 30, 2023

So, my question is: how to install software inside OpenBSD?

@alexander-naumov as mentioned, sudo is available. Perhaps not that visible, but it's documented in the openbsd-builder repository [1]. I'm not that familiar with OpenBSD, is doas what's expected to be used instead of sudo?

[1] https://github.com/cross-platform-actions/openbsd-builder#openbsd-builder

@manxorist
Copy link

As far as I understand it (not an OpenBSD user either), doas is OpenBSD's recommended replacement for sudo. Given that sudo's configuration syntax has always been very confusing for me (which is a really bad sign for a security-related tool), I can understand their motivation.
I think a working doas configuration for OpenBSD would be desirable. I would also keep sudo as currently configured, to allow for consistent use of sudo across different systems.

@alexander-naumov
Copy link
Author

Thank you guys! It works.

@kobalicek
Copy link

BTW I had some similar issues and to unify builds of my projects I have created build-actions script, that does a preparation by installing cmake and a C/C++ compiler. I didn't really intend to promote this as it's mostly for my use cases, but if you want to take a look and get some inspiration:

https://github.com/build-actions/build-actions

It's written in python, so it also has a prepare-environment.sh script, which installs python.

This works for me on Windows, Linux, Mac, and BSD VMs. If anyone wants to use this or extend that I'm interested in making it better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants