# HG changeset patch # User Cédric Krier # Date 1674932937 -3600 # Node ID ff4df09547429d32a8e75476fc752b834b1b824e # Parent 2282d8ac0fa9c8ea4b1aaf847f22c534129f22e4 setup: Ensure target directory exists with building rust extension When the rust extension is the first to be build, the target directory may not exist so the copy fails. diff -r 2282d8ac0fa9 -r ff4df0954742 setup.py --- a/setup.py Thu Jan 26 00:23:07 2023 +0100 +++ b/setup.py Sat Jan 28 20:08:57 2023 +0100 @@ -1454,11 +1454,13 @@ target = [target_dir] target.extend(self.name.split('.')) target[-1] += DYLIB_SUFFIX + target = os.path.join(*target) + os.makedirs(os.path.dirname(target), exist_ok=True) shutil.copy2( os.path.join( self.rusttargetdir, self.dylibname + self.rustdylibsuffix() ), - os.path.join(*target), + target, )