Stat_t on MIPS uses 32-bit fields for Dev and Rdev, so we need to cast these to uint64.#37490
Stat_t on MIPS uses 32-bit fields for Dev and Rdev, so we need to cast these to uint64.#37490poizan42 wants to merge 1 commit intomoby:masterfrom
Conversation
|
Why does the build fail? Is it due to the warnings? |
… to cast these to uint64. Signed-off-by: Kasper Fabæch Brandt <poizan@poizan.dk>
79ded5c to
86c2a06
Compare
|
ping @kolyshkin @dnephin PTAL |
@poizan42 yes, you have to correct your code based on warnings. |
|
@olljanat Yeah, so that is a problem. The fields are 32-bits on MIPS so it won't compile without the casts. But with the casts it causes redundant cast warnings on all other platforms. So any suggestions? Can we disable the warnings, or should I make wrappers in platform specific files? |
|
Disabling warnings is not option for sure but I'm not also sure what is. |
|
This is not the first time we have encountered this problem. I remember dealing with it in another package. If you I think the correct solution is to add nolint , and a comment about why. // The type is 32bit on mips.
// nolint: unconvert |
|
@poizan42 wondering if you're still working on this? I also recalled we had something similar recently; #39212 (wondering if we need to use the same approach here) @kolyshkin ptal ^^ |
|
Any progress on this? It's failing on OpenWrt with libnetwork: https://downloads.openwrt.org/snapshots/faillogs/mips64_octeonplus/packages/libnetwork/compile.txt |
|
Recently I build docker on mips64le and got the same errors, and the solution was the same, so I wonder if this PR still on progress ? If not, could I submit another PR to fix those errors? @poizan42 |
|
I have no problem with it. |
|
So seems this was fixed in #39646 which is merged, so I'm closing this. |
Stat_t on MIPS uses 32-bit fields for Dev and Rdev, so we need to cast these to uint64 Inpiration from moby/moby#37490 Example build failure log: https://buildd.debian.org/status/fetch.php?pkg=golang-github-containers-storage&arch=mips64el&ver=1.15.8%2Bdfsg1-1&stamp=1580872314&raw=0
Stat_t on MIPS uses 32-bit fields for Dev and Rdev, so we need to cast these to uint64 Inpiration from moby/moby#37490 Example build failure log: https://buildd.debian.org/status/fetch.php?pkg=golang-github-containers-storage&arch=mips64el&ver=1.15.8%2Bdfsg1-1&stamp=1580872314&raw=0 Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Stat_t on MIPS uses 32-bit fields for Dev and Rdev, so we need to cast these to uint64 Turns out the change in 0717190 is incomplete and an additional line needs a cast. Inpiration from moby/moby#37490 Example build failure log: https://buildd.debian.org/status/fetch.php?pkg=golang-github-containers-storage&arch=mips64el&ver=1.20.2-1&stamp=1594477648&raw=0Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Signed-off-by: Kasper Fabæch Brandt poizan@poizan.dk
- What I did
Fixed build errors about like "cannot use s.Rdev (type uint32) as type uint64" when targeting mips due to the Dev and Rdev in Stat_t being 32-bit on 32-bit mips.
- How I did it
Inserted casts to uint64 where needed.
(fixes #28058 it would seem)
- How to verify it
Try building docker targeting mips (still won't build successfully)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)