I work on a github action. I need to compile a programm against a specific qt version. The program is build with qbs. I have a problem to configure qbs such that it uses the correct Qt version. There are two versions installed. The first one is installed with sudo apt-get. It is the version 5.12.8. This version is installed as a dependency of qbs. The second qt is installed with aqt. It is the version 5.15.2.
The github action script is
name: Qbs-Tests
on: push
jobs:
ubuntu:
name: "test on ubuntu"
runs-on: ubuntu-latest
steps:
- name: install clang12, qbs, qmake
run: |
sudo apt-get update -y
sudo apt-get install -y clang-12 llvm-12 qbs qt5-qmake
- name: Install Qt
uses: jurplel/install-qt-action#v2
with:
version: 5.15.2
- name: setup qbs
run: |
qbs setup-qt $Qt5_DIR/bin/qmake qt
qbs config --list profiles
qbs config defaultProfile qt
But this ist not possible, since I received the error message
Creating profile 'qt'.
You may want to set up toolchain information for the generated Qt profile.
profiles.qt.moduleProviders.Qt.qmakeFilePaths: "/home/runner/work/QSqlMigrator/Qt/5.15.2/gcc_64/bin/qmake"
Cannot mix incompatible Qt library (5.12.8) with this library (5.15.2)
I also tried to ignore the system search path (Only the last line is exchanged). See qbs Doc
qbs config profiles.qt.preferences.ignoreSystemSearchPaths true
But this leads also to the error message
Cannot mix incompatible Qt library (5.12.8) with this library (5.15.2)
Why I am unable to configure the profile? I am even unable to ignore the system path. Where came the libary incompatibility from? I only configure 5.15.2.
Related
I installed Pyton 3.6.8 on my system.
python3 --version //-> Python 3.6.8
python3.6 --version //-> Python 3.6.8
My pre-commit-config.yaml is:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
language_version: python3.6
I installed the pre-commit hook for my project.
Every time when I want to commit some changes to git, the pre-commit is running with the flake8 error:
TYP005 NamedTuple does not support defaults in 3.6.0
This is true for Python 3.6.0, because this feature is introduced and allowed with Python 3.6.1+.
https://docs.python.org/3.6/library/typing.html#typing.NamedTuple
How can I configure flake8 to run with Python 3.6.8?
EDIT
When I run flake8 file.rb, I don`t get the error message TYP005.
python3 -m pip install flake
flake --version //-> 3.7.9 (the same version as in the pre-commit script file)
disclaimer: I'm the author of two of the tools in question (pre-commit, flake8-typing-imports) and the maintainer of the other (flake8)
the TYP005 code comes from flake8-typing-imports
there are two options for indicating your minimum supported version to flake8-typing-imports, the first is a command line argument / flake8 setting:
--min-python-version 3.6.1
or in your flake8 configuration
[flake8]
min_python_version = 3.6.1
if you're distributing a library, you can indicate the minimum supported version using the python_requires metadata -- this is specified in setup.cfg
[options]
python_requires >= 3.6.1
an aside, I believe there's some information missing from your question, without additional_dependencies in your pre-commit configuration, flake8 will be installed in isolation and won't have access to plugins such as flake8-typing-imports -- my guess is you've actually got a configuration similar to:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.9.0]
when speaking of command line arguments above, you could specify them as args here (though I personally prefer the configuration file approaches)
- id: flake8
args: [--min-python-version, '3.6.1']
additional_dependencies: [flake8-typing-imports==1.9.0]
I'm trying to build a Release pipeline that is triggered by a new version of a published dotnet core tool. The trigger works fine, but I'm unable to install and run the tool in my Tasks.
CURRENTLY:
Running a Command Line Task results in a 401:
dotnet tool install -g --add-source=https://pkgs.dev.azure.com/<org-name>/_packaging/Tools/nuget/v3/index.json MyApp
C:\Program Files\dotnet\sdk\3.0.100\NuGet.targets(123,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/<org-name>/_packaging/Tools/nuget/v3/index.json. [C:\Users\VssAdministrator\AppData\Local\Temp\h0g1c35v.eny\restore.csproj]
C:\Program Files\dotnet\sdk\3.0.100\NuGet.targets(123,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\VssAdministrator\AppData\Local\Temp\h0g1c35v.eny\restore.csproj]
The tool package could not be restored.
Tool 'myapp' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
This leads me to believe that I'm missing something here, making it more complicated than it needs to be, or thinking about this the wrong way. The tools in the feed can be installed locally, so I believe it's my release approach.
I'm currently looking into Personal Access Tokens (PAT)
PREVIOUSLY:
If I use the .Net Core task and the custom option:
The logs show a malformed command passed to dotnet.exe:
[command]"C:\Program Files\dotnet\dotnet.exe" "dotnet tool install -g --add-source=https://pkgs.dev.azure.com/<org-name>/_packaging/Tools/nuget/v3/index.json MyApp"
or
[command]"C:\Program Files\dotnet\dotnet.exe" "tool install -g --add-source=https://pkgs.dev.azure.com/<org-name>/_packaging/Tools/nuget/v3/index.json MyApp"
I've tried varying arguments and I tend to always see the same error message:
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-dotnet tool install -g --add-source=https://pkgs.dev.azure.com/<org-name>/_packaging/Tools/nuget/v3/index.json MyApp does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
Your custom dotnet command is quoted and dotnet is repeated : dotnet.exe" "dotnet tool install ..." so the command is misinterpreted.
You can use the Command Line task and set the dotnet command directly :
dotnet tool install -g --add-source=https://pkgs.dev.azure.com/<org-name>/_packaging/Tools/nuget/v3/index.json MyApp
Using the .Net Core task works perfect for us.
Since the dotnet command is quoted, you need to set tool as the command and update into arguments. NuGet credentials can be provided with NuGet Auth task if needed.
Here is my walkaround:
I firstly published my private dotnet tool nupkg file also as an universal package to the same Azure Artifacts feed.
I was able to then use Universal Package task to download the .nupkg file into $(System.DefaultWorkingDirectory)/nupkgs/. This task will handle the authorization to Azure Artifacts feeds.
steps:
- task: UniversalPackages#0
displayName: 'Download mytool.cli.universal'
inputs:
downloadDirectory: '$(System.DefaultWorkingDirectory)/nupkgs/'
vstsFeed: '63d4aa2f-3ae7-4c27-8c18-aa8e3a9ff353'
vstsFeedPackage: '916d9a27-2c07-4071-8631-377f2ac08ed7'
vstsPackageVersion: 0.2.0
I then had the DotNetCoreCLI task to install my nupkg locally in agents.
steps:
- task: DotNetCoreCLI#2
displayName: 'Install mytool as a dotnet tool'
inputs:
command: custom
custom: tool
arguments: 'install --global mytool.CLI --add-source ./nupkgs --version 0.2.0'
You need to add the nuget authenticate task before you try to access the nuget feed
Running:
./myapp -platform wayland
gives:
This application failed to start because it could not find or load the
Qt platform plugin "wayland" in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl,
offscreen, vnc, xcb.
Reinstalling the application may fix this problem. Aborted (core
dumped)
Following the instructions: How to build qtwayland?
Running qmake gives:
Running configuration tests...
Done running configuration tests.
Configure summary:
Qt Wayland Client ........................ no
Qt Wayland Compositor .................... no
Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
The qtwayland README indicates 2 dependencies:
xkbcommon 0.2.0 - http://xkbcommon.org/
wayland 1.6.0 - http://wayland.freedesktop.org/
On fedora 28, libxkbcommon is installed by default. In addition I also installed libxkbcommon-devel
dnf whatprovides *wayland*
returns no results, although my gnome session is running under wayland.
I see I can download wayland from https://wayland.freedesktop.org/releases.html.
I downloaded and decompressed 1.15, but not sure what to do with decompressed source: do I build it? do I need to put it somewhere where qtwayland can find it?
I see that the following file exists by default in fedora 28:
/usr/lib64/qt5/plugins/wayland-graphics-integration-server/libwayland-egl.so
But copying it to ~/Qt/5.10.1/gcc_64/plugins/platforms
does not resolve my application startup errors.
Question: how to get my Qt application to run under wayland?
Added in response to bobbaluba questions below:
Am trying to build QtWayland against the official Qt Binaries because it is not included.
Installed wayland-devel as suggested, but qmake still reported no configure for Qt Wayland Client, as per the message above.
Tried to install qt5-qtwayland using dnf, which reported:
Package qt5-qtwayland-5.10.1-2.fc28.x86_64 is already installed, skipping.
The following might be relevant:
? sudo dnf whatprovides libwayland-egl.so
Last metadata expiration check: 0:18:44 ago on Wed 09 May 2018 09:15:20 PM +08.
qt5-qtwayland-5.10.1-2.fc28.i686 : Qt5 - Wayland platform support and QtCompositor module
Repo : fedora
Matched from:
Provide : libwayland-egl.so
? find / -name libwayland-egl.so* -print
/usr/lib64/libwayland-egl.so
/usr/lib64/qt5/plugins/wayland-graphics-integration-server/libwayland-egl.so
? sudo ldconfig -p | grep wayland-egl
libwayland-egl.so.1 (libc6,x86-64) => /lib64/libwayland-egl.so.1
libwayland-egl.so (libc6,x86-64) => /lib64/libwayland-egl.so
Installed Qt 5.11.0rc which resulted in
~/Qt/5.11.0/gcc_64/plugins/wayland-graphics-integration-server/libwayland-egl.so
~/Qt/5.11.0/gcc_64/plugins/wayland-graphics-integration-server/libwayland-egl.so.debug
being added to ~/Qt/5.11.0/gcc_64/plugins/platforms.
cmake's CMakeFile.txt suddenly stopped working when I installed Qt5.11rc - with gcc unable to find Qt headers like QDate.
Tried compiling the example project 'addressbook' using Qt5.11 and got:
QSocketNotifier: Can only be used with threads started with QThread
Using Wayland-EGL
Using the 'xdg-shell-v6' shell integration
In short, using the Qt5.11rc seems to resolve the issue.
Why does configuring QtWayland fail?
I'm assuming (correct me if I'm wrong) that you are trying to build QtWayland against official Qt binaries that do not include QtWayland.
Do you have development packages installed? In your case I think it should be wayland-devel.
Btw, the libwayland-egl.so you see, is your distro's version of the qt wayland-egl buffer integration (and not the same as the libwayland-egl.so dependency which qmake complains is missing). However, you should still be able to build QtWayland without wayland-egl, so I'm not sure what this is about.
Other options:
1. Use official QtWayland binaries
You are probably running into this problem because Qt packages did not previously include QtWayland.
However, starting with Qt 5.11.0 the official Qt binaries should include QtWayland, so the easiest thing would probably be to install Qt 5.11.0 or newer.
2. Use the distro's version of Qt (and Qt Wayland)
Install and use Qt from the distro, make sure you also install qtwayland (on Fedora I think it's qt5-qtwayland).
I am currently using Ubuntu 14.04 LTS.
How can I statically build Qt 4.8.5 -
https://download.qt.io/archive/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
such that when I cmake OpenCV 2.4.13 -
https://github.com/opencv/opencv/archive/2.4.13.zip
it correctly identifies the location of Qt4 ?
When I cmake OpenCV after I have installed Qt4 in /usr/local/qt4-static/, the find_package(Qt4 REQUIRED QtCore QtGui QtTest) function call within opencv-2.4.13/cmake/OpenCVFindLibsGUI.cmake fails because it cannot find qmake. Also, upon running the qmake -query in the terminal, Ubuntu says that qmake is not installed, when it clearly in /usr/local/qt4-static/.
How should I go about this so OpenCV cmake correctly recognizes Qt4 ?
Build Qt
Extract the source-code and run ./configure && make and then sudo make install. It should create all necessary configuration to run qmake in any folder (system-wide).
Additional: create a symlink/export (use only if make install did not work for you)
You need to promote qmake to $PATH or create a symlink, but this is usually done when you run sudo make install after make in the Qt source-folder.
root:/home# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
Symlink (permanently)
ln -s /path/to/qmake /usr/sbin/qmake
or
export (temporary)
export PATH=$PATH:/folder/of/qmake
Afterwards qmake -v is working whereever you are
root:/tmp qmake -v
QMake version 3.1
Using Qt version 5.10.1 in /usr/local/Qt-5.10.1/lib
If your project still cannot determine the location of Qt, read the pro/pri/cmake file to understand how it looks for the path.
After upgrading my app to version 1.0.1 like this in project.json:
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
},
This works under Windows but not under Linux.
Under Linux I get this error:
Project BackendGems (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Project test (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found.
- Check application dependencies and target a framework version installed at:
/opt/dotnet_cli/shared/Microsoft.NETCore.App
- The following versions are installed:
1.0.0
- Alternatively, install the framework version '1.0.1'.
SUMMARY: Total: 1 targets, Passed: 0, Failed: 1.
I tried to delete the nuget cache and made sure I have the same SDK version 1.0.0-preview2-003121.
What can possible be wrong?
The change that you have done on the project.json forces your app to run on a runtime version >=v1.0.1 or else fail.
dotnet restore updates the dependencies but not the runtime.
So, you just have to install the 1.0.1 runtime in /opt/dotnet_cli/shared/Microsoft.NETCore.App as the error message states.
Each linux distro has different installation instruction on .NET site, so it may be your case that you can do something like 'apt-get install dotnet-dev-1.0.1'
But for Debian, I had to do it manually:
Get the link and download .NET Core binaries only (v1.0.1) from https://www.microsoft.com/net/download#core
$ wget https://go.microsoft.com/fwlink/?LinkID=825887 -O dotnet-1.0.1.tar.gz
Restore it on /opt/dotnet_cli/shared/Microsoft.NETCore.App
tar zxvf dotnet-1.0.1.tar.gz -C /opt/dotnet_cli/
And now dotnet run works as expected.
EDIT: Looks like MS is updating the download page right now, so you will find the file to download labeled as .NET Core binaries only now (no mention to 1.0.1). But the file is still the same one.