Trying to build, struggling

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.
disconect

Trying to build, struggling

Unread post by disconect » 2020-02-22, 06:31

Hello,

I am new to the forum. I am a longtime Pale Moon user on Windows but recently bought a used iMac to try and get into video editing. It runs Catalina 10.15.3. I am trying to get PM built using the instructions at https://developer.palemoon.org/Develope ... Moon/macOS

The instructions are either incomplete or I don't know what I'm doing (quite likely). I installed xcode and Homebrew. I ran the command "git clone https://github.com/MoonchildProductions/UXP.git". Then the instruct ions said "For a build corresponding to a release of Pale Moon, switch to the release branch, Pale_Moon-release." I don't understand what to do there.

I carried on anyway. I installed autoconf 2.13. Then it came time to create the .mozconfig file. I did this using nano, and just copy/pasted what was in the instructions.

I don't think I have to worry about different SDK versions, so I moved on to running ./mach build. This gave an error that it could not find my .mozconfig file in the obj-x86_64-apple-darwin19.3.0 folder. So, I copied the file there and tried it again. Then it said "ERROR: Cannot find project application/palemoon."

I tried going to the URL https://github.com/MoonchildProductions in Firefox. I noticed there is a UXP section and a Pale-Moon section. So, I figured maybe the instructions left off that I have to download the Pale-Moon stuff in addition to UXP. So I ran "git clone https://github.com/MoonchildProductions/Pale-Moon.git" which did download some stuff. I tried creating the .mozconfig file there and running "./mach build" but that did not work. I did notice in the README.md file that it said I should also run "git submodule init && git submodule update" which I did, but have still not been able to get anything to work.

What am I doing wrong, or missing? Thank you for your help.

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

Re: Trying to build, struggling

Unread post by Moonchild » 2020-02-22, 09:18

The build instructions need to be updated for building the new milestone.

If you want to build the current release version, you HAVE to switch to the correct branch because the master branch will be catering to both unstable development AND the new milestone which doesn't have applications inside the tree anymore (just the platform).
So you need to:

Code: Select all

git checkout Pale_Moon-release
to get to the correct branch before building.

What is in the README when on the master branch applies to the new milestone and doesn't apply to building the current release (you'll notice it to be different on the release branch)
"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

disconect

Re: Trying to build, struggling

Unread post by disconect » 2020-02-22, 18:32

Thank you for your reply! I used the command you gave to switch to the correct branch. Here's the errors I'm getting now:

Code: Select all

configure: error: installation or configuration problem: C++ compiler cannot create executables.
DEBUG: <truncated - see config.log for full output>
DEBUG: 1 warning generated.
DEBUG: configure:2312: checking whether the C compiler (/usr/bin/clang -std=gnu99  ) is a cross-compiler
DEBUG: configure:2317: checking whether we are using GNU C
DEBUG: configure:2326: /usr/bin/clang -std=gnu99 -E conftest.c
DEBUG: configure:2345: checking whether /usr/bin/clang -std=gnu99 accepts -g
DEBUG: configure:2386: checking for c++
DEBUG: configure:2418: checking whether the C++ compiler (/usr/bin/clang++ -std=gnu++11  ) works
DEBUG: configure:2434: /usr/bin/clang++ -std=gnu++11 -o conftest    conftest.C  1>&5
DEBUG: clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
DEBUG: warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
DEBUG: 1 warning generated.
DEBUG: ld: library not found for -lstdc++
DEBUG: clang: error: linker command failed with exit code 1 (use -v to see invocation)
DEBUG: configure: failed program was:
DEBUG: 
DEBUG: #line 2429 "configure"
DEBUG: #include "confdefs.h"
DEBUG: 
DEBUG: int main(){return(0);}
DEBUG: configure: error: installation or configuration problem: C++ compiler cannot create executables.
ERROR: old-configure failed
*** Fix above errors and then restart with               "/Library/Developer/CommandLineTools/usr/bin/make -f client.mk build"
So, it told me to run

