FreeBSD support

Discussions about the development and maturation of the platform code (UXP).
Warning: may contain highly-technical topics.

Moderators: trava90, athenian200

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

FreeBSD support

Unread post by dbsoft » 2022-09-02, 19:29

I run FreeBSD on my server and since a while back there were patches from someone modernizing the FreeBSD support, I decided to do a build.

A build with gcc completes successfully with a couple changes to security/generate_mapfile.py ... it requires 'FreeBSD' to be in the lists...

Both the OS_ARCH list and the is_linux list... otherwise the build fails with: "Error: unhandled OS_ARCH FreeBSD"

The application starts up at that point, but I got a crash shortly afterwards. I can look into the crash and create patches for both the build failure and the crash if you are still interested in FreeBSD patches/support?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35402
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: FreeBSD support

Unread post by Moonchild » 2022-09-02, 19:39

BSDs are notoriously tricky to maintain fully. Just monkeypatching this from abandoned patches "someone" did "a while back" isn't a good idea. I personally don't have an interest in supporting FreeBSD or any other BSD for that matter at the moment because their OS philosophy seems to be rather tangential to the way we build and develop Pale Moon and UXP. Regardless, if there is going to be a dedicated maintainer who is willing to drive and advocate for Pale Moon on the BSDs, then I'm open to that. I think FreeBSD support should be picked up and maintained by someone who uses it as their daily driver and is not splitting their focus between it and other OSes.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2022-09-02, 19:59

Yeah I agree it probably should have a dedicated driver... I use FreeBSD daily because it is my server, but I don't sit at it and work with it as a GUI platform most of the time unless I am upgrading it or testing to make sure my software packages work on it, but since I already test on Linux the changes to support FreeBSD are typically minimal.

The build probably just broke when the NSS build changes we done and it was left out of the list of OSes a few months ago.

Not sure about the crash I am experiencing... the start page comes up and it looks like it is going to work but when I go to click on the dialog with the "Not set as default browser" it crashes for me... but it seems like it is very close to being a supported platform.

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: FreeBSD support

Unread post by andyprough » 2022-09-02, 21:46

Hyperbola GNU/Linux builds a browser with basilisk code that they call 'iceweasel-uxp', and they are planning a 'Hyperbola BSD' release sometime over the next two years. I've heard that an alpha release may be coming within a few months. I'm not certain but I think they would continue building iceweasel-uxp for the BSD version. Maybe that will be a project to keep an eye on, and either their builds could be made to work on FreeBSD or you could at least look at their build to see how to compile a running version on another BSD.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1481
Joined: 2018-10-28, 19:56
Location: Georgia

Re: FreeBSD support

Unread post by athenian200 » 2022-09-02, 23:45

Honestly, I feel like I already have my hands full with SunOS and Linux. I originally signed on to maintain illumos and Solaris, but I'm finding that in general I'm doing a lot more work on Linux than I expected, mostly because problems keep cropping up on there that affect a lot of users, and I usually know how to deal with the issues despite my Linux skills being about 15 years out of date. I know I should probably leave Linux stuff to Travis, but I was more active at the time and so it's very tempting to investigate the issues I see on Linux ASAP, since they often affect my platform too.

My feeling is that I don't care that much if FreeBSD or NetBSD are supported (as long as it doesn't result in additional work for me), but I don't like OpenBSD at all and that's probably the one I would have to advise against supporting even if someone were to step up.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 780
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: FreeBSD support

Unread post by jobbautista9 » 2022-09-04, 09:07

andyprough wrote:
2022-09-02, 21:46
Hyperbola GNU/Linux builds a browser with basilisk code that they call 'iceweasel-uxp', and they are planning a 'Hyperbola BSD' release sometime over the next two years. I've heard that an alpha release may be coming within a few months. I'm not certain but I think they would continue building iceweasel-uxp for the BSD version. Maybe that will be a project to keep an eye on, and either their builds could be made to work on FreeBSD or you could at least look at their build to see how to compile a running version on another BSD.
Hyperbola will use a hard-fork of OpenBSD IIRC, so if they're going to continue using UXP for their BSD release, they're probably going to have a hard time due to our strained relationship with OpenBSD.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2022-09-04, 19:45

Just wanted to clarify, I was referring to FreeBSD patches that were already committed to the tree a year or two ago.... by Olivier Certner.

