Skip to content

Fix Rust SDK errors - #5380

Merged
kjuulh merged 5 commits into
dagger:mainfrom
gerhard:fix-sdk-rust-errors
Jul 1, 2023
Merged

kjuulh merged 5 commits into
dagger:mainfrom
gerhard:fix-sdk-rust-errors

Conversation

@gerhard

@gerhard gerhard commented Jun 30, 2023 •

Copy link
Copy Markdown
Contributor

They started happening right after
#5372 got merged, even though this commit didn't change anything in the Rust SDK: https://github.com/dagger/dagger/actions/runs/5424732578/jobs/9864713099

The relevant errors:

error[E0422]: cannot find struct, variant or union type `LineColumn` in crate `proc_macro`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.56/src/wrapper.rs:475:33
    |
475 |                 let proc_macro::LineColumn { line, column } = s.start();
    |                                 ^^^^^^^^^^ not found in `proc_macro`
    |
help: consider importing this struct through its public re-export
    |
1   + use crate::LineColumn;
    |
help: if you import `LineColumn`, refer to it directly
    |
475 -                 let proc_macro::LineColumn { line, column } = s.start();
475 +                 let LineColumn { line, column } = s.start();
    |

error[E0422]: cannot find struct, variant or union type `LineColumn` in crate `proc_macro`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.56/src/wrapper.rs:489:33
    |
489 |                 let proc_macro::LineColumn { line, column } = s.end();
    |                                 ^^^^^^^^^^ not found in `proc_macro`
    |
help: consider importing this struct through its public re-export
    |
1   + use crate::LineColumn;
    |
help: if you import `LineColumn`, refer to it directly
    |
489 -                 let proc_macro::LineColumn { line, column } = s.end();
489 +                 let LineColumn { line, column } = s.end();
    |

   Compiling pin-utils v0.1.0
   Compiling thiserror v1.0.40
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.56/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

Updating all dependencies to latest via cargo update & re-running the Rust SDK codegen (which seems to create incorrect comments) fixed the issue for both lint & test.

WDYT @kjuulh?

They started happening right after
#5372 got merged, even though this
commit didn't change anything in the Rust SDK.

Updating all dependencies to latest via `cargo update` & re-running
the Rust SDK codegen (which seems to create incorrect comments) fixed
the issue for both lint & test.

Signed-off-by: Gerhard Lazu <[email protected]>
@gerhard
gerhard requested a review from a team as a code owner June 30, 2023 18:31
@kjuulh

kjuulh commented Jun 30, 2023

Copy link
Copy Markdown
Contributor

@gerhard. The comments are like that, because we use a stable version of rust for generating the output. For some reason genco (code generation library): requires nightly for proper whitespace handling: https://github.com/udoprog/genco/tree/main. I give a hand and change the tooling to use the proper toolchain of it.

FYI: it is quite normal for such libraries to use nightly for output, as nightly in general is considered quite solid, unlike its name suggests.

@kjuulh

kjuulh commented Jun 30, 2023 •

Copy link
Copy Markdown
Contributor

Correction, it seems like another transitive dependencies broke linebreak thingy in genco. If the nightly fix won't do it, I will set a lower compatible version of the peer dependency: udoprog/genco#39. Note: the reason normal lines aren't broken is because we run it through rustfmt, which fixes standard code to be rust standard formatted. A // // something won't be formatted because that is a valid comment and won't be split.

@kjuulh

kjuulh commented Jun 30, 2023 •

Copy link
Copy Markdown
Contributor

I did a temporary fix until upstream: is fixed. I will pin the image version for now as well, so that we don't get any surprises =D

@kjuulh

kjuulh commented Jun 30, 2023

Copy link
Copy Markdown
Contributor

I am currently having a problem with the engine being cancelled early because of:

2023/06/30 20:50:46 traces export: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp: address /dev/otel-grpc.sock: missing port in address"                                                                                                                                                                                                                

I haven't tested it on my linux box yet. But CI seems to pass just fine.

@kjuulh

kjuulh commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

@gerhard it should be ready for review now. As we've both worked on it we may need a third party of eyes xD

@gerhard

gerhard commented Jul 1, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for helping with this @kjuulh 💪

Re 2023/06/30 20:50:46 traces export: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp: address /dev/otel-grpc.sock: missing port in address", I seem to remember @vito mentioning that this is error is harmless & OK to ignore. I agree that we should fix it at some point, similar to #5306

I ran this locally & everything passed. I am ack-ing your changes. If you approve & merge this PR @kjuulh, we will unblock a bunch of upcoming PRs which I know that will start piling up as of Monday. We already have one waiting for this to be merged: #5381 (thanks for the ping @helderco).

If you are apprehensive, I trust our test suites & am OK to be there if any problems were to arise. I know that it will be OK 👍

image

@kjuulh

kjuulh commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

I am totally good. I just didn't want to approve my own changes. But if you've had a look and agree. Then I will do so

@kjuulh
kjuulh merged commit 2967c51 into dagger:main Jul 1, 2023
@gerhard
gerhard deleted the fix-sdk-rust-errors branch July 2, 2023 14:25
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

Successfully merging this pull request may close these issues.

2 participants