Azure / iot-identity-service

Source of the Azure IoT Identity Service and related services.
MIT License
37 stars 45 forks source link

Error building from source on Debian 11 #573

Closed gri6507 closed 6 months ago

gri6507 commented 6 months ago

I am trying to build iot-identity-service from source on my own machine. Right now, I am trying to build for Debian 11, but that will expand to other versions that Microsoft currently doesn't explicitly support. My first attempt at building was using a clean docker container with:

# from https://github.com/Azure/iot-identity-service/blob/main/docs-dev/packages.md
git clone --recursive --depth 1 --branch 1.4.7 https://github.com/Azure/iot-identity-service
docker run -it --rm -v "$(realpath ./iot-identity-service):/src" -e 'ARCH=amd64' -e 'PACKAGE_VERSION=1.4.7' -e 'PACKAGE_RELEASE=1' debian:11-slim '/src/ci/package.sh'

However, that failed with

error: failed to compile `bindgen v0.60.0`, intermediate artifacts can be found at `/tmp/cargo-installhHd1ys`

Caused by:
  package `home v0.5.9` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.65.0

Next, I tried to manually follow the process from https://github.com/Azure/iot-identity-service/blob/main/ci/install-build-deps.sh with

docker run -it --rm debian:11-slim

apt-get update
apt-get install -y git curl

git clone --recursive --depth 1 --branch 1.4.7 https://github.com/Azure/iot-identity-service
cd iot-identity-service
ARCH=amd64 bash -xc '. ci/install-build-deps.sh'

which resulted in the same error. Where am I going wrong?

arsing commented 6 months ago

Yes, I see the same thing. The home dependency of bindgen did a new release four days go that bumped its minimum required Rust version beyond what we compile with. https://github.com/rust-lang/cargo/commit/7ce9c26f399ceec6e4750291f39ce381f71eab1f The version number is semver-compatible (v0.5.5 -> v0.5.9) so cargo picks it up when compiling bindgen.


The fix would be to compile bindgen with exactly the same versions of its dependencies that it had at the time it was released.

https://github.com/Azure/iot-identity-service/blob/1.4.7/ci/install-build-deps.sh#L317-L322

The first two should be changed to specify --locked like the third one does. I confirmed that fixes it for me.

gri6507 commented 6 months ago

Thank you for the quick response!