@@ -213,6 +213,36 @@ def download(
213213 downloaded .extractall (destdir )
214214
215215
216+ def show_build_info (destdir ):
217+ """Show build information that should be bundled with the archive."""
218+ file_path = destdir / "build-info.json"
219+ try :
220+ with open (file_path , "r" , encoding = "utf-8" ) as f :
221+ data = json .load (f )
222+ except FileNotFoundError :
223+ logger .debug ("Error: The file '%s' does not exist." , file_path )
224+ return
225+ except json .JSONDecodeError :
226+ logger .debug (
227+ "Error: The file '%s' is not a valid JSON file." , file_path
228+ )
229+ return
230+
231+ missing = "<missing>"
232+ timestamp = data .get ("TIMESTAMP" , missing )
233+ system = data .get ("SYSTEM" , missing )
234+ system_name = data .get ("SYSTEM_NAME" , missing )
235+ compiler_id = data .get ("CXX_COMPILER_ID" , missing )
236+ compiler_version = data .get ("CXX_COMPILER_VERSION" , missing )
237+ compiler_architecture = data .get ("CXX_COMPILER_ARCHITECTURE_ID" , missing )
238+
239+ logger .info ("Build information:" )
240+ logger .info (" - Build date: %s" , timestamp )
241+ logger .info (" - System: %s (%s)" , system_name , system )
242+ logger .info (" - Compiler: %s - version %s" , compiler_id , compiler_version )
243+ logger .info (" - Target architecture: %s" , compiler_architecture )
244+
245+
216246def install (
217247 filename ,
218248 destdir ,
@@ -365,6 +395,9 @@ def main(
365395 args .local ,
366396 )
367397
398+ # Retrieve deps build information
399+ show_build_info (tmpdir )
400+
368401 # Clean
369402 logger .info ("Cleaning local cache" )
370403 res = run_conan (
@@ -487,5 +520,7 @@ def deps(
487520 main ([f"--output={ BINARY_DIR } " ])
488521
489522
523+ # Historically, this module was independent; there are some remnants of this
524+ # previous situation (main entry point, with ability to parse command line)
490525if __name__ == "__main__" :
491526 main ()
0 commit comments