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

FreeBSD backend #113

Merged
merged 2 commits into from
Jun 6, 2023
Merged

FreeBSD backend #113

merged 2 commits into from
Jun 6, 2023

Conversation

arrowd
Copy link
Contributor

@arrowd arrowd commented Apr 20, 2023

No description provided.

@ximion
Copy link
Owner

ximion commented Apr 27, 2023

Some Linux distributions as well as FreeBSD OS install 3rd party software into
a prefix that differs from "/usr". This change makes asgen work in such cases.

Can you elaborate on that? Installing metadata into any location outside of /usr/(local)/share/metainfo is not permitted and not supported by any other tool, so I would really not like to make an exception here...

@ximion
Copy link
Owner

ximion commented Apr 27, 2023

Also, by changing this you would not catch all system software that apparently is installed in /usr, and by making this a global build-time flag you can not process data for any other system other than FreeBSD correctly. So you can't use appstream-generator on FreeBSD to process a Debian or Arch Linux archive (or vice versa).

@arrowd
Copy link
Contributor Author

arrowd commented Apr 28, 2023

Can you elaborate on that?

FreeBSD installs 3rdpart software into /usr/local. Some Linuxes, AFAIK, install stuff into /opt.

Also, by changing this you would not catch all system software that apparently is installed in /usr

I was under assumption that there could be no system software that have AppStream metadata. At least there are no in FreeBSD. But this point is valid.

and by making this a global build-time flag you can not process data for any other system other than FreeBSD correctly. So you can't use appstream-generator on FreeBSD to process a Debian or Arch Linux archive (or vice versa).

I didn't even think about such use case. Yes, this is a valid point too.

I'm happy to fix this, but how? For FreeBSD backend to work I need asgen to use /usr/local prefix everywhere and without the first commit of this PR it is not possible.

@ximion
Copy link
Owner

ximion commented May 14, 2023

FreeBSD installs 3rdpart software into /usr/local. Some Linuxes, AFAIK, install stuff into /opt.

But do FreeBSD packages also contain stuff in /usr/local?
/opt is not a supported location at all for AppStream metadata, /usr/local/share/metainfo is fairly uncommon for packaged stuff, but that location is at least read, so we could potentially also support it.

@ximion
Copy link
Owner

ximion commented May 14, 2023

Can you change this patch to include just the backend without the prefix changes? That will make it much easier to review, as the prefix stuff will need a lot more work (and thought).

@arrowd
Copy link
Contributor Author

arrowd commented May 14, 2023

But do FreeBSD packages also contain stuff in /usr/local?

Yes, all of them. It can be configured on the builder machine, but the default is /usr/local.

Can you change this patch to include just the backend without the prefix changes? That will make it much easier to review, as the prefix stuff will need a lot more work (and thought).

Ok, will do.

@arrowd arrowd force-pushed the upstreaming/freebsd-backend branch 2 times, most recently from 034e4c6 to a17846f Compare May 15, 2023 06:58
@arrowd
Copy link
Contributor Author

arrowd commented May 22, 2023

Bump. Can we get this in?

Copy link
Owner

@ximion ximion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny nitpick about the TODO entry in the code, and the general disclaimer that I can't really test the code.
But apart from that, this looks good to go (I'd just like some feedback if the todo item is addressed, merging new code with that is a bit odd).

The patch also needs a (likely very simple) rebase on the master branch :-)

src/asgen/backends/freebsd/fbsdpkg.d Outdated Show resolved Hide resolved
@arrowd
Copy link
Contributor Author

arrowd commented May 29, 2023

Just a tiny nitpick about the TODO entry in the code, and the general disclaimer that I can't really test the code.

We're running it for about a month now, so it works for us.

@ximion
Copy link
Owner

ximion commented Jun 5, 2023

We're running it for about a month now, so it works for us.

That's good enough - if the conflicts of this PR with the master branch are resolved, we can merge this (and maybe even remove the TODO, since it obviously works).

@arrowd arrowd force-pushed the upstreaming/freebsd-backend branch from a17846f to 0814078 Compare June 6, 2023 07:24
arrowd added 2 commits June 6, 2023 10:26
The configuration file for the FreeBSD backend is expected to point to the
Poudriere-built repository root. The ArchiveRoot property should be the path
to Poudriere "data/packages" directory and Suite names correspond to its
subdirectories.

Here is an sample config:

{
"ProjectName": "FreeBSD",
"MediaBaseUrl": "http://pkg.FreeBSD.org/FreeBSD:13:amd64/latest/media",
"ArchiveRoot": "/usr/local/poudriere/data/packages/",
"Backend": "freebsd",
"Suites": {
  "131amd64-default":
    {
      "sections": ["default"],
      "architectures": ["amd64"]
    }
  }
}

Sponsored by:	Serenity Cybersecurity, LLC
This reduces the running time considerably when processing large packages like
LLVM and Plasma Workspace. The implementation follows ideas from other backends.

Sponsored by:	Serenity Cybersecurity, LLC
@arrowd arrowd force-pushed the upstreaming/freebsd-backend branch from 0814078 to 51b18f9 Compare June 6, 2023 07:27
@arrowd
Copy link
Contributor Author

arrowd commented Jun 6, 2023

This should be ready to get in now.

@ximion
Copy link
Owner

ximion commented Jun 6, 2023

This should be ready to get in now.

It is indeed! Thank you for your patch and your patience!

@ximion ximion merged commit bd10b77 into ximion:master Jun 6, 2023
@arrowd
Copy link
Contributor Author

arrowd commented Jun 6, 2023

Thanks for merging it! We now still need two things to make it usable:

I'm happy to work on these issues myself, so please provide me some input on how to fix them.

@arrowd arrowd deleted the upstreaming/freebsd-backend branch June 18, 2023 13:11
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

Successfully merging this pull request may close these issues.

3 participants