mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #1946] trust-dns-proto version 0.22.0 compilation error on Rust stable 1.69.0 & nightly #828
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#828
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @freshtonic on GitHub (May 28, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1946
Describe the bug
Creating a new rust crate with
trust-dns-protoversion0.22.0as its sole dependency fails to compile.To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
I expect the compilation to succeed.
System:
Version:
Crate: trust-dns-proto
Version: 0.22.0
Additional context
Version 0.21.0 does not exhibit this issue, i.e. it compiles successfully
@trevyn commented on GitHub (May 28, 2023):
xref https://github.com/bluejekyll/enum-as-inner/issues/98
@0cv commented on GitHub (May 28, 2023):
Adding
enum-as-inner = "=0.5.1"to the Cargo.toml file "fixes" (temporarily) the issue@dipk-mish7 commented on GitHub (May 30, 2023):
Hi Team, I got this error out of nowhere today when I tried to build locally. I fixed the issue by removing is_soa function from $HOME/.cargo/bin/cargo/registry/src/artifactory.my.company.com-c8223d652781490d/trust-dns-proto-0.22.0/src/rr/record_data.rs:55:17. However I am still getting same issue if I build dockerfile locally which I get in CI. Only the location of the file changes where I removed is_soa function.
My problem is I am getting same error in gitlab-ci, how do I fix that as it comes while building dockerfile and the location of the file changes if I build dockerfile in CI to /usr/local/cargo/registry/src/artifactory.my.company.com-c8223d652781490d/trust-dns-proto-0.22.0/src/rr/record_data.rs:55:17. Please find exact error below.
error[E0592]: duplicate definitions with name
is_soa--> /usr/local/cargo/registry/src/artifactory.my.company.com-c8223d652781490d/trust-dns-proto-0.22.0/src/rr/record_data.rs:55:17
|
55 | #[derive(Debug, EnumAsInner, PartialEq, Clone, Eq)]
| ^^^^^^^^^^^ duplicate definitions for
is_soa...
994 | pub fn is_soa(&self) -> bool {
| ---------------------------- other definition for
is_soa|
= note: this error originates in the derive macro
EnumAsInner(in Nightly builds, run with -Z macro-backtrace for more info)For more information about this error, try
rustc --explain E0592.error: could not compile
trust-dns-protodue to previous error@NobodyXu commented on GitHub (May 30, 2023):
@dipk-mish7 Try passing
--lockedtocargoand use enum-as-inner v0.5.1 in theCargo.locklockfile.@dipk-mish7 commented on GitHub (May 31, 2023):
@NobodyXu where should I pass this? Is it cargo build -Z sparse-registry --locked ?
I have a docker file which I want to build Dockerfile
The base image I am using is rust:1.69.0.
Just an FYI now if I run cargo build -Z sparse-registry locally it gives me above issue but if I build Dockerfile it works just fine for me. Any guess? I have not changed anything.
@djc commented on GitHub (May 31, 2023):
You need to make sure you don't have enum-as-inner 0.5.2 in your
Cargo.lockfile. If you do that, everything should be fine.@dipk-mish7 commented on GitHub (May 31, 2023):
@djc As
Cargo.lockgets generated on the fly and Its not recommended to manually change this.. I can see my enum-as-inner is set as :-[[package]] name = "enum-as-inner" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", ]How do I ensure the version gets updated to 0.5.2 by commands at the time of build.
@djc commented on GitHub (May 31, 2023):
You don't want to upgrade to 0.5.2, it was broken and is currently yanked. Stick to 0.5.1 for now.
@NobodyXu commented on GitHub (May 31, 2023):
@dipk-mish7 The repository you linked contains
Cargo.lockin git, so it's not generated on the fly but rather checked out in git.You get it backwards: enum-as-inner 0.5.2 is buggy so you'd like it to be v0.5.1 instead
With enum-as-inner v0.5.2 yanked, this is no longer a problem, but I think it's better if you pass
--lockedwhen building your application @dipk-mish7@dipk-mish7 commented on GitHub (May 31, 2023):
For some reasons I am able to build the Dockerfile with no issues. But If I run


cargo build -Z sparse-registry --lockedIt tries to find is_soa function .. I deleted it as suggested in the another github thread. Now I am not sure where to find this.
@NobodyXu It generates on the fly when I do cargo build.. If I delete target folder and cargo.lock it and do cargo build .. it will generate it. My docker environment for some reasons is working .. maybe because is_soa function is there and that's why it is working.. I was getting the issue yesterday even while building dockerfile.
@NobodyXu commented on GitHub (May 31, 2023):
That's because your repository contains the
Cargo.lockAre you using nightly?
Sparse registries is supported on stable by setting environment variable
CARGO_REGISTRIES_CRATES_IO_PROTOCOLtosparse.@djc commented on GitHub (May 31, 2023):
@dipk-mish7 it appears you don't yet have much experience with the basic functions of Cargo. Please consider seeking help in a more appropriate forum (like https://users.rust-lang.org/).