Closed stefangalowicz closed 1 year ago
I got the same problem. It seems that the error comes from the cmake
crate, which paho-mqtt-sys
relies on. It should be fixed in newer version of the cmake
crate I think. Currently, my workaround is just clone this into local, change the version of cmake
crate in the Cargo.toml
of paho-mqtt-sys
to 0.1.48, something like this:
cmake = { version = "0.1.48", optional = true }
Then just point to the local directory in the main application Cargo.toml
. However, I only tested this workaround on Windows. Not sure about others.
That's unfortunate. The last few versions of the cmake
crate require a fairly recent version of cmake, which is newer than the version in a lot of Linux distributions. So, just upgrading the cmake dependency in paho-mqtt-sys
would break the build for a lot of Linux systems at this point.
I think this issue only occurs if VS22 is installed. I might be wrong as I haven't tested it yet, but seems that the current 1.0.45 version of the cmake
crate doesn't recognize VS22.
I don't know whether there is a way to force using the newer version of the cmake
crate when having VS22 in Cargo.toml
. When I tried to use the patch feature or specify the version of the crate, it didn't work unfortunately.
That would definitely make sense. But would it be fixed by installing a new version of CMake that came out after VS22, and supports it?
I believe the cmake crate just runs whatever version of the CMake binary that’s installed on the system.
I just tried that and unfortunately, it still didn't work. The cmake
crate panic in the visual_studio_generator()
when it encountered VS22. The current installed CMake is 3.23, so it should support VS22.
Oh, yeah. I guess on Windows the cmake crate needs to tell CMake which generator to use. That stinks. We'll have to look into whether the --parallel
issue can be fixed upstream in the cmake crate. Either that or just break the build for older CMake's on the next release of this library.
I got the same problem. It seems that the error comes from the
cmake
crate, whichpaho-mqtt-sys
relies on. It should be fixed in newer version of thecmake
crate I think. Currently, my workaround is just clone this into local, change the version ofcmake
crate in theCargo.toml
ofpaho-mqtt-sys
to 0.1.48, something like this:cmake = { version = "0.1.48", optional = true }
Then just point to the local directory in the main application
Cargo.toml
. However, I only tested this workaround on Windows. Not sure about others.
This works for me too.
This fix should ship with v0.12
Actually the backward-compatible fix was released in cmake v0.1.49. I updated the -sys crate to v0.7.2 with this fix. It is compatible with the main crate v0.11. So the fix should be available now on crates.io. Just do a cargo update
.
The image
windows-latest
used to point towindows-2019
, now it'swindows-2022
. This breaks the build ofpaho-mqtt-sys
. Changing back towindows-2019
explicitly fixes the issue.The change was announced here: https://github.com/actions/virtual-environments/issues/4856
The error message: