When we call bootstrap.bootstrap(args), the check_vendored_status()
upstream function will happily delete .cargo/. This is a problem
because the quilt source package wants .cargo/config.toml to not be
modified without a patch. Without this, after running
'debian/rules source_orig-stage0', further builds will fail with:
dpkg-source: warning: ignoring deletion of directory .cargo
dpkg-source: info: local changes detected, the modified files are:
rustc-1.70.0+dfsg1/.cargo/config.toml
dpkg-source: info: Hint: make sure the version in debian/changelog matches the unpacked source tree
dpkg-source: info: you can integrate the local changes with dpkg-source --commit
dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/rustc_1.70.0+dfsg1-6.diff.nkvdQ1
Rather than patching the upstream bootstrap.py, we just move .cargo out
of the way temporarily and move it back after the bootstrap() function
finishes.
architectures (closes: #1021711).
* Run 'd/rules clean' after running make_orig-stage0_tarball.sh so that the
suggestion to rebuild the .dsc actually works.
+ * Don't allow upstream's bootstrap.py to delete .cargo/ directory.
-- Fabian Grünbichler <debian@fabian.gruenbichler.email> Mon, 15 Jan 2024 08:16:35 +0100
# In that case, you probably just need to override the failing step in our
# DownloadOnlyRustBuild class below.
+import shutil
import sys
import bootstrap
DownloadOnlyRustBuild.triple = triple
bootstrap.RustBuild = DownloadOnlyRustBuild
args = bootstrap.parse_args()
- bootstrap.bootstrap(args)
+ # bootstrap.py likes to delete our .cargo directory out from under us
+ shutil.move(".cargo", ".cargo-bak")
+ try:
+ bootstrap.bootstrap(args)
+ finally:
+ shutil.move(".cargo-bak", ".cargo")
if __name__ == '__main__':
main(sys.argv)