autobuild and llbase for python3???

16 views
Skip to first unread message

Lance Corrimal

unread,
Jan 5, 2021, 2:44:36 AM1/5/21
to opensource-dev
Hey list,


how/where do I get an autobuild and llbase that can be used with python3? I'm
trying to build on linux and openSUSE is in the process of completely dropping
python2 because it's so old and deprecated...


Cheers
LC



Henri Beauchamp

unread,
Jan 5, 2021, 3:57:43 AM1/5/21
to opensource-dev
AFAIK (not sure, for I'm not using LL's build system), the Python
scripts in llbase are already Python v3 compatible. The llmanifest.py
script in the viewer sources might however still be a Python v2 script.

For my viewer (which uses a stand-alone build system with just a few
of the llbase scripts needed and included in its source tree), I
modified llmanifest.py (in fact, I kept the old one for Python v2 and
made a llmanifest3.py for Python 3, loading the right script from
viewer_manifest.py depending on the Python version).

You would not be able to just use my llmanifest3.py version (because
the sources layout is different than LL's viewer), but here is a diff
between the two, that could give you an idea of what you would need to
change to get your viewer to compile with Python v3:

---------------------- < cut here >----------------------
--- llmanifest.py 2020-09-26 16:29:04.434856548 +0200
+++ llmanifest3.py 2020-09-26 16:19:49.884873932 +0200
@@ -1,7 +1,7 @@
"""\
-@file llmanifest.py
+@file llmanifest3.py
@author Ryan Williams
-@brief Python2 library for specifying operations on a set of files.
+@brief Library for specifying operations on a set of files.

$LicenseInfo:firstyear=2007&license=mit$

@@ -153,20 +153,20 @@

def usage(srctree=""):
nd = {'name':sys.argv[0]}
- print """Usage:
+ print("""Usage:
%(name)s [options] [destdir]
Options:
- """ % nd
+ """ % nd)
for arg in ARGUMENTS:
default = arg['default']
if hasattr(default, '__call__'):
default = "(computed value) \"" + str(default(srctree)) + '"'
elif default is not None:
default = '"' + default + '"'
- print "\t--%s Default: %s\n\t%s\n" % (
+ print("\t--%s Default: %s\n\t%s\n" % (
arg['name'],
default,
- arg['description'] % nd)
+ arg['description'] % nd))

def main():
option_names = [arg['name'] + '=' for arg in ARGUMENTS]
@@ -183,9 +183,9 @@
for k in 'build dest source'.split():
args[k] = os.path.normpath(args[k])

- print "Source tree:", args['source']
- print "Build tree:", args['build']
- print "Destination tree:", args['dest']
+ print("Source tree:", args['source'])
+ print("Build tree:", args['build'])
+ print("Destination tree:", args['dest'])

# early out for help
if 'help' in args:
@@ -211,7 +211,7 @@

# debugging
for opt in args:
- print "Option:", opt, "=", args[opt]
+ print("Option:", opt, "=", args[opt])

wm = LLManifest.for_platform(args['platform'])(args)
wm.do(*args['actions'])
@@ -223,7 +223,7 @@
fp = open(touch, 'w')
fp.write('set package_file=%s\n' % wm.package_file)
fp.close()
- print 'touched', touch
+ print('touched', touch)
return 0

class LLManifestRegistry(type):
@@ -233,8 +233,7 @@
if match:
cls.manifests[match.group(1).lower()] = cls

-class LLManifest(object):
- __metaclass__ = LLManifestRegistry
+class LLManifest(object, metaclass=LLManifestRegistry):
manifests = {}
def for_platform(self, platform):
return self.manifests[platform.lower()]
@@ -289,7 +288,7 @@
build = self.build_prefix.pop()
dst = self.dst_prefix.pop()
if descr and not(src == descr or build == descr or dst == descr):
- raise ValueError, "End prefix '" + descr + "' didn't match '" +src+ "' or '" +dst + "'"
+ raise ValueError("End prefix '" + descr + "' didn't match '" +src+ "' or '" +dst + "'")

def get_src_prefix(self):
""" Returns the current source prefix."""
@@ -339,7 +338,7 @@
an exception if the command reurns a nonzero status code. For
debugging/informational purpoases, prints out the command's
output as it is received."""
- print "Running command:", command
+ print("Running command:", command)
fd = os.popen(command, 'r')
lines = []
while True:
@@ -347,7 +346,7 @@
if lines[-1] == '':
break
else:
- print lines[-1],
+ print(lines[-1], end=' ')
output = ''.join(lines)
status = fd.close()
if status:
@@ -361,7 +360,7 @@
a) verify that you really have created it
b) schedule it for cleanup"""
if not os.path.exists(path):
- raise RuntimeError, "Should be something at path " + path
+ raise RuntimeError("Should be something at path " + path)
self.created_paths.append(path)

def put_in_file(self, contents, dst, src=None):
@@ -388,7 +387,7 @@
contents = f.read()
f.close()
# apply dict replacements
- for old, new in searchdict.iteritems():
+ for old, new in searchdict.items():
contents = contents.replace(old, new)
self.put_in_file(contents, dst)
self.created_paths.append(dst)
@@ -404,7 +403,7 @@
# src is a dir
self.ccopytree(src,dst)
else:
- print "Doesn't exist:", src
+ print("Doesn't exist:", src)

def package_action(self, src, dst):
pass
@@ -419,7 +418,7 @@
unpacked_file_name = "unpacked_%(plat)s_%(vers)s.tar" % {
'plat':self.args['platform'],
'vers':'_'.join(self.args['version'])}
- print "Creating unpacked file:", unpacked_file_name
+ print("Creating unpacked file:", unpacked_file_name)
# could add a gz here but that doubles the time it takes to do this step
tf = tarfile.open(self.src_path_of(unpacked_file_name), 'w:')
# add the entire installation package, at the very top level
@@ -430,7 +429,7 @@
""" Delete paths that were specified to have been created by this script"""
for c in self.created_paths:
# *TODO is this gonna be useful?
- print "Cleaning up " + c
+ print("Cleaning up " + c)

def process_file(self, src, dst):
if self.includes(src, dst):
@@ -475,7 +474,7 @@
def remove(self, *paths):
for path in paths:
if os.path.exists(path):
- print "Removing path", path
+ print("Removing path", path)
if os.path.isdir(path):
shutil.rmtree(path)
else:
@@ -498,7 +497,7 @@
if self.includes(src, dst):
try:
os.unlink(dst)
- except OSError, err:
+ except OSError as err:
if err.errno != errno.ENOENT:
raise

@@ -523,10 +522,10 @@
else:
self.ccopy(srcname, dstname)
# XXX What about devices, sockets etc.?
- except (IOError, os.error), why:
+ except (IOError, os.error) as why:
errors.append((srcname, dstname, why))
if errors:
- raise RuntimeError, errors
+ raise RuntimeError(errors)


def cmakedirs(self, path):
@@ -646,7 +645,7 @@
# files. src is probably a wildcard meant for some other pfx. Loop
# back to try the next.

- print "%d files" % count
+ print("%d files" % count)

# Let caller check whether we processed as many files as expected. In
# particular, let caller notice 0.
---------------------- < cut here >----------------------

Henri.

Lance Corrimal

unread,
Jan 6, 2021, 6:36:55 AM1/6/21
to Henri Beauchamp, opensource-dev
Am 2021-01-05 09:57, schrieb Henri Beauchamp:
> On Tue, 05 Jan 2021 08:44:32 +0100, Lance Corrimal wrote:
>
>> how/where do I get an autobuild and llbase that can be used with
>> python3? I'm trying to build on linux and openSUSE is in the process
>> of completely dropping python2 because it's so old and deprecated...
>
> AFAIK (not sure, for I'm not using LL's build system), the Python
> scripts in llbase are already Python v3 compatible. The llmanifest.py
> script in the viewer sources might however still be a Python v2 script.


Well, I am, and the current lindenlab autobuild is not compatible with
python 3 - on the other hand there are two branches in its repository
that look as if they might get it to that point.

@Linden Lab: What's holding things up? Python 2 has been EOL'd for more
than a whole year now...


Cheers
LC


--
I do stuff.

Tonya Souther

unread,
Jan 6, 2021, 1:10:50 PM1/6/21
to opensource-dev
Looking at the Bitbucket repository: there's been some work done on making autobuild Python 3 compatible, but it hasn't been pulled into the next release branch, v1.2. There are two outstanding pull requests from September. Nat needs to review both, and Signal needs to review one.

I kinda hesitate on poking that bear just yet, until the outstanding work is done. I hate reinventing wheels. Can we get some movement on that?

--
Archives of earlier incarnations of this list are at https://list-archives.secondlife.com
---
You received this message because you are subscribed to the Google Groups "opensource-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opensource-de...@lists.secondlife.com.
To view this discussion on the web visit https://groups.google.com/a/lists.secondlife.com/d/msgid/opensource-dev/b6762859ba6288023756276fd6ae8daf%40eregion.de.

Monty Brandenberg

unread,
Jan 6, 2021, 1:38:22 PM1/6/21
to opensou...@lists.secondlife.com
On 1/6/2021 6:36 AM, Lance Corrimal wrote:

> @Linden Lab: What's holding things up? Python 2 has been EOL'd for more
> than a whole year now...

Moving to AWS?

Tonya Souther

unread,
Jan 7, 2021, 1:19:07 PM1/7/21
to opensource-dev
I've filed OPEN-355 to make viewer_manifest.py compatible with Python 3. I've also created a pull request with the necessary changes.

The code as submitted is compatible with both Python 2 and 3. If Python 2 compatibility is not desired, there are two places where code can be removed; those places are commented.

--
Archives of earlier incarnations of this list are at https://list-archives.secondlife.com
---
You received this message because you are subscribed to the Google Groups "opensource-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opensource-de...@lists.secondlife.com.

Lance Corrimal

unread,
Jan 7, 2021, 2:32:05 PM1/7/21
to opensou...@lists.secondlife.com
so infrastructure ops and software development aren't separate, dedicated
teams?


Cheers
LC


Tonya Souther

unread,
Jan 7, 2021, 2:34:17 PM1/7/21
to opensource-dev
That assumes that the move to AWS wasn't an all-hands-on-deck effort, and I'm pretty sure it would have been.

--
Archives of earlier incarnations of this list are at https://list-archives.secondlife.com
---
You received this message because you are subscribed to the Google Groups "opensource-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opensource-de...@lists.secondlife.com.

Lance Corrimal

unread,
Jan 8, 2021, 1:26:11 AM1/8/21
to opensou...@lists.secondlife.com
Am Donnerstag, 7. Januar 2021, 19:18:55 CET schrieb Tonya Souther:
> I've filed OPEN-355 to make viewer_manifest.py compatible with Python 3.
> I've also created a pull request with the necessary changes.

but autobuild itself isn't python3 compatible...


Cheers
LC

slacker

unread,
Jan 8, 2021, 3:01:50 AM1/8/21
to opensource-dev, Lance Corrimal
I have a slackware64-current build that  autobuild I made sure was installed to python 3 not 2.7.  did so by removing python2.7 just for extra measures.
more than welcome to copy my LLbase that is part of the linux viewer since LL no longer uses Linux.  indra/lib
also. pip3 worked for me. this is the little project I am working on for gcc 10.2.0 still cleaning it up but it builds.
and of my long term build of the viewer gcc 5.5.0 slackware14.2  ld.gold linker.
I am sure the FS team has this also.
good luck
Linux is no longer supported by Linden Labs.
Do not try to use the linux64 Libraries ask Nat why.

Tonya Souther

unread,
Jan 8, 2021, 5:10:13 AM1/8/21
to opensource-dev
You're right, it's not, but they're already working on that, so why reinvent wheels?

Monty Brandenberg

unread,
Jan 8, 2021, 6:26:53 PM1/8/21
to opensou...@lists.secondlife.com
On 1/7/2021 2:34 PM, Tonya Souther wrote:
> That assumes that the move to AWS wasn't an all-hands-on-deck effort,
> and I'm pretty sure it would have been.

That is pretty much 2020 in a nutshell. :-) I'd hoped to get through
the move without being forced to add Py2->Py3 to the workload and we
just got by. But Py2 has to go, long overdue.

m

Lance Corrimal

unread,
Jan 9, 2021, 2:44:14 AM1/9/21
to opensou...@lists.secondlife.com
Am Samstag, 9. Januar 2021, 00:26:51 CET schrieb Monty Brandenberg:

> But Py2 has to go, long overdue.

That sentence is good enough for me.


Cheers
LC




Reply all
Reply to author
Forward
0 new messages