Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 895762 - net-p2p/retroshare-0.6.6-r1 - gui/.../Histogram.h: error: uint32_t was not declared in this scope
Summary: net-p2p/retroshare-0.6.6-r1 - gui/.../Histogram.h: error: uint32_t was not de...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gioacchino Mazzurco
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-13
  Show dependency tree
 
Reported: 2023-02-21 22:08 UTC by Toralf Förster
Modified: 2024-03-30 10:01 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,19.13 KB, text/plain)
2023-02-21 22:08 UTC, Toralf Förster
Details
emerge-history.txt.bz2 (emerge-history.txt.bz2,65.23 KB, application/x-bzip)
2023-02-21 22:08 UTC, Toralf Förster
Details
environment (environment,80.37 KB, text/plain)
2023-02-21 22:08 UTC, Toralf Förster
Details
etc.clang.tar.bz2 (etc.clang.tar.bz2,697 bytes, application/x-bzip)
2023-02-21 22:08 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,24.54 KB, application/x-bzip)
2023-02-21 22:08 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,6.93 KB, application/x-bzip)
2023-02-21 22:08 UTC, Toralf Förster
Details
net-p2p:retroshare-0.6.6-r1:20230221-052419.log.bz2 (net-p2p:retroshare-0.6.6-r1:20230221-052419.log.bz2,57.79 KB, application/x-bzip)
2023-02-21 22:08 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,78.23 KB, application/x-bzip)
2023-02-21 22:08 UTC, Toralf Förster
Details
gcc-13-build_fix.patch (gcc-13-build_fix.patch,282 bytes, patch)
2023-11-15 01:46 UTC, Alex D-Bug
Details | Diff
ebuild, eapi 7 (retroshare-0.6.7.ebuild,3.46 KB, application/vnd.gentoo.ebuild)
2024-03-24 20:35 UTC, jy6x2b32pie9
Details
net-p2p/retroshare/files: retroshare-0.6.6-fix-uint32_t-compilation.patch (retroshare-0.6.6-fix-uint32_t-compilation.patch,1.63 KB, patch)
2024-03-27 14:28 UTC, mehw
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2023-02-21 22:08:09 UTC
too long lines were shrinked:

x86_64-pc-linux-gnu-g++ -c -pipe -march=native -fno-diagnostics-color -O2 -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Wextra -fPIC -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON
x86_64-pc-linux-gnu-g++ -c -pipe -march=native -fno-diagnostics-color -O2 -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Wextra -fPIC -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON
x86_64-pc-linux-gnu-g++ -c -pipe -march=native -fno-diagnostics-color -O2 -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Wextra -fPIC -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON
x86_64-pc-linux-gnu-g++ -c -pipe -march=native -fno-diagnostics-color -O2 -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Wextra -fPIC -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON
x86_64-pc-linux-gnu-g++ -c -pipe -march=native -fno-diagnostics-color -O2 -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Wextra -fPIC -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON
In file included from gui/statistics/Histogram.cpp:23:
gui/statistics/Histogram.h:35:27: error: uint32_t was not declared in this scope
   35 |         const std::vector<uint32_t>& entries() const { return mBins; }
      |                           ^~~~~~~~

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop-j4-20230218-040024

  -------------------------------------------------------------------

GNUMAKEFLAGS="$GNUMAKEFLAGS --jobserver-style=pipe"
gcc-config -l:
 [1] x86_64-pc-linux-gnu-10
 [2] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/15
15.0.7
Python 3.10.10
Available Ruby profiles:
  [1]   ruby27 (with Rubygems)
  [2]   ruby30 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.67.1 *
The following VMs are available for generation-2:
1)	IcedTea JDK 3.21.0 [icedtea-8]
2)	Eclipse Temurin JDK 11.0.18_p10 [openjdk-bin-11]
*)	Eclipse Temurin JDK 17.0.6_p10 [openjdk-bin-17]
4)	Eclipse Temurin JDK 8.362_p09 [openjdk-bin-8]
5)	Eclipse Temurin JRE 17.0.6_p10 [openjdk-jre-bin-17]
Available Java Virtual Machines:
  [1]   icedtea-8 
  [2]   openjdk-bin-8 
  [3]   openjdk-bin-11 
  [4]   openjdk-bin-17  system-vm
  [5]   openjdk-jre-bin-17 

The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):

  HEAD of ::gentoo
commit ef501cacacb71a632dd521f79d73d7ee8ece1367
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Tue Feb 21 02:16:50 2023 +0000

    2023-02-21 02:16:50 UTC