The changes to NSS in this issue https://repo.palemoon.org/MoonchildProd ... ssues/1847 broke the FreeBSD build, because of an explicit list of supported OSes which are currently: Linux, SunOS and Darwin (Mac).

So I was offering to submit changes to fix the build on FreeBSD (they are simple and ready to commit currently). I also though get a crash on FreeBSD and if the patches will be accepted into the tree I was just offering to debug the crash and fix it. If there is no interest in the FreeBSD fixes in the tree, I won't bother to put time into it.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35402
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: FreeBSD support

Unread post by Moonchild » 2022-09-04, 20:29

You probably shouldn't bother to put time into it.
I'm open to patches if it's actually going to be something that is maintained or a working target, but if not, then it will just be wasted effort. Just tossing code changes against the wall and hoping it sticks as more development is done isn't a good way to go about it, IMO.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2022-09-05, 00:05

Moonchild wrote:
2022-09-04, 20:29
I'm open to patches if it's actually going to be something that is maintained or a working target, but if not, then it will just be wasted effort. Just tossing code changes against the wall and hoping it sticks as more development is done isn't a good way to go about it, IMO.
Well I can do builds on the server with every release, the server is mostly idle anyway.... however I don't use it as a desktop so I won't be browsing with it much.

I did a debug build and looked at the crash... it is crashing in libstdc++ (from ICU) ... I had to do the build with GCC since LLVM (and thus FreeBSD) got rid of the deprecated hash_map extension which is still being used in some chromium IPC code (hash_table.h). Apple still ships hash_map though even though LLVM got rid of it. The GCC port/libstdc++ still includes it. The guy who did those FreeBSD patches was using clang and libc++ I guess before they got rid of hash_map.

hash_map has been replaced with std::unordered_map so to get it building with clang again under FreeBSD we probably need move away from hash_map like Mozilla did.

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2022-09-05, 01:57

I have made a preliminary patch to remove hash_map and switch to unordered_map. This along with one other visibility change which I had to do on Linux as well to build with clang allowed me to complete a clang build on FreeBSD and it doesn't crash and functions from some quick testing. Is there any reason we would be unable to switch to unordered_map, it is already used in some other areas of the source?

https://xref.palemoon.org/goanna-centra ... _map&find=

Should I make an issue regarding the removal of hash_map?

https://dbsoft.org/Screenshots/White-St ... SD12.3.png

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35402
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: FreeBSD support

Unread post by Moonchild » 2022-09-05, 08:29

dbsoft wrote:
2022-09-05, 01:57
Should I make an issue regarding the removal of hash_map?
Yes please. If it's deprecated and we already have the plumbing for std::unordered_map that should be low risk.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2022-09-05, 11:39

Thank you Moonchild! That was so quick! :)

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1481
Joined: 2018-10-28, 19:56
Location: Georgia

Re: FreeBSD support

Unread post by athenian200 » 2022-09-05, 16:15

dbsoft wrote:
2022-09-05, 01:57
I have made a preliminary patch to remove hash_map and switch to unordered_map. This along with one other visibility change which I had to do on Linux as well to build with clang allowed me to complete a clang build on FreeBSD and it doesn't crash and functions from some quick testing. Is there any reason we would be unable to switch to unordered_map, it is already used in some other areas of the source?

https://xref.palemoon.org/goanna-centra ... _map&find=
Off-topic:
The reality is, we don't pay that much attention to the IPC code. We aren't multiprocess and I think the code is only maintained because we need it for NPAPI plugins on Pale Moon (and maybe WebRTC and EME on Basilisk, not sure). Changing it should be fine, it's not used for very much and we tend to neglect it. I wound up changing some of that code to work on SunOS, and then found that the code I was getting stuck on was totally dead code Mozilla removed in Firefox 53 anyway.

We probably need to go through and remove a lot of dead code and update the stuff that isn't dead at some point. It's just never been a priority.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2022-09-05, 18:48

