@@ -144,6 +144,8 @@ def __str__(self):
144144class Bundle :
145145 def __init__ (self , bundle_path : Path ) -> None :
146146 self .tmp_dir = TemporaryDirectory ()
147+ self .disable_precompilation = False
148+
147149 if bundle_path .is_dir ():
148150 self .bundle_path = Path (self .tmp_dir .name ) / bundle_path .name
149151 shutil .copytree (
@@ -190,7 +192,8 @@ def supports_windows() -> set[BundlePlatform]:
190192 elif current_system == "Windows" and BundlePlatform .WINDOWS not in self .platforms :
191193 raise BundleException ("Bundle doesn't support Windows!" )
192194
193- self .codeql = CodeQL (self .bundle_path / "codeql" )
195+ self .codeql = CodeQL (self .bundle_codeql_exe )
196+
194197 try :
195198 logging .info (f"Validating the CodeQL CLI version part of the bundle." )
196199 unpacked_location = self .codeql .unpacked_location ()
@@ -215,12 +218,28 @@ def __del__(self) -> None:
215218 f"Removing temporary directory { self .tmp_dir .name } used to build custom bundle."
216219 )
217220 self .tmp_dir .cleanup ()
218-
221+
219222 def get_bundle_packs (self ) -> List [ResolvedCodeQLPack ]:
220223 return self .bundle_packs
221224
222225 def supports_platform (self , platform : BundlePlatform ) -> bool :
223226 return platform in self .platforms
227+
228+ @property
229+ def bundle_codeql_exe (self ):
230+ if platform .system () == "Windows" :
231+ return self .bundle_path / "codeql.exe"
232+
233+ return self .bundle_path / "codeql"
234+
235+ @property
236+ def disable_precompilation (self ):
237+ return self ._disable_precompilation
238+
239+ @disable_precompilation .setter
240+ def disable_precompilation (self , value : bool ):
241+ self ._disable_precompilation = value
242+
224243
225244class CustomBundle (Bundle ):
226245 def __init__ (self , bundle_path : Path , workspace_path : Path = Path .cwd ()) -> None :
@@ -341,7 +360,7 @@ def bundle_customization_pack(customization_pack: ResolvedCodeQLPack):
341360 f"Bundling the customization pack { customization_pack_copy .config .name } at { customization_pack_copy .path } "
342361 )
343362 self .codeql .pack_bundle (
344- customization_pack_copy , self .bundle_path / "qlpacks"
363+ customization_pack_copy , self .bundle_path / "qlpacks" , disable_precompilation = self . disable_precompilation
345364 )
346365
347366 def copy_pack (pack : ResolvedCodeQLPack ) -> ResolvedCodeQLPack :
@@ -470,13 +489,14 @@ def bundle_stdlib_pack(pack: ResolvedCodeQLPack):
470489 logging .debug (
471490 f"Bundling the standard library pack { pack_copy .config .name } at { pack_copy .path } "
472491 )
473- self .codeql .pack_bundle (pack_copy , self .bundle_path / "qlpacks" )
492+ self .codeql .pack_bundle (pack_copy , self .bundle_path / "qlpacks" , disable_precompilation = self . disable_precompilation )
474493
475494 def bundle_library_pack (library_pack : ResolvedCodeQLPack ):
476495 logging .info (f"Bundling the library pack { library_pack .config .name } ." )
477496 self .codeql .pack_bundle (
478497 library_pack ,
479498 self .bundle_path / "qlpacks" ,
499+ disable_precompilation = self .disable_precompilation
480500 )
481501
482502 def bundle_query_pack (pack : ResolvedCodeQLPack ):
@@ -520,8 +540,7 @@ def bundle_query_pack(pack: ResolvedCodeQLPack):
520540 self .codeql .pack_create (
521541 pack_copy ,
522542 self .bundle_path / "qlpacks" ,
523- self .bundle_path ,
524- )
543+ self .bundle_path )
525544 else :
526545 logging .info (f"Bundling the query pack { pack .config .name } ." )
527546 pack_copy = copy_pack (pack )
@@ -537,8 +556,7 @@ def bundle_query_pack(pack: ResolvedCodeQLPack):
537556
538557 self .codeql .pack_create (
539558 pack_copy ,
540- self .bundle_path / "qlpacks" ,
541- )
559+ self .bundle_path / "qlpacks" )
542560
543561 sorted_packs = list (pack_sorter .static_order ())
544562 logger .debug (f"Sorted packs: { ' -> ' .join (map (lambda p : p .config .name , sorted_packs ))} " )
0 commit comments