juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
https://juce.com
Other
6.3k stars 1.67k forks source link

[Bug]: FTBFS on x86_32 #1394

Closed umlaeute closed 1 week ago

umlaeute commented 2 weeks ago

Detailed steps on how to reproduce the bug

build JUCE on an x86_32 system (e.g. "Debian/i386").

docker run --rm -ti i386/debian:unstable

within the x86_32 environment try to build JUCE:

apt update
apt full-upgrade
apt install -y build-essential git
apt install -y cmake libasound2-dev libcurl4-gnutls-dev libfontconfig-dev libfreetype-dev libjpeg-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev pkgconf python3 zlib1g-dev
git clone https://github.com/juce-framework/JUCE
mkdir JUCE/_build
cd JUCE/_build
cmake ..

building juceaide fails with:

-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Checking for module 'alsa'
--   Found alsa, version 1.2.11
-- Checking for modules 'freetype2;fontconfig'
--   Found freetype2, version 26.1.20
--   Found fontconfig, version 2.15.0
-- Checking for module 'gl'
--   Package 'gl', required by 'virtual:world', not found
-- Checking for module 'libcurl'
--   Found libcurl, version 8.8.0
-- Checking for modules 'webkit2gtk-4.0;gtk+-x11-3.0'
--   Package 'webkit2gtk-4.0', required by 'virtual:world', not found
--   Package 'gtk+-x11-3.0', required by 'virtual:world', not found
-- Configuring juceaide
-- Building juceaide
CMake Error at extras/Build/juceaide/CMakeLists.txt:143 (message):
  Failed to build juceaide

  [ 10%] Building CXX object
  extras/Build/juceaide/CMakeFiles/juceaide.dir/Main.cpp.o

  [ 20%] Building CXX object
  extras/Build/juceaide/CMakeFiles/juceaide.dir/__/juce_build_tools/juce_build_tools.cpp.o

  [ 30%] Building CXX object
  extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_gui_basics/juce_gui_basics.cpp.o

  [ 40%] Building CXX object
  extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_graphics/juce_graphics.cpp.o

  In file included from
  /root/src/JUCE/modules/juce_core/system/juce_StandardHeader.h:94,

                   from /root/src/JUCE/modules/juce_core/juce_core.h:216,
                   from /root/src/JUCE/modules/juce_graphics/juce_graphics.h:67,
                   from /root/src/JUCE/modules/juce_graphics/juce_graphics.cpp:50:

  /root/src/JUCE/modules/juce_core/memory/juce_HeavyweightLeakedObjectDetector.h:
  In instantiation of
  'juce::HeavyweightLeakedObjectDetector<OwnerClass>::BacktraceMapHolder::~BacktraceMapHolder()
  [with OwnerClass = juce::FTFaceWrapper]':

  /root/src/JUCE/modules/juce_core/memory/juce_HeavyweightLeakedObjectDetector.h:112:35:
  required from 'static
  juce::HeavyweightLeakedObjectDetector<OwnerClass>::BacktraceMap&
  juce::HeavyweightLeakedObjectDetector<OwnerClass>::getBacktraceMap() [with
  OwnerClass = juce::FTFaceWrapper; BacktraceMap =
  std::map<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*,
  juce::String,
  std::less<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*>,
  std::allocator<std::pair<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*
  const, juce::String> > >]'

  /root/src/JUCE/modules/juce_core/memory/juce_HeavyweightLeakedObjectDetector.h:59:107:
  required from
  'juce::HeavyweightLeakedObjectDetector<OwnerClass>::HeavyweightLeakedObjectDetector()
  [with OwnerClass = juce::FTFaceWrapper]'

  /root/src/JUCE/modules/juce_graphics/native/juce_Fonts_freetype.cpp:116:72:
  required from here

  /root/src/JUCE/modules/juce_core/memory/juce_HeavyweightLeakedObjectDetector.h:77:54:
  error: ambiguous overload for 'operator<<' (operand types are
  'juce::String' and
  'std::map<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*,
  juce::String,
  std::less<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*>,
  std::allocator<std::pair<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*
  const, juce::String> > >::size_type' {aka 'unsigned int'})

     77 |                 DBG ("*** Leaked objects detected: " << map.size() << " instance(s) of class " << getLeakedObjectClassName());

  /root/src/JUCE/modules/juce_core/system/juce_PlatformDefs.h:142:51: note:
  in definition of macro 'JUCE_BLOCK_WITH_FORCED_SEMICOLON'

    142 |  #define JUCE_BLOCK_WITH_FORCED_SEMICOLON(x) do { x } while (false)
        |                                                   ^

  /root/src/JUCE/modules/juce_core/memory/juce_HeavyweightLeakedObjectDetector.h:77:17:
  note: in expansion of macro 'DBG'

     77 |                 DBG ("*** Leaked objects detected: " << map.size() << " instance(s) of class " << getLeakedObjectClassName());
        |                 ^~~

  /root/src/JUCE/modules/juce_core/memory/juce_HeavyweightLeakedObjectDetector.h:77:54:
  note: candidate: 'operator<<(int,
  std::map<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*,
  juce::String,
  std::less<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*>,
  std::allocator<std::pair<juce::HeavyweightLeakedObjectDetector<juce::FTFaceWrapper>*
  const, juce::String> > >::size_type {aka unsigned int})' (built-in)

     77 |                 DBG ("*** Leaked objects detected: " << map.size() << " instance(s) of class " << getLeakedObjectClassName());

  /root/src/JUCE/modules/juce_core/system/juce_PlatformDefs.h:142:51: note:
  in definition of macro 'JUCE_BLOCK_WITH_FORCED_SEMICOLON'

    142 |  #define JUCE_BLOCK_WITH_FORCED_SEMICOLON(x) do { x } while (false)
        |                                                   ^

  /root/src/JUCE/modules/juce_core/memory/juce_HeavyweightLeakedObjectDetector.h:77:17:
  note: in expansion of macro 'DBG'

     77 |                 DBG ("*** Leaked objects detected: " << map.size() << " instance(s) of class " << getLeakedObjectClassName());
        |                 ^~~

  In file included from /root/src/JUCE/modules/juce_core/juce_core.h:255:

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1435:32: note:
  candidate: 'juce::String& juce::operator<<(String&, char)'

   1435 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, char characterToAppend);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1437:32: note:
  candidate: 'juce::String& juce::operator<<(String&, wchar_t)'

   1437 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, wchar_t characterToAppend);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1455:32: note:
  candidate: 'juce::String& juce::operator<<(String&, uint8)'

   1455 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, uint8 number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1457:32: note:
  candidate: 'juce::String& juce::operator<<(String&, short int)'

   1457 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, short number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1459:32: note:
  candidate: 'juce::String& juce::operator<<(String&, int)'

   1459 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1461:32: note:
  candidate: 'juce::String& juce::operator<<(String&, long int)'

   1461 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, long number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1463:32: note:
  candidate: 'juce::String& juce::operator<<(String&, long unsigned int)'

   1463 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, unsigned long number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1465:32: note:
  candidate: 'juce::String& juce::operator<<(String&, int64)'

   1465 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int64 number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1467:32: note:
  candidate: 'juce::String& juce::operator<<(String&, uint64)'

   1467 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, uint64 number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1469:32: note:
  candidate: 'juce::String& juce::operator<<(String&, float)'

   1469 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, float number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1471:32: note:
  candidate: 'juce::String& juce::operator<<(String&, double)'

   1471 | JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, double number);
        |                                ^~~~~~~~

  /root/src/JUCE/modules/juce_core/text/juce_String.h:1476:23: note:
  candidate: 'juce::String& juce::operator<<(String&, bool)' (deleted)

   1476 | String& JUCE_CALLTYPE operator<< (String&, bool) = delete;
        |                       ^~~~~~~~

  gmake[2]: ***
  [extras/Build/juceaide/CMakeFiles/juceaide.dir/build.make:118:
  extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_graphics/juce_graphics.cpp.o]
  Error 1

  gmake[1]: *** [CMakeFiles/Makefile2:131:
  extras/Build/juceaide/CMakeFiles/juceaide.dir/all] Error 2

  gmake: *** [Makefile:136: all] Error 2

