XULRunner still uses Python 2

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

Moderators: trava90, athenian200

User avatar
ownedbywuigi
Lunatic
Lunatic
Posts: 291
Joined: 2026-03-09, 21:48
Location: United Kingdom

XULRunner still uses Python 2

Post by ownedbywuigi » 2026-05-09, 01:19

Title self explanitory. The XULRunner example repo still uses Python 2 unlike PM, UXP and Basilisk. Is there any plans to upgrade XULRunner to Python 3?
Lead Dactyloidae developer.
eUXP, UXP and Basilisk contributor.
Windows Server 2022

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

Re: XULRunner still uses Python 2

Post by athenian200 » 2026-05-09, 01:57

ownedbywuigi wrote:
2026-05-09, 01:19
Title self explanitory. The XULRunner example repo still uses Python 2 unlike PM, UXP and Basilisk. Is there any plans to upgrade XULRunner to Python 3?
XULRunner is something we haven't touched in a while, honestly. That repo used to be owned by someone who has left the project, and it really hasn't been touched very much since. I didn't really have a plan to upgrade XULRunner because no one was using it at the time, and I thought upgrading the repos of all the dead applications like Ambassador, XULRunner, etc... in case someone tried to revive them would be a bit premature.

I can add it to the list of things I need to do, though, if you're planning to use it. I can't promise I'll get around to it right away, but it's pretty straightforward, should be very similar to the work done for Pale Moon.
"Linux makes everything difficult." -- Lyceus Anubite
"Linux is a cancer that attaches itself in an intellectual property sense to everything it touches. That's the way that the license works." -- Steve Ballmer
"We always overestimate the change that will occur in the next two years and underestimate the change that will occur in ten." -- Bill Gates

solitude
Fanatic
Fanatic
Posts: 151
Joined: 2025-08-03, 23:56

Re: XULRunner still uses Python 2

Post by solitude » 2026-05-09, 12:23

Since when could you build PM/UXP with Python 3?
Pale Moon and Basilisk arm64 user, on Raspberry Pi 5 (8 GB RAM)

User avatar
andyprough
Forum staff
Forum staff
Posts: 1672
Joined: 2020-05-31, 04:33

Re: XULRunner still uses Python 2

Post by andyprough » 2026-05-09, 12:40

jarsealer wrote:
2026-05-09, 12:23
Since when could you build PM/UXP with Python 3?
@athenian200 wrote about porting everything to python3 in early March - viewtopic.php?t=33205

User avatar
Moonchild
Project founder
Project founder
Posts: 39725
Joined: 2011-08-28, 17:27
Location: Sweden

Re: XULRunner still uses Python 2

Post by Moonchild » 2026-05-09, 13:30

jarsealer wrote:
2026-05-09, 12:23
Since when could you build PM/UXP with Python 3?
Basically, from 34.3.0 onwards we'll be on Python 3 -- exact range seems to be 3.7 through 3.13(?) and no real handle on breaking changes beyond that, because we had to pick something... got to love moving targets ;P
"Sales hates anything that can't be turned into a confident sentence." - anonymous warehouse worker
"Why debate someone you fundamentally don't trust?" - Dario Amodei
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Basilisk-Dev
Astronaut
Astronaut
Posts: 708
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets

Re: XULRunner still uses Python 2

Post by Basilisk-Dev » 2026-05-09, 16:41

Moonchild wrote:
2026-05-09, 13:30
Basically, from 34.3.0 onwards we'll be on Python 3 -- exact range seems to be 3.7 through 3.13(?) and no real handle on breaking changes beyond that, because we had to pick something... got to love moving targets ;P
Forgive me if I am wrong but I thought that the version of mozilla-build we use ships Python 3.6.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

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

Re: XULRunner still uses Python 2

Post by athenian200 » 2026-05-09, 16:51

Moonchild wrote:
2026-05-09, 13:30
Basically, from 34.3.0 onwards we'll be on Python 3 -- exact range seems to be 3.7 through 3.13(?) and no real handle on breaking changes beyond that, because we had to pick something... got to love moving targets ;P
Actually a little broader... I had to start with fairly old Python 3 versions because some of our of our in-tree third-party Python modules had support for Python 3.4 but nothing newer when I started out. So that was the easiest one to get working, and then I walked up to 3.14 from there.