athenian200 wrote:
2022-09-05, 16:15
[
Off-topic:
The reality is, we don't pay that much attention to the IPC code. We aren't multiprocess and I think the code is only maintained because we need it for NPAPI plugins on Pale Moon (and maybe WebRTC and EME on Basilisk, not sure). Changing it should be fine, it's not used for very much and we tend to neglect it. I wound up changing some of that code to work on SunOS, and then found that the code I was getting stuck on was totally dead code Mozilla removed in Firefox 53 anyway.

We probably need to go through and remove a lot of dead code and update the stuff that isn't dead at some point. It's just never been a priority.
Off-topic:
Yeah that code was almost dead code, it was literally used in one place... it was written like it was intended to be used all over the place though.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1481
Joined: 2018-10-28, 19:56
Location: Georgia

Re: FreeBSD support

Unread post by athenian200 » 2022-09-05, 21:22

dbsoft wrote:
2022-09-05, 18:48
Off-topic:
Yeah that code was almost dead code, it was literally used in one place... it was written like it was intended to be used all over the place though.
Off-topic:
That is correct. The IPC code is basically a huge chunk of ancient Chromium code that was lifted out of their codebase into Mozilla's codebase several years ago. So in Chromium, at the time it was used, this was used everywhere. But in our codebase, we have our own stuff that is totally different, our own way of loading in files, etc. Mozilla has slowly continued the process of adapting this code to use more of their own stuff instead of the big blob of Chromium code after our fork point. A lot of that code is dead even for them, and even more of it is dead for us since we don't need a lot of the functionality they imported it to get in the first place.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

freedom4all
Moonbather
Moonbather
Posts: 51
Joined: 2022-11-08, 03:11

Re: FreeBSD support

Unread post by freedom4all » 2022-12-04, 18:57

dbsoft wrote:
2022-09-05, 00:05
Well I can do builds on the server with every release, the server is mostly idle anyway.... however I don't use it as a desktop so I won't be browsing with it much.
I'm trying out openbsd as a daily driver on one of my machines and would be using Palemoon as a primary browser if it were available. I'd be more than happy to be a guinea pig for more exhaustive testing with normal everyday browsing.

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2022-12-05, 00:05

freedom4all wrote:
2022-12-04, 18:57
I'm trying out openbsd as a daily driver on one of my machines and would be using Palemoon as a primary browser if it were available. I'd be more than happy to be a guinea pig for more exhaustive testing with normal everyday browsing.
I've been doing FreeBSD builds of White Star, I haven't used OpenBSD in like a decade now though, I am not sure if my FreeBSD binaries will work on OpenBSD.

https://dbsoft.org/whitestar.php

freedom4all
Moonbather
Moonbather
Posts: 51
Joined: 2022-11-08, 03:11

Re: FreeBSD support

Unread post by freedom4all » 2022-12-05, 01:27

dbsoft wrote:
2022-12-05, 00:05
freedom4all wrote:
2022-12-04, 18:57
I'm trying out openbsd as a daily driver on one of my machines and would be using Palemoon as a primary browser if it were available. I'd be more than happy to be a guinea pig for more exhaustive testing with normal everyday browsing.
I've been doing FreeBSD builds of White Star, I haven't used OpenBSD in like a decade now though, I am not sure if my FreeBSD binaries will work on OpenBSD.

https://dbsoft.org/whitestar.php
Thanks. I gave it a shot.... doesn't work even a little bit :lol: ?#p?!Z: not found. | syntax error: `(' unexpected

I'm not quite set on openbsd yet and not sure I'm even going to stick with it, just giving it a test run for now. Might move to freebsd, and if I do, I'll give it a go.

User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Re: FreeBSD support

Unread post by pteros » 2023-01-30, 18:44

I'm using FreeBSD dayly on my computer (both home and at work). I'm trying Palemoon experimental downloaded from the link in the 32 milestone announcement and it works like a charm! :thumbup:
It can even use my previous bookmarks and passwords from the time PM had a FreeBSD maintainer!
WOW!

Thanks to everybody for the effort,

Luciano.

dbsoft
Project Contributor
Project Contributor
Posts: 405
Joined: 2020-02-21, 17:35

Re: FreeBSD support

Unread post by dbsoft » 2023-02-03, 09:18

pteros wrote:
2023-01-30, 18:44
I'm using FreeBSD dayly on my computer (both home and at work). I'm trying Palemoon experimental downloaded from the link in the 32 milestone announcement and it works like a charm! :thumbup:
It can even use my previous bookmarks and passwords from the time PM had a FreeBSD maintainer!
Glad people are using it!

Locked