Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qbs profile confusion!



  • Hi, newbie here
    So I'm setting up my toolchain configuration as per:

    https://doc.qt.io/qbs/configuring.html
    I go:
    ➜ qbs setup-toolchains --detect
    Trying to detect gcc...
    Profile 'gcc' created for '/bin/gcc'.
    Trying to detect clang...
    Profile 'clang' created for '/bin/clang'.

    I can list my profiles by doing:
    ➜ qbs config --list profiles
    profiles.clang.cpp.toolchainInstallPath: "/bin"
    profiles.clang.qbs.toolchain: ["clang", "llvm", "gcc"]
    profiles.gcc.cpp.toolchainInstallPath: "/bin"
    profiles.gcc.qbs.toolchain: "gcc"

    Then I cd into an example project as instructed:
    cd /usr/share/qtcreator/qbs/share/qbs/examples/helloworld-minimal

    But when I go:
    sudo qbs profile:gcc
    Password:

    I get this:

    Build graph does not yet exist for configuration 'default'. Starting from scratch.
    Resolving project for configuration default
    ERROR: /usr/share/qtcreator/qbs/share/qbs/examples/helloworld-minimal/hello.qbs:53:1 Error while handling product 'HelloWorld-minimal':
    /usr/share/qtcreator/qbs/share/qbs/examples/helloworld-minimal/hello.qbs:53:1 Profile 'gcc' does not exist.

    Profile gcc does not exist, even though it does as per the above command:
    ➜ qbs config --list profiles

    Am I missing something here or?


  • Lifetime Qt Champion

    @eamoc why do you use sudo?

    That will change your user profile and that is the reason your config is reset.

    I strongly recommend against building software with sudo!



  • I was using sudo because I couldn't figure out the error I was getting without it.
    This is what I get otherwise
    ➜ qbs profile: "gcc" ( I also tried it with out quotes )
    ERROR: Unexpected command line parameter 'gcc'.
    Expected an assignment of the form <property>:<value>, profile:<profile-name> or config:<configuration-name>.

    I'm new to qbs, so I figure I'm missing something trivial


  • Lifetime Qt Champion

    @eamoc I'm not a QBS expert, but maybe you just need to remove the space:

    qbs profile:gcc
    

    ?



  • @jsulm
    wow, I never thought of that! ... ( sarcasm)

    when I remove the space, I get a different error:

    ➜ qbs profile:gcc
    WARNING: Failed to remove empty directory '/usr/share/qtcreator/qbs/share/qbs/examples/helloworld-minimal/default'.
    ERROR: Cannot lock build graph file '/usr/share/qtcreator/qbs/share/qbs/examples/helloworld-minimal/default/default.bg': Failed to create directory.

    There is no directory called default in there


  • Lifetime Qt Champion

    @eamoc That's because normal users do not have write access to /usr
    You can try to copy this stuff to some directory you have write access to.



  • @jsulm
    Thats why I resorted to using sudo earlier.
    Thanks for your reply

    Eamonn


Log in to reply