summaryrefslogtreecommitdiff
blob: 3e0cdc3e61f4cba51de561e40336bf2bf3e12188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: During the build process, a Context instance is pickled, or at
 least attempted to be.  This fails because self.node_class is assigned to a
 class which is nested inside the __init__() method.  Because Python cannot
 find this class at unpickling time (i.e. it cannot be imported), Python
 refuses to pickle the Context instance, leading to a FTBFS.  Since there's no
 obvious reason why the class has to be so nested, moving it to a module
 global solves the build failure.
Author: Barry Warsaw <barry@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91561

--- a/waflib/Context.py
+++ b/waflib/Context.py
@@ -51,6 +51,8 @@
 		global classes
 		classes.insert(0,cls)
 ctx=store_context('ctx',(object,),{})
+class node_class(waflib.Node.Node):
+    pass
 class Context(ctx):
 	errors=Errors
 	tools={}
@@ -60,8 +62,6 @@
 		except KeyError:
 			global run_dir
 			rd=run_dir
-		class node_class(waflib.Node.Node):
-			pass
 		self.node_class=node_class
 		self.node_class.__module__="waflib.Node"
 		self.node_class.__name__="Nod3"