What version of xulrunner SDK for compiling Javascript XPCOM components?

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
moonbat
Knows the dark side
Knows the dark side
Posts: 4658
Joined: 2015-12-09, 15:45
Contact:

What version of xulrunner SDK for compiling Javascript XPCOM components?

Unread post by moonbat » 2023-05-27, 06:27

I"m following this guide on how to create a Javascript XPCOM component, and it describes compiling an IDL using xpidl from the xulrunner sdk. I downloaded the sdk from here, version 41.0.2 but it has a python script called xpidl.py, and that gives an error on running -

Code: Select all

 except IDLError, e:
           ^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized
Is there a specific older version of the SDK that's compatible with Pale Moon - or is this a Python 2 vs 3 related problem?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

thosrtanner
Lunatic
Lunatic
Posts: 393
Joined: 2014-05-10, 18:19
Location: UK

Re: What version of xulrunner SDK for compiling Javascript XPCOM components?

Unread post by thosrtanner » 2023-05-27, 15:57

That's a python2/3 problem

Code: Select all

    except IDLError, e:
is python 2 syntax. python3 expects

Code: Select all

    except IDLError as e:
You'd probably be better getting hold of a python2 interpreter, as you could run across all sorts of fun doing the upconversion.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4658
Joined: 2015-12-09, 15:45
Contact:

Re: What version of xulrunner SDK for compiling Javascript XPCOM components?

Unread post by moonbat » 2023-05-28, 04:22

Good idea, I already have python2 so I'll try using that.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4658
Joined: 2015-12-09, 15:45
Contact:

Re: What version of xulrunner SDK for compiling Javascript XPCOM components?

Unread post by moonbat » 2023-05-28, 13:53

No dice :(
It won't parse the commandline arguments as per the documentation (section on compiling the typelib).

Code: Select all

python2 xpidl.py -m typelib -w -v -I ~/Documents/code/xulrunner-sdk/idl/ -e ~/Documents/code/pmplusobserver.idl ~/Documents/code/pmplusobserver.xpt
Parsing -m
Traceback (most recent call last):
  File "xpidl.py", line 1427, in <module>
    p.parse(open(f).read(), filename=f)
IOError: [Errno 2] No such file or directory: '-m'
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

thosrtanner
Lunatic
Lunatic
Posts: 393
Joined: 2014-05-10, 18:19
Location: UK

Re: What version of xulrunner SDK for compiling Javascript XPCOM components?

Unread post by thosrtanner » 2023-05-28, 20:14

I looked at the code and there's no way that command line they give you is right. Although to be fair, it suggest's you should be running xpidl.exe, not xpidl.py. I can't see the former anywhere in my download. The latter doesn't accept anything other than a list of idl files to parse

Post Reply