So it technically did compile the browser on 3.14 in my initial state, but it was spewing a ton of deprecation warnings. That guy who had the CCache issue fixed most of them for us though, so now it actually does run with no apparent issues on everything from 3.4 to 3.14. I saw really clever patterns in Google's gyp that taught me how to do feature detection and fallback in Python that Mozilla would never do, which allows you to support a ridiculous range of Python versions... if you really wanted to, you could support Python 2.x in addition to 3.x (gyp did), but it would turn into spaghetti code at some point, and even more of a maintenance nightmare than it already is.

As we actually update in-tree Python modules though, most of the newer versions do have a minimum requirement of Python 3.6 or so, so that likely will bump the minimum version we can build with at some point... but for now if someone used 3.4, or even 3.3, it would actually work. The oldest we actually need to support for our own build tooling is actually 3.6 because I think (but not sure) that's what Oracle Linux 8 ships with. MozillaBuild on Windows ships with 3.7.

A fact that's not really documented anywhere is that very early Python 3 was much more like Python 2 than later versions, and thus it's an easier target for a first port... it's obvious why if you think about it, but it's one of the things they don't tell you.
"Linux makes everything difficult." -- Lyceus Anubite
"Linux is a cancer that attaches itself in an intellectual property sense to everything it touches. That's the way that the license works." -- Steve Ballmer
"We always overestimate the change that will occur in the next two years and underestimate the change that will occur in ten." -- Bill Gates

User avatar
ownedbywuigi
Lunatic
Lunatic
Posts: 291
Joined: 2026-03-09, 21:48
Location: United Kingdom

Re: XULRunner still uses Python 2

Post by ownedbywuigi » 2026-05-09, 18:07

athenian200 wrote:
2026-05-09, 01:57
XULRunner is something we haven't touched in a while, honestly. That repo used to be owned by someone who has left the project, and it really hasn't been touched very much since. I didn't really have a plan to upgrade XULRunner because no one was using it at the time, and I thought upgrading the repos of all the dead applications like Ambassador, XULRunner, etc... in case someone tried to revive them would be a bit premature.

I can add it to the list of things I need to do, though, if you're planning to use it. I can't promise I'll get around to it right away, but it's pretty straightforward, should be very similar to the work done for Pale Moon.
Would it just be easy to copy what Pale Moon already does for it's Python3 shit and paste it into XULRunner?
Lead Dactyloidae developer.
eUXP, UXP and Basilisk contributor.
Windows Server 2022

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

Re: XULRunner still uses Python 2

Post by athenian200 » 2026-05-09, 19:40

ownedbywuigi wrote:
2026-05-09, 18:07
Would it just be easy to copy what Pale Moon already does for it's Python3 shit and paste it into XULRunner?
Probably. Try that first, and if it doesn't work, I'll get around to it...
"Linux makes everything difficult." -- Lyceus Anubite
"Linux is a cancer that attaches itself in an intellectual property sense to everything it touches. That's the way that the license works." -- Steve Ballmer
"We always overestimate the change that will occur in the next two years and underestimate the change that will occur in ten." -- Bill Gates

User avatar
Moonchild
Project founder
Project founder
Posts: 39725
Joined: 2011-08-28, 17:27
Location: Sweden

Re: XULRunner still uses Python 2

Post by Moonchild » 2026-05-09, 20:19

Yeah I misremembered the actual Python versions. I wasn't sure hence my (?) with it.
"Sales hates anything that can't be turned into a confident sentence." - anonymous warehouse worker
"Why debate someone you fundamentally don't trust?" - Dario Amodei
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
ownedbywuigi
Lunatic
Lunatic
Posts: 291
Joined: 2026-03-09, 21:48
Location: United Kingdom

Re: XULRunner still uses Python 2

Post by ownedbywuigi » 2026-05-10, 00:32

Moonchild wrote:
2026-05-09, 20:19
Yeah I misremembered the actual Python versions. I wasn't sure hence my (?) with it.
Works under 3.6 with my mozbuild on Windows, so that’s definitely lower then 3.7 lol
Lead Dactyloidae developer.
eUXP, UXP and Basilisk contributor.
Windows Server 2022