-- Configuring incomplete, errors occurred!

What is the expected behaviour?

i would expect the build-process to succeed.

Operating systems

Linux

What versions of the operating systems?

Debian/sid

Architectures

32-bit

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

I have not tested against the develop branch

Code of Conduct

umlaeute commented 2 weeks ago

i have now also tested the develop branch (4e106a76e834f701858328af3dade2b388669b84), and the build fails as well.

umlaeute commented 2 weeks ago

a somewhat naive fix is to just add overload the juce::String operator for the unsigned int type;

--- juce.orig/modules/juce_core/text/juce_String.cpp
+++ juce/modules/juce_core/text/juce_String.cpp
@@ -871,6 +871,7 @@
 JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, uint8  number)         { return s1 += (int) number; }
 JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, short  number)         { return s1 += (int) number; }
 JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, int    number)         { return s1 += number; }
+JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, unsigned int number)   { return s1 += String (number); }
 JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, long   number)         { return s1 += String (number); }
 JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, unsigned long number)  { return s1 += String (number); }
 JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, int64  number)         { return s1 += String (number); }
--- juce.orig/modules/juce_core/text/juce_String.h
+++ juce/modules/juce_core/text/juce_String.h
@@ -1458,6 +1458,8 @@
 /** Appends a decimal number to the end of a string. */
 JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int number);
 /** Appends a decimal number to the end of a string. */
+JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, unsigned int number);
+/** Appends a decimal number to the end of a string. */
 JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, long number);
 /** Appends a decimal number to the end of a string. */
 JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, unsigned long number);
reuk commented 1 week ago

Thanks for reporting, a fix has been added here: https://github.com/juce-framework/JUCE/commit/2301f398aaeca268d2bf1db49e01a28f49d4600a