emerge -qpvO net-p2p/retroshare
[ebuild  N    ] net-p2p/retroshare-0.6.6-r1  USE="cli gui jsonapi miniupnp service sqlcipher -autologin -libupnp"
Comment 1 Toralf Förster gentoo-dev 2023-02-21 22:08:10 UTC
Created attachment 853570 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2023-02-21 22:08:11 UTC
Created attachment 853572 [details]
emerge-history.txt.bz2
Comment 3 Toralf Förster gentoo-dev 2023-02-21 22:08:12 UTC
Created attachment 853574 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2023-02-21 22:08:13 UTC
Created attachment 853576 [details]
etc.clang.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2023-02-21 22:08:14 UTC
Created attachment 853578 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2023-02-21 22:08:15 UTC
Created attachment 853580 [details]
logs.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2023-02-21 22:08:16 UTC
Created attachment 853582 [details]
net-p2p:retroshare-0.6.6-r1:20230221-052419.log.bz2
Comment 8 Toralf Förster gentoo-dev 2023-02-21 22:08:18 UTC
Created attachment 853584 [details]
temp.tar.bz2
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-13 02:27:59 UTC
ping - this should be a trivial fix, just a missing include
Comment 10 Leonid Kopylov 2023-10-10 19:52:16 UTC
also fails to build with gcc 12
Comment 11 Alex D-Bug 2023-11-15 01:46:31 UTC
Created attachment 874822 [details, diff]
gcc-13-build_fix.patch

Seems it works. Builds, at least
Comment 12 Leonid Kopylov 2023-11-15 05:11:14 UTC
(In reply to Alex D-Bug from comment #11)
> Created attachment 874822 [details, diff] [details, diff]
> gcc-13-build_fix.patch
> 
> Seems it works. Builds, at least

can confirm the same, it builds with GCC 13
Comment 13 jy6x2b32pie9 2024-03-24 20:35:00 UTC
Fixed upstream.

Retroshare should be bumped to 0.6.7 for bugfix. Also, cxx-17 patch is also not need with 0.6.7.
Comment 14 jy6x2b32pie9 2024-03-24 20:35:50 UTC
Created attachment 888476 [details]
ebuild, eapi 7
Comment 15 mehw 2024-03-27 14:00:17 UTC
(In reply to jy6x2b32pie9 from comment #14)
> Created attachment 888476 [details]
> ebuild, eapi 7

Hello,

bug#927207 is about net-p2p/retroshare version bump, there's also a new 'plugins' use flag: https://bugs.gentoo.org/attachment.cgi?id=887848
Comment 16 mehw 2024-03-27 14:28:01 UTC
Created attachment 888770 [details, diff]
net-p2p/retroshare/files: retroshare-0.6.6-fix-uint32_t-compilation.patch

(In reply to Alex D-Bug from comment #11)
> Created attachment 874822 [details, diff] [details, diff]
> gcc-13-build_fix.patch
> 
> Seems it works. Builds, at least

Hello Alex D-Bug,

Since you provided a solution, could you please open a https://github.com/gentoo/gentoo PR?

Thanks ;)

I'm including an attachment that adopts your solution combining some upstream patches:
- https://github.com/RetroShare/RetroShare/commit/e1934fd9b03cd52c556eb06d94fb5d68b649592e
- https://github.com/RetroShare/RetroShare/commit/15128192003722a3686c1b6f27132ba064cd1705


$ diff retroshare-0.6.6-r1.ebuild retroshare-0.6.6-r2.ebuild 
15c15
< KEYWORDS="amd64 x86"
---
> KEYWORDS="~amd64 ~x86"
56c56,59
< PATCHES=( "${FILESDIR}/${P}-fix-cxx17-compilation.patch" )
---
> PATCHES=(
>       "${FILESDIR}/${P}-fix-cxx17-compilation.patch"
>       "${FILESDIR}/${P}-fix-uint32_t-compilation.patch"
> )


Also, the compiler suggests a solution to the uint32_t compilation error too:

In file included from gui/statistics/Histogram.cpp:23:
gui/statistics/Histogram.h:35:27: error: ‘uint32_t’ was not declared in this scope
   35 |         const std::vector<uint32_t>& entries() const { return mBins; }
      |                           ^~~~~~~~                                                                                                                                                                                                  
gui/statistics/Histogram.h:23:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   22 | #include <iostream>
  +++ |+#include <cstdint>
Comment 17 Thomas 2024-03-30 10:01:02 UTC
Had a look at he gcc-13-build_fix.patch and the net-p2p/retroshare/files: retroshare-0.6.6-fix-uint32_t-compilation.patch. Also tested both and can confirm both fix the issue.

When comparing them I first thought the compiler as well as the retroshare-0.6.6-fix-uint32_t-compilation.patch mustg be right. When looking at the other patch through I noted that the retroshare-0.6.6-fix-uint32_t-compilation.patch casts the value to uint32_t just to store it as long int (causing another cast) while the gcc-13-build_fix.patch casts directly to long int.

My guess now is that this is a upstream issue: Either they want to cast to a architecture dependend fixed word size (uint32_t is guaranteed to have a wordsize of 32 bit) or they want a wordsize depending on the target architecture (long int). Maybe they ported away from fixed word size and this cast to uint32_t was just an oversight or maybe they really need a fixed word size here no matter what architecture and the second cast to long int is a mistake (the LoC shold look like this:
uint32_t bin = (uint32_t)floor((val - mStart)/(mEnd - mStart) * mBins.size());
) but nobody noticed as they didn't compile for any architectures with a wordsize of long int smaller than 32 bit (are there even any such architectures?).

rl;dr: Just my two cents but while both patches work on at least amd64 and probably a lot of other archs, too, I'm unsure which of the patches does the right thing in the eyes of the retroshare devs, hence I think it would be a good idea if one of the patch authors could take the patches upstream and simply ask them.