def main(): if len(sys.argv) < 3: print("Usage: %s kudu_build_dir target [target ...]" % (sys.argv[0], )) sys.exit(1) # Command-line arguments. build_root = sys.argv[1] targets = sys.argv[2:] init_logging() if not os.path.exists(build_root): logging.error("Build directory %s does not exist", build_root) sys.exit(1) artifact_name = get_artifact_name() artifact_root = os.path.join(build_root, artifact_name) # Clear the artifact root to ensure a clean build. if os.path.exists(artifact_root): shutil.rmtree(artifact_root) logging.info("Including targets and their dependencies in archive...") config = mkconfig(build_root, artifact_root) for target in targets: relocate_target(target, config)
def main(): if len(sys.argv) < 3: print("Usage: %s kudu_build_dir target [target ...]" % (sys.argv[0], )) sys.exit(1) # Command-line arguments. build_root = sys.argv[1] targets = sys.argv[2:] init_logging() if not os.path.exists(build_root): logging.error("Build directory %s does not exist", build_root) sys.exit(1) artifact_name = get_artifact_name() artifact_root = os.path.join(build_root, artifact_name) config = mkconfig(build_root, artifact_root) # Clear the artifact root to ensure a clean build. if os.path.exists(artifact_root): shutil.rmtree(artifact_root) # Create artifact directories, if needed. prep_artifact_dirs(config) relocated_sasl = False for target in targets: logging.info( "Including target '%s' and its dependencies in archive...", target) # Copy the target into the artifact directory. target_src = os.path.join(config[BUILD_BIN_DIR], target) target_dst = os.path.join(config[ARTIFACT_BIN_DIR], target) copy_file(target_src, target_dst) if IS_LINUX and not relocated_sasl: # We only relocate sasl2 on Linux because macOS appears to ship sasl2 with # the default distribution and we've observed ABI compatibility issues # involving calls from libsasl2 into libSystem when shipping libsasl2 with # the binary artifact. logging.info("Attempting to relocate sasl2 modules...") relocated_sasl = relocate_sasl2(target_src, config) # Make the target relocatable and copy all of its dependencies into the # artifact directory. relocate_deps(target_src, target_dst, config)
["./build-support/release/check-rat-report.py", "./build-support/release/rat_exclude_files.txt", rat_report_dest], stderr=subprocess.STDOUT) print(Colors.GREEN + "RAT: LICENSES APPROVED" + Colors.RESET) except subprocess.CalledProcessError as e: print(Colors.RED + "RAT: LICENSES NOT APPROVED" + Colors.RESET) print(e.output) raise e finally: shutil.rmtree(tmpdir_path) def main(): # Change into the source repo so that we can run git commands without having to # specify cwd=BUILD_SUPPORT every time. os.chdir(ROOT) check_repo_not_dirty() check_no_local_commits() tarball_path = create_tarball() gen_sha_file(tarball_path) sign_tarball(tarball_path) run_rat(tarball_path) print(Colors.GREEN + "Release successfully generated!" + Colors.RESET) print if __name__ == "__main__": init_logging() main()