Code: Select all

/Library/Developer/CommandLineTools/usr/bin/make -f client.mk build
but the errors gave me some parameters to add. Not sure if I did this right, but I added them to the above command, like this:

Code: Select all

/Library/Developer/CommandLineTools/usr/bin/make -f client.mk build -Wdeprecated -stdlib=libc++
When I run that, I get the same thing, so obviously I didn't put those parameters in the right place, or I need to do something else entirely. What should I do now?

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

Re: Trying to build, struggling

Unread post by Moonchild » 2020-02-22, 18:53

I'm afraid someone more familiar with building for Mac will have to help you.
"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

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Trying to build, struggling

Unread post by adesh » 2020-02-22, 21:24

disconect wrote:
2020-02-22, 18:32
Thank you for your reply! I used the command you gave to switch to the correct branch. Here's the errors I'm getting now:
Add following to your mozconfig:

Code: Select all

export CXXFLAGS=-stdlib=libc++

Additionally, I'd suggest building against an older SDK due to some graphics issues on later ones. Download 10.12 version of SDK and add the following (adjust for your SDK path):

Code: Select all

ac_add_options --with-macos-sdk=/Users/your_name/Downloads/MacOSX10.12.sdk
Off-topic:
You are lucky that I visited forum today. Not too many people build on Mac (for obvious reasons).

New Tobin Paradigm

Re: Trying to build, struggling

Unread post by New Tobin Paradigm » 2020-02-22, 22:14

I thought we were targeting 10.8 sdk.

Also it is always good to see you Adesh!

disconect

Re: Trying to build, struggling

Unread post by disconect » 2020-02-23, 07:08

adesh wrote:
2020-02-22, 21:24
Add following to your mozconfig:

Code: Select all

export CXXFLAGS=-stdlib=libc++
Additionally, I'd suggest building against an older SDK due to some graphics issues on later ones. Download 10.12 version of SDK and add the following (adjust for your SDK path):

Code: Select all

ac_add_options --with-macos-sdk=/Users/your_name/Downloads/MacOSX10.12.sdk
Thank you, It was a lot of work but I finally was able to get it to build "successfully" but when I do ./mach run New Moon starts for a second and then quits unexpectedly. I don't know what went wrong. I have to sleep I'll worry about this later. Thanks for your help!

sugis

Re: Trying to build, struggling

Unread post by sugis » 2020-02-25, 23:08

If you launch your built binary in gdb / lldb it should include a helpful backtrace when the application crashes

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Trying to build, struggling

Unread post by adesh » 2020-02-26, 17:57

New Tobin Paradigm wrote:
2020-02-22, 22:14
I thought we were targeting 10.8 sdk.
I didn't know about that and don't remember any discussion around it. I just use the latest SDK which works (minimum downgrade) because later ones give me some graphics problems causing Pale Moon window to go all black.

Today, I tried 10.8 version and after adding a couple of configure options and fixing an issue with __sincos function (which is only available in math library starting 10.9) by manually "undefining" HAVE___SINCOS (my system being latest Mojave reports that it has __sincos) in the generated build configuration, I was able to have a proper build with my mozconfig which is close to official. I was able to package, run the browser and open a few sites.

So, I think there is no issue in targeting 10.8 version of SDK other than some release engineering/configuration work on more recent versions of Mac OS.

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

Re: Trying to build, struggling

Unread post by dbsoft » 2020-02-26, 22:56

Mojave 10.14 made significant changes to how the graphics contexts function, I had to do significant rewrites to my library to get rendering to work again using the 10.14 and 10.15 SDKs, I suspect similar changes will need to be done in Pale Moon unless older SDKs continue to be targeted, since if built using the older SDKs you can use the APIs in the old ways and they continue to work, but not with the newer ones.

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

Re: Trying to build, struggling

Unread post by dbsoft » 2020-02-27, 23:55

I did a debug mode build and I get an assertion failure on startup.... it seems that this code is only enabled in debug mode:

Assertion failure: selfHostedFun->getExtendedSlot(0).toBoolean(), at /Users/..../work/github/UXP/js/src/vm/SelfHosting.cpp:3080

So I just disabled that code and it progressed:

1582847529806 addons.manager ERROR Exception calling provider PluginProvider.getAddonsByTypes: [Exception... "Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]" nsresult: "0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE)" location: "JS frame :: resource://gre/modules/addons/PluginProvider.jsm :: getIDHashForString :: line 33" data: no] Stack trace: getIDHashForString()@resource://gre/modules/addons/PluginProvider.jsm:33 < PL_getPluginList()@resource://gre/modules/addons/PluginProvider.jsm:207 < PL_buildPluginList()@resource://gre/modules/addons/PluginProvider.jsm:229 < PL_getAddonsByTypes()@resource://gre/modules/addons/PluginProvider.jsm:153 < callProviderAsync()@resource://gre/modules/AddonManager.jsm:222 < nextObject()@resource://gre/modules/AddonManager.jsm:2146 < callNext()@resource://gre/modules/AddonManager.jsm:329 < getAddonsByTypes_concatAddons()@resource://gre/modules/AddonManager.jsm:2151 < getAddonsByTypes()@resource://gre/modules/addons/GMPProvider.jsm:550 < callProviderAsync()@resource://gre/modules/AddonManager.jsm:222 < nextObject()@resource://gre/modules/AddonManager.jsm:2146 < callNext()@resource://gre/modules/AddonManager.jsm:329 < getAddonsByTypes_concatAddons()@resource://gre/modules/AddonManager.jsm:2151 < getAddonsByTypes()@resource://gre/modules/LightweightThemeManager.jsm:380 < callProviderAsync()@resource://gre/modules/AddonManager.jsm:222 < nextObject()@resource://gre/modules/AddonManager.jsm:2146 < callNext()@resource://gre/modules/AddonManager.jsm:329 < getAddonsByTypes_concatAddons()@resource://gre/modules/AddonManager.jsm:2151 < getAddonsByTypes_getVisibleAddons()@resource://gre/modules/addons/XPIProvider.jsm:3835 < makeSafe/<()@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:149 < asyncMap()@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:177 < getAddonList/<()@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:1058 < process()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:932 < walkerLoop()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:813 < scheduleWalkerLoop/<()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:747
Assertion failure: initlen > 0, at /Users/..../work/github/UXP/js/src/jsarray.cpp:2108

Anyone have any clues about these problems before I dive in?

Thanks,
Brian

New Tobin Paradigm

Re: Trying to build, struggling

Unread post by New Tobin Paradigm » 2020-02-28, 01:29

Yeah, don't do debug builds they aren't well maintained yet. It is something we are looking into now officially though.

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

Re: Trying to build, struggling

Unread post by dbsoft » 2020-02-29, 05:07

You are right debug builds are broken. I did a non-debug build and it loaded up fine... but then had an assertion failure here:

Assertion failure: NS_IsMainThread(), at /Users/..../work/github/UXP/security/manager/ssl/nsNSSComponent.cpp:258

Code: Select all

