|  |  | @ -21,7 +21,10 @@ class checksums: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 server = 'server.so' |  |  |  |                 server = 'server.so' | 
			
		
	
		
		
			
				
					
					|  |  |  |         ): |  |  |  |         ): | 
			
		
	
		
		
			
				
					
					|  |  |  |         from platform import machine |  |  |  |         from platform import machine | 
			
		
	
		
		
			
				
					
					|  |  |  |         self.env = aquery_config.os_platform + machine() + aquery_config.build_driver |  |  |  |         self.env = (aquery_config.os_platform + | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     machine() +  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     aquery_config.build_driver | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ) | 
			
		
	
		
		
			
				
					
					|  |  |  |         for key in self.__dict__.keys(): |  |  |  |         for key in self.__dict__.keys(): | 
			
		
	
		
		
			
				
					
					|  |  |  |             try: |  |  |  |             try: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 with open(eval(key), 'rb') as file: |  |  |  |                 with open(eval(key), 'rb') as file: | 
			
		
	
	
		
		
			
				
					|  |  | @ -37,12 +40,13 @@ class checksums: | 
			
		
	
		
		
			
				
					
					|  |  |  |             except FileNotFoundError: |  |  |  |             except FileNotFoundError: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 print('missing component: ' + key) |  |  |  |                 print('missing component: ' + key) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 self.sources[key] = None |  |  |  |                 self.sources[key] = None | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                  | 
			
		
	
		
		
			
				
					
					|  |  |  |     def __ne__(self, __o: 'checksums') -> 'checksums': |  |  |  |     def __ne__(self, __o: 'checksums') -> 'checksums': | 
			
		
	
		
		
			
				
					
					|  |  |  |         ret = checksums() |  |  |  |         ret = checksums() | 
			
		
	
		
		
			
				
					
					|  |  |  |         for key in self.__dict__.keys(): |  |  |  |         for key in self.__dict__.keys(): | 
			
		
	
		
		
			
				
					
					|  |  |  |             try: |  |  |  |             try: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ret.__dict__[key] = ( |  |  |  |                 ret.__dict__[key] = ( | 
			
		
	
		
		
			
				
					
					|  |  |  |                     self.__dict__[key] and __o.__dict__[key] and |  |  |  |                     not (self.__dict__[key] and __o.__dict__[key]) or | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     self.__dict__[key] != __o.__dict__[key] |  |  |  |                     self.__dict__[key] != __o.__dict__[key] | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ) |  |  |  |                 ) | 
			
		
	
		
		
			
				
					
					|  |  |  |             except KeyError: |  |  |  |             except KeyError: | 
			
		
	
	
		
		
			
				
					|  |  | @ -54,7 +58,7 @@ class checksums: | 
			
		
	
		
		
			
				
					
					|  |  |  |         for key in self.__dict__.keys(): |  |  |  |         for key in self.__dict__.keys(): | 
			
		
	
		
		
			
				
					
					|  |  |  |             try: |  |  |  |             try: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ret.__dict__[key] = ( |  |  |  |                 ret.__dict__[key] = ( | 
			
		
	
		
		
			
				
					
					|  |  |  |                     not (self.__dict__[key] and __o.__dict__[key]) or |  |  |  |                     self.__dict__[key] and __o.__dict__[key] and | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     self.__dict__[key] == __o.__dict__[key] |  |  |  |                     self.__dict__[key] == __o.__dict__[key] | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ) |  |  |  |                 ) | 
			
		
	
		
		
			
				
					
					|  |  |  |             except KeyError: |  |  |  |             except KeyError: | 
			
		
	
	
		
		
			
				
					|  |  | @ -82,16 +86,19 @@ class build_manager: | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.mgr = mgr |  |  |  |             self.mgr = mgr | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.build_cmd = [] |  |  |  |             self.build_cmd = [] | 
			
		
	
		
		
			
				
					
					|  |  |  |         def libaquery_a(self) : |  |  |  |         def libaquery_a(self) : | 
			
		
	
		
		
			
				
					
					|  |  |  |             pass |  |  |  |             return False | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         def pch(self): |  |  |  |         def pch(self): | 
			
		
	
		
		
			
				
					
					|  |  |  |             pass |  |  |  |             return False | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         def build(self, stdout = sys.stdout, stderr = sys.stderr): |  |  |  |         def build(self, stdout = sys.stdout, stderr = sys.stderr): | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ret = True | 
			
		
	
		
		
			
				
					
					|  |  |  |             for c in self.build_cmd: |  |  |  |             for c in self.build_cmd: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if c: |  |  |  |                 if c: | 
			
		
	
		
		
			
				
					
					|  |  |  |                     try: |  |  |  |                     try: | 
			
		
	
		
		
			
				
					
					|  |  |  |                         subprocess.call(c, stdout = stdout, stderr = stderr) |  |  |  |                         ret = subprocess.call(c, stdout = stdout, stderr = stderr) and ret | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     except (FileNotFoundError): |  |  |  |                     except (FileNotFoundError): | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ret = False | 
			
		
	
		
		
			
				
					
					|  |  |  |                         pass |  |  |  |                         pass | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ret | 
			
		
	
		
		
			
				
					
					|  |  |  |                  |  |  |  |                  | 
			
		
	
		
		
			
				
					
					|  |  |  |     class MakefileDriver(DriverBase): |  |  |  |     class MakefileDriver(DriverBase): | 
			
		
	
		
		
			
				
					
					|  |  |  |         def __init__(self, mgr : 'build_manager') -> None: |  |  |  |         def __init__(self, mgr : 'build_manager') -> None: | 
			
		
	
	
		
		
			
				
					|  |  | @ -132,7 +139,7 @@ class build_manager: | 
			
		
	
		
		
			
				
					
					|  |  |  |             loc = os.path.abspath('./msc-plugin/libaquery.vcxproj') |  |  |  |             loc = os.path.abspath('./msc-plugin/libaquery.vcxproj') | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.get_flags() |  |  |  |             self.get_flags() | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.build_cmd = [['del', 'libaquery.lib'], [aquery_config.msbuildroot, loc, self.opt, self.platform]] |  |  |  |             self.build_cmd = [['del', 'libaquery.lib'], [aquery_config.msbuildroot, loc, self.opt, self.platform]] | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.build() |  |  |  |             return self.build() | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         def pch(self): |  |  |  |         def pch(self): | 
			
		
	
		
		
			
				
					
					|  |  |  |             pass |  |  |  |             pass | 
			
		
	
	
		
		
			
				
					|  |  | @ -141,25 +148,18 @@ class build_manager: | 
			
		
	
		
		
			
				
					
					|  |  |  |             loc = os.path.abspath('./msc-plugin/server.vcxproj') |  |  |  |             loc = os.path.abspath('./msc-plugin/server.vcxproj') | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.get_flags() |  |  |  |             self.get_flags() | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.build_cmd = [['del', 'server.so'], [aquery_config.msbuildroot, loc, self.opt, self.platform]] |  |  |  |             self.build_cmd = [['del', 'server.so'], [aquery_config.msbuildroot, loc, self.opt, self.platform]] | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.build() |  |  |  |             return self.build() | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         def snippet(self): |  |  |  |         def snippet(self): | 
			
		
	
		
		
			
				
					
					|  |  |  |             loc = os.path.abspath('./msc-plugin/msc-plugin.vcxproj') |  |  |  |             loc = os.path.abspath('./msc-plugin/msc-plugin.vcxproj') | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.get_flags() |  |  |  |             self.get_flags() | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.build_cmd = [[aquery_config.msbuildroot, loc, self.opt, self.platform]] |  |  |  |             self.build_cmd = [[aquery_config.msbuildroot, loc, self.opt, self.platform]] | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.build() |  |  |  |             return self.build() | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     #class PythonDriver(DriverBase): |  |  |  |     #class PythonDriver(DriverBase): | 
			
		
	
		
		
			
				
					
					|  |  |  |     #    def __init__(self, mgr : 'build_manager') -> None: |  |  |  |     #    def __init__(self, mgr : 'build_manager') -> None: | 
			
		
	
		
		
			
				
					
					|  |  |  |     #        super().__init__(mgr)            |  |  |  |     #        super().__init__(mgr)            | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     #@property |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     #def MSBuild(self): |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     #    return MSBuildDriver(self) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     #@property |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     #def Makefile(self): |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     #    return MakefileDriver(self) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     def __init__(self) -> None: |  |  |  |     def __init__(self) -> None: | 
			
		
	
		
		
			
				
					
					|  |  |  |         self.method = 'make' |  |  |  |         self.method = 'make' | 
			
		
	
		
		
			
				
					
					|  |  |  |         self.cxx = '' |  |  |  |         self.cxx = '' | 
			
		
	
	
		
		
			
				
					|  |  | @ -181,7 +181,9 @@ class build_manager: | 
			
		
	
		
		
			
				
					
					|  |  |  |     def build_caches(self, force = False): |  |  |  |     def build_caches(self, force = False): | 
			
		
	
		
		
			
				
					
					|  |  |  |         cached = checksums() |  |  |  |         cached = checksums() | 
			
		
	
		
		
			
				
					
					|  |  |  |         current = checksums() |  |  |  |         current = checksums() | 
			
		
	
		
		
			
				
					
					|  |  |  |         libaquery_a = 'libaquery.lib' if aquery_config.os_platform else 'libaquery.a' |  |  |  |         libaquery_a = 'libaquery.a'  | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if aquery_config.os_platform == 'win': | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             libaquery_a = 'libaquery.lib' | 
			
		
	
		
		
			
				
					
					|  |  |  |         current.calc(libaquery_a) |  |  |  |         current.calc(libaquery_a) | 
			
		
	
		
		
			
				
					
					|  |  |  |         try: |  |  |  |         try: | 
			
		
	
		
		
			
				
					
					|  |  |  |             with open('.cached', 'rb') as cache_sig: |  |  |  |             with open('.cached', 'rb') as cache_sig: | 
			
		
	
	
		
		
			
				
					|  |  | @ -190,18 +192,25 @@ class build_manager: | 
			
		
	
		
		
			
				
					
					|  |  |  |             pass |  |  |  |             pass | 
			
		
	
		
		
			
				
					
					|  |  |  |         self.cache_status = current != cached |  |  |  |         self.cache_status = current != cached | 
			
		
	
		
		
			
				
					
					|  |  |  |          |  |  |  |          | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         success = True | 
			
		
	
		
		
			
				
					
					|  |  |  |         if  force or self.cache_status.sources: |  |  |  |         if  force or self.cache_status.sources: | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.driver.pch() |  |  |  |             self.driver.pch() | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.driver.libaquery_a() |  |  |  |             self.driver.libaquery_a() | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.driver.server() |  |  |  |             self.driver.server() | 
			
		
	
		
		
			
				
					
					|  |  |  |         else: |  |  |  |         else: | 
			
		
	
		
		
			
				
					
					|  |  |  |             if self.cache_status.libaquery_a: |  |  |  |             if self.cache_status.libaquery_a: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 self.driver.libaquery_a() |  |  |  |                 success = self.driver.libaquery_a() and success | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             if self.cache_status.pch_hpp_gch: |  |  |  |             if self.cache_status.pch_hpp_gch: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 self.driver.pch() |  |  |  |                 success = self.driver.pch() and success | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             if self.cache_status.server: |  |  |  |             if self.cache_status.server: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 self.driver.server() |  |  |  |                 success = self.driver.server() and success | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if success: | 
			
		
	
		
		
			
				
					
					|  |  |  |             current.calc(libaquery_a) |  |  |  |             current.calc(libaquery_a) | 
			
		
	
		
		
			
				
					
					|  |  |  |             with open('.cached', 'wb') as cache_sig: |  |  |  |             with open('.cached', 'wb') as cache_sig: | 
			
		
	
		
		
			
				
					
					|  |  |  |                 cache_sig.write(pickle.dumps(current)) |  |  |  |                 cache_sig.write(pickle.dumps(current)) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         else: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             try: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 os.remove('./.cached') | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             except: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 pass | 
			
		
	
		
		
			
				
					
					|  |  |  |              |  |  |  |              | 
			
		
	
	
		
		
			
				
					|  |  | 
 |