Use the compiler itself rather than dpkg to detect DEB_BUILD_RUST_TYPE
authorPeter Michael Green <plugwash@raspbian.org>
Thu, 22 Oct 2020 19:43:09 +0000 (19:43 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 22 Oct 2020 19:43:09 +0000 (19:43 +0000)
debian/architecture.mk

index 922435459423bf3cc9d8a8542cb98ba8578716f9..fb41c65698078f7037cef6fc82f359297ea5eb8d 100644 (file)
@@ -14,4 +14,4 @@ ifeq ($(DEB_TARGET_RUST_TYPE),-unknown-)
   DEB_TARGET_RUST_TYPE = $(DEB_HOST_RUST_TYPE)
 endif
 
-DEB_BUILD_RUST_TYPE = $(shell dpkg -L rustc | grep '/usr/lib/rustlib/' | head -n 1 | cut -d '/' -f 5)
+DEB_BUILD_RUST_TYPE = $(shell RUSTC_BOOTSTRAP=1 rustc -Z unstable-options --print target-spec-json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["llvm-target"])')