* thread #25, name = 'Cache2 I/O', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000105bc6021 XUL`nsNSSComponent::nsNSSComponent(this=0x000000012b299dd0) at nsNSSComponent.cpp:258:3
   255 	#endif
   256 	{
   257 	  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent::ctor\n"));
-> 258 	  MOZ_RELEASE_ASSERT(NS_IsMainThread());
   259 	
   260 	  NS_ASSERTION( (0 == mInstanceCount), "nsNSSComponent is a singleton, but instantiated multiple times!");
   261 	  ++mInstanceCount;
Target 0: (palemoon) stopped.
Why would something running on a cache I/O thread check to make sure it is on the main thread?

After some investigation of this, I've discovered what is likely happening based on similar problems on Linux. NSS is supposed to get initialized on the main thread during startup, but if it fails for some reason, it is left uninitialized. Then when a page tries to load, it attempts to create a connection and it finds NSS uninitialized, so it tries again, however this time it is not on the main thread, and it hits this ASSERT. The browser window opens up and it attempts to load the Palemoon start page. So that definitely seems to be what is happening. Not sure why however, going to try to debug through it and see what is happening unless anyone has seen this before and can give me a pointer.

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

Re: Trying to build, struggling

Unread post by dbsoft » 2020-02-29, 16:11

Okay, so after a ridiculous amount of time debugging... far more than it should have taken... I have discovered there is essentially nothing wrong and my build works fine. Posting this message with it right now...

Basically I was running ./mach run and lldb from the UXP source directory. NSS was trying to load libsoftokn3.dylib and wasn't finding it causing NSS to fail to initialize. Then the assert failure exactly as I described in my previous message.

If I had just opened the app from the MacOS folder it would have run fine... I had issues with this with my own apps and I basically have them change the current working directory to the .app/Contents/MacOS folder on initialization. Apparently Palemoon/Mozilla don't do this so it couldn't find the libraries.

Looks like I am up and running with builds, but I am curious where effort should be placed going forward... getting things working on newer SDKs?

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

Re: Trying to build, struggling

Unread post by dbsoft » 2020-03-01, 06:59

Interestingly, I just did a build on my 10.11 machine. (It is an old MacPro1,1 that can't run anything newer) and it starts up with no problems finding libsoftokn3.dylib so it seems like the issue is either with Catalina or the build environment on 10.15. I'll try a build on Mojave 10.14 and see what happens there. Also this version is showing 28.8.4 instead of 28.8.3... pretty sure I checked out the release branch... is a new release imminent or did I screw up the checkout?

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Trying to build, struggling

Unread post by adesh » 2020-03-01, 08:13

dbsoft wrote:
2020-03-01, 06:59
is a new release imminent or did I screw up the checkout?
Off-topic:
You shouldn't be asking that question. You can easily know this just by checking the commits in the branch.

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

Re: Trying to build, struggling

Unread post by dbsoft » 2020-03-01, 08:32

adesh wrote:
2020-03-01, 08:13
Off-topic:
You shouldn't be asking that question. You can easily know this just by checking the commits in the branch.
Look, I am not familiar with git, I use svn and mercurial... I'll have to figure out how to do that with git. Why shouldn't I be asking that?

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Trying to build, struggling

Unread post by adesh » 2020-03-01, 08:36

dbsoft wrote:
2020-03-01, 08:32
Why shouldn't I be asking that?
Because it's too trivial. If you don't know git commands, you could easily go to GitHub. See https://github.com/MoonchildProductions ... on-release

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

Re: Trying to build, struggling

Unread post by dbsoft » 2020-03-01, 09:07

adesh wrote:
2020-03-01, 08:36
Because it's too trivial. If you don't know git commands, you could easily go to GitHub. See https://github.com/MoonchildProductions ... on-release
I don't care if you think it is too trivial, I will learn the git commands if I need to. So far I have not needed to, I chose to use mercurial with my projects since I dislike git's commands. If there is no rule against asking that then just keep it to yourself. I am trying to help with the project, I don't need this attitude from you, it is making me not want to help.

To everyone else:

I just finished a build on Mojave 10.14 and it also does not exhibit the library load issue, so it seems to be Catalina specific. I did builds on Catalina on two systems and both had the issue.

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Trying to build, struggling

Unread post by adesh » 2020-03-01, 16:34

dbsoft wrote:
2020-03-01, 09:07
I don't care if you think it is too trivial, I will learn the git commands if I need to.
Off-topic:
Nobody asked you to learn git commands. You could go to the project's GitHub page and see what happened. There is no reason to behave like you behaved, but if that is your attitude when someone points out something that you'd have done yourself easily, I don't know how much you'd be able to help and how long you'd survive. Having said that, I'd really like you to gear up and join the party. We have very few Mac people. Welcome!

Locked