Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error using Dockerfile #12

Closed
paha77 opened this issue Sep 14, 2024 · 4 comments
Closed

Compile error using Dockerfile #12

paha77 opened this issue Sep 14, 2024 · 4 comments

Comments

@paha77
Copy link

paha77 commented Sep 14, 2024

I got compile errors when I try to build a container with this Dockerfile:

FROM rust AS builder
WORKDIR /usr/src/myapp
RUN cargo install --git https://github.com/ClementNerma/tapo-rest --root /usr/src/myapp
105.9    Compiling tapo-rest v0.1.1 (/usr/local/cargo/git/checkouts/tapo-rest-5bbf6afef063f897/b569529)
106.4 error[E0308]: `?` operator has incompatible types
106.4    --> src/server/actions.rs:316:21
106.4     |
106.4 99  |                 ) -> ApiResult<$ret_type> {
106.4     |                      -------------------- expected `tapo::responses::DeviceInfoPlugResult` because of return type
106.4 ...
106.4 316 |             Ok(Json(client.get_device_info().await?))
106.4     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `DeviceInfoPlugResult`, found `DeviceInfoPlugEnergyMonitoringResult`
106.4     |
106.4     = note: `?` operator cannot convert from `DeviceInfoPlugEnergyMonitoringResult` to `tapo::responses::DeviceInfoPlugResult`
106.4
107.0 For more information about this error, try `rustc --explain E0308`.
107.1 error: could not compile `tapo-rest` (bin "tapo-rest") due to 1 previous error
107.1 error: failed to compile `tapo-rest v0.1.1 (https://github.com/ClementNerma/tapo-rest#b5695298)`, intermediate artifacts can be found at `/tmp/cargo-install90KpGV`.
107.1 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
------
failed to solve: process "/bin/sh -c cargo install --git https://github.com/ClementNerma/tapo-rest --root /usr/src/myapp" did not complete successfully: exit code: 101

It used to work a few months ago.

Do you have any suggestions?

Thank you.

@ClementNerma
Copy link
Owner

Hi,

I just updated the dependencies on the main branch, but the problem may arise in the future in you don't use the --locked option of cargo install.

When installing from a Git repository, you should always provide it, otherwise cargo unfortunately ignores the project's lockfile (see rust-lang/cargo#7169).

@paha77
Copy link
Author

paha77 commented Sep 16, 2024

Hi,

I just updated the dependencies on the main branch, but the problem may arise in the future in you don't use the --locked option of cargo install.

When installing from a Git repository, you should always provide it, otherwise cargo unfortunately ignores the project's lockfile (see rust-lang/cargo#7169).

Thank you, it helped.

@ClementNerma
Copy link
Owner

Just FYI, @paha77 there is now an officiel Docker image available (take a look at the README) :)

@paha77
Copy link
Author

paha77 commented Dec 1, 2024

Just FYI, @paha77 there is now an officiel Docker image available (take a look at the README) :)

Thanks for letting me now, I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants