Possible issue in build script?

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
Gerald2
Newbie
Newbie
Posts: 5
Joined: 2021-11-02, 11:10

Possible issue in build script?

Unread post by Gerald2 » 2022-04-27, 17:05

Looking at building Palemoon for arm64, a Raspberry Pi running Bullseye.

Following the build instructions at

https://developer.palemoon.org/build/linux/

and got as far as

./mach build

which resulted in

mach: 18: "(" unexpected

I noticed that the first line of ./mach is

#!/bin/sh

which I replaced with

#!/bin/bash

and it's now 15 minutes into the build...

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

Re: Possible issue in build script?

Unread post by athenian200 » 2022-04-27, 20:30

That is probably because Debian (I'm assuming you mean Debian Bullseye because I can't find a Bullseye Linux distro) may be using Dash as its /bin/sh. Our scripts, most of which we inherited from Mozilla, assume that /bin/sh is bash running in a pseudo-POSIX compliant mode that doesn't actually guarantee the scripts work on other shells, though it seems like many thought that was the case.

Changing /bin/sh references to /bin/bash can work around this, though generally the ideal would be to change the scripts so they work on any POSIX-compliant shell.
"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
Gerald2
Newbie
Newbie
Posts: 5
Joined: 2021-11-02, 11:10

Re: Possible issue in build script?

Unread post by Gerald2 » 2022-04-28, 08:57

athenian200 wrote:
2022-04-27, 20:30
That is probably because Debian (I'm assuming you mean Debian Bullseye because I can't find a Bullseye Linux distro)....
Thanks very much for your reply. Sorry, it's actually RaspiOS or whatever they call it this week but it's based on Debian Bullseye.
... the ideal would be to change the scripts so they work on any POSIX-compliant shell.
Quite so.

The build took about 5.5 hours but was successful. At the end of the build I got the message

Code: Select all

321:05.10 Packaging quitter@mozilla.org.xpi...
321:05.86 0 compiler warnings present.
327:20.29 Overall system resources - Wall time: 19247s; CPU: 0%; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
327:27.84 Notification center failed: Install the python dbus module to get a notification when the build finishes.
327:27.84 We know it took a while, but your build finally finished successfully!
To view resource usage of the build, run |mach resource-usage|.
To take your build for a test drive, run: |mach run|

Checking for un-preprocessed files... Done!
I ran Palemoon from the build directory using './mach run' and it seemed fine so I set it to packaging which took about 10 minutes:

Code: Select all

 9:51.54 palemoon/palemoon-bin
 9:52.51 gmake[1]: Leaving directory '/opt/ged/src/net/palemoon-source/obj-aarch64-unknown-linux-gnu/palemoon/installer'
 9:52.52 gmake: Leaving directory '/opt/ged/src/net/palemoon-source/obj-aarch64-unknown-linux-gnu'
 9:52.55 Notification center failed: Install the python dbus module to get a notification when the build finishes.
Being an old-fashioned sort I installed to /usr/local/bin from the tarball and after a couple of false starts I was looking at six Palemoon windows with my usual six hundred tabs (don't...).

A couple more minor issues:

1. python-dbus doesn't seem to be available on (RaspiOS) Bullseye - and Bullseye provides Python 3.x, not 2.x. When I tried to install python-dbus using 'pip' it said there's no such thing but I found dbus-python and tried to install that. It was already installed, so maybe it just it isn't being used.

2. The messages about running 'mach resource-usage' and 'mach run' omit the path prefix ('./' if you're running from the build directory or the full path if you aren't) which is necessary if the build directory hasn't been added to the shell's search path.

3. The resource usage figures given at the end of the build are mostly unpopulated:

Code: Select all

327:20.29 Overall system resources - Wall time: 19247s; CPU: 0%; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
Thanks all for your work on Palemoon.

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

Re: Possible issue in build script?

Unread post by athenian200 » 2022-04-28, 09:25

Gerald2 wrote:
2022-04-28, 08:57
Quite so.

The build took about 5.5 hours but was successful.
That's good to hear.
1. python-dbus doesn't seem to be available on (RaspiOS) Bullseye - and Bullseye provides Python 3.x, not 2.x. When I tried to install python-dbus using 'pip' it said there's no such thing but I found dbus-python and tried to install that. It was already installed, so maybe it just it isn't being used.
I wouldn't worry about python-dbus too much... all that does is notify you when your build is done. What I'm more curious about is how you got this to build at all on a system that only provides Python 3.x. We aren't actually Python 3.x compatible as far as I know. Did you install Tauthon or something?
2. The messages about running 'mach resource-usage' and 'mach run' omit the path prefix ('./' if you're running from the build directory or the full path if you aren't) which is necessary if the build directory hasn't been added to the shell's search path.
Good note, I never thought about that before, and just assumed the path prefix was implied. In any case, we didn't write those messages ourselves originally, and I'm not sure I've ever actually used that functionality myself.
3. The resource usage figures given at the end of the build are mostly unpopulated:
Ah, that is interesting. I wonder if it could be related to the dbus thing?
"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
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35402
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Possible issue in build script?

Unread post by Moonchild » 2022-04-28, 09:46

athenian200 wrote:
2022-04-28, 09:25
What I'm more curious about is how you got this to build at all on a system that only provides Python 3.x.
The build shouldn't even start if you don't have Python 2.7 available so you must have gotten it from somewhere.
Gerald2 wrote:
2022-04-28, 08:57
The resource usage figures given at the end of the build are mostly unpopulated:
This functionality hasn't actively been used for a long time in our work and it's quite possible it doesn't work in some build environments at all. There really isn't much reason to collect this data anyway since we're hardly operating build farms ;P
We should probably remove it at some stage. Who knows, not obsessively measuring resources all the time might actually speed up the build, too.
"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

Locked