Skip to content

Error error: macro name must be an identifier when building on Fedora 39 #138665

Closed

Description

@zyrouge

Steps to reproduce

  1. Install media-kit.
  2. Compile the program.

Expected results

Successfully compile.

Actual results

Get an error saying <command line>:1:9: error: macro name must be an identifier. But as far as the log goes, the compile command seems to have -pthread seems to be prefixed by -D but also -pthread passed at the end. This seems to occur for me only on Fedora 39, it did not occur in Fedora 38. The only thing changed in my Clang version from 16 to 17. I do not face this issue in Ubuntu LTS with Clang 16. I checked every possible CMakeLists.txt in my project to make sure no such flags were being defined. I've also created an issue in media-kit's repository (media-kit/media-kit#595). Could this be a Clang issue or is it just a me thing?

Logs

Logs
[+2082 ms] [1/19] Building CXX object plugins/media_kit_native_event_loop/shared/CMakeFiles/media_kit_native_event_loop.dir/media_kit_native_event_loop.cc.o
[   +2 ms] FAILED: plugins/media_kit_native_event_loop/shared/CMakeFiles/media_kit_native_event_loop.dir/media_kit_native_event_loop.cc.o 
[  +56 ms] /usr/bin/clang++ -D-pthread -DAPPLICATION_ID=\"io.github.yukino_org.kazahana\" -DDART_SHARED_LIB -D_REENTRANT -Dmedia_kit_native_event_loop_EXPORTS -isystem
/usr/include/spa-0.2 -isystem /usr/include/vapoursynth -isystem /usr/include/freetype2 -isystem /usr/include/cdio -isystem /usr/include/ffmpeg -isystem
/usr/include/lua-5.1 -isystem /usr/include/SDL2 -isystem /usr/include/uchardet -isystem /usr/include/AL -isystem /usr/include/pipewire-0.3 -isystem /usr/include/libdrm
-isystem /usr/include/ffnvcodec -isystem /usr/include/sysprof-6 -isystem /usr/include/python3.12 -isystem /usr/include/fribidi -isystem /usr/include/glib-2.0 -isystem
/usr/lib64/glib-2.0/include -isystem /usr/include/libpng16 -isystem /usr/include/libxml2 -isystem /usr/include/harfbuzz -g -std=gnu++17 -fPIC -D_REENTRANT -pthread -MD
-MT plugins/media_kit_native_event_loop/shared/CMakeFiles/media_kit_native_event_loop.dir/media_kit_native_event_loop.cc.o -MF
plugins/media_kit_native_event_loop/shared/CMakeFiles/media_kit_native_event_loop.dir/media_kit_native_event_loop.cc.o.d -o
plugins/media_kit_native_event_loop/shared/CMakeFiles/media_kit_native_event_loop.dir/media_kit_native_event_loop.cc.o -c
/home/zyrouge/Vault/ZDev/yukino-org/kazahana/linux/flutter/ephemeral/.plugin_symlinks/media_kit_native_event_loop/src/media_kit_native_event_loop.cc
[  +27 ms] In file included from <built-in>:446:
[        ] <command line>:1:9: error: macro name must be an identifier
[   +3 ms]     1 | #define -pthread 1
[        ]       |         ^
[        ] 1 error generated.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel beta, 3.16.0-0.5.pre, on Fedora Linux 39 (Workstation Edition) 6.5.11-300.fc39.x86_64, locale en_US.UTF-8)
    • Flutter version 3.16.0-0.5.pre on channel beta at /home/zyrouge/TPBinaries/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision adc7dfe87e (10 days ago), 2023-11-07 18:30:33 -0800
    • Engine revision ab14aba1d5
    • Dart version 3.2.0 (build 3.2.0-210.4.beta)
    • DevTools version 2.28.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/zyrouge/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/zyrouge/.asdf/shims/java
    • Java version OpenJDK Runtime Environment Zulu17.46+19-CA (build 17.0.9+8-LTS)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /var/lib/flatpak/exports/bin/com.google.Chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 17.0.3 (Fedora 17.0.3-1.fc39)
    • cmake version 3.27.7
    • ninja version 1.11.1
    • pkg-config version 1.9.5

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Fedora Linux 39 (Workstation Edition) 6.5.11-300.fc39.x86_64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 119.0.6045.123 unknown

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Activity

  1. iapicca commented on Nov 18, 2023

    @iapicca

    I think nobody should receive an answer like this!

    I recommend to switch to the latest stable Channel stable, 3.16.0
    and try running one of these examples
    imho if runs sql_lite is most likely the package causing the issue

  2. zyrouge commented on Nov 18, 2023

    @zyrouge
    Author

    I think nobody should receive an answer like this!

    I recommend to switch to the latest stable Channel stable, 3.16.0 and try running one of these examples imho if runs sql_lite is most likely the package causing the issue

    I did it with stable channel, would try building sql_lite.

  3. added
    in triagePresently being triaged by the triage team
    on Nov 20, 2023
  4. huycozy commented on Nov 20, 2023

    @huycozy
    Member

    Hi @zyrouge
    I haven't experienced this package, could you be more specific on steps to reproduce? Also, per discussion at media-kit/media-kit#595, is this issue an OS and Clang version specific issue (only occurs with Fedora 39 has Clang 17)?

  5. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 20, 2023
  6. zyrouge commented on Nov 20, 2023

    @zyrouge
    Author

    Hi @zyrouge I haven't experienced this package, could you be more specific on steps to reproduce? Also, per discussion at media-kit/media-kit#595, is this issue an OS and Clang version specific issue (only occurs with Fedora 39 has Clang 17)?

    Just adding media_kit as a dependency and trying to build will make the build fail. I cannot be sure if it Fedora 39 or Clang 17 issue since both changed simultaneously (Fedora 39 comes with Clang 17). I am saying this might be Clang 17 issue since it did build successfully on Fedora 38 (Clang 16) and Ubuntu 22.04 (Clang 16). As far as I know, no Ubuntu releases have Clang 17 yet.

  7. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 20, 2023
  8. huycozy commented on Nov 21, 2023

    @huycozy
    Member

    I'm on Ubuntu 22.04.3 LTS with clang version 14.0.0-1ubuntu1.1 but it builds well without issue. Labeling the issue for further information from others.

  9. changed the title [-]Error when building on Fedora 39[/-] [+]Error `error: macro name must be an identifier` when building on Fedora 39[/+] on Nov 21, 2023
  10. added
    platform-linuxBuilding on or for Linux specifically
    e: OS-version specificAffects only some versions of the relevant operating system
    needs repro infoAutomated crash report whose cause isn't yet known
    and removed
    in triagePresently being triaged by the triage team
    on Nov 21, 2023
  11. gspencergoog commented on Nov 30, 2023

    @gspencergoog
    Contributor

    I'm not sure what we can do to help here at this point, without more specific information. We explicitly support Debian and Ubuntu, but we don't really have the resources to debug things on Fedora (and we don't have machines with that installed).

    So, unfortunately, we're going to have to close this issue. If you have a specific PR or solution to contribute, we would gladly review that.
    (Desktop Triage)

  12. femalemonkeyman commented on Dec 11, 2023

    @femalemonkeyman

    Now having this issue on Arch, started pretty randomly was working fine and then i did pub cache clean and flutter clean and now it won't build unless the offending lines -D-pthread are removed from the ninja build file. Then you can manually run ninja to build and it builds successfully. It seems like something goes wrong during the generation of that file then to try to define pthread

  13. femalemonkeyman commented on Dec 11, 2023

    @femalemonkeyman

    Solved

  14. github-actions commented on Dec 25, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Dec 25, 2023
  16. added
    team-linuxOwned by the Linux platform team
    and removed on Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktope: OS-version specificAffects only some versions of the relevant operating systemneeds repro infoAutomated crash report whose cause isn't yet knownplatform-linuxBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions