Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QtPass: new port #20620

Merged
merged 1 commit into from
Dec 30, 2023
Merged

Conversation

sideeffect42
Copy link
Contributor

Description

Adds a new port aqua/QtPass for the QtPass password manager.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 12.7 21G816 x86_64
Xcode 14.2 14C18

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@barracuda156
Copy link
Contributor

@sideeffect42 Can it be built with Qt4?

@sideeffect42
Copy link
Contributor Author

@sideeffect42 Can it be built with Qt4?

It could be built with Qt4 in the past, but I believe Qt4 support was ripped out some time ago and I haven't tried to build a newer version since.

The GUI is very simple, though, so maybe Qt4 support would be relatively easy to patch in again?

@barracuda156
Copy link
Contributor

It could be built with Qt4 in the past, but I believe Qt4 support was ripped out some time ago and I haven't tried to build a newer version since.

The GUI is very simple, though, so maybe Qt4 support would be relatively easy to patch in again?

@sideeffect42 If it builds as-is, it is desirable to add Qt4 support, like it was done here, for example (so that we do not leave the port broken for old systems): 0240f65

If it does not build as-is with Qt4, I can fix that soon, in a separate PR.

@reneeotten
Copy link
Contributor

@sideeffect42 please fix CI failure. Did this build for you locally without any trouble?

aqua/QtPass/Portfile Show resolved Hide resolved
@barracuda156
Copy link
Contributor

(Just to be clear, Qt4 matter does not need to be addressed in this PR, I can add it once this is merged.)

@sideeffect42 sideeffect42 force-pushed the feature/aqua/QtPass branch 2 times, most recently from 06b98b1 to 27f81fe Compare October 2, 2023 09:55
@sideeffect42
Copy link
Contributor Author

@sideeffect42 please fix CI failure. Did this build for you locally without any trouble?

It builds fine on macOS 12. Currently the CI also ran through on macos-11. For some reason the macos-12 run gets cancelled and I don't think I have the permissions to re-start it.

Going through the macos-13 log I suspect the error is:

  ld: unknown options: -sdk_version 

But I don't set -sdk_version in this Portfile. I believe it is set by the qt5 PortGroup.

My Macs are unfortunately too old to run macOS 13, so I cannot test this further.

aqua/QtPass/Portfile Outdated Show resolved Hide resolved
@barracuda156
Copy link
Contributor

As it (just using qmake PG instead of qmake5), it fails with:

In file included from /opt/local/include/gcc12/c++/bits/stl_algo.h:69,
                 from /opt/local/include/gcc12/c++/algorithm:61,
                 from /opt/local/libexec/qt4/include/QtCore/qglobal.h:68,
                 from /opt/local/libexec/qt4/include/QtGui/qrgb.h:45,
                 from /opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers/qcolor.h:45,
                 from /opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers/QColor:1,
                 from qprogressindicator.h:31,
                 from qprogressindicator.cpp:27:
/opt/local/include/gcc12/c++/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
   75 | #include_next <stdlib.h>
      |               ^~~~~~~~~~
compilation terminated.

@barracuda156
Copy link
Contributor

Ah, okay, it sets a wrong sysroot:

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_aqua_QtPass/QtPass/work/compwrap/cxx/opt/local/bin/g++-mp-12 -c -I/opt/local/include -Os -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -DSINGLE_APP=1 -O2 -arch ppc -fPIC -Wall -W -isysroot macosx -DVERSION="\"1.4.0\"" -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/libexec/qt4/share/mkspecs/macx-g++ -I. -I. -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtSvg.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtSvg.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/libexec/qt4/include -I. -o qprogressindicator.o qprogressindicator.cpp

@barracuda156
Copy link
Contributor

This may be causing the failure: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129

@barracuda156
Copy link
Contributor

barracuda156 commented Oct 3, 2023

Once sysroot setting is removed from qtpass.pri, compilation proceeds, but then fails on:

:info:build In file included from util.cpp:1:
:info:build util.h:7:10: fatal error: QRegularExpression: No such file or directory
:info:build     7 | #include <QRegularExpression>
:info:build       |          ^~~~~~~~~~~~~~~~~~~~
:info:build compilation terminated.
:info:build make[1]: *** [util.o] Error 1
:info:build make[1]: *** Waiting for unfinished jobs....
:info:build In file included from storemodel.cpp:4:
:info:build util.h:7:10: fatal error: QRegularExpression: No such file or directory
:info:build     7 | #include <QRegularExpression>
:info:build       |          ^~~~~~~~~~~~~~~~~~~~
:info:build compilation terminated.
. . .
:info:build trayicon.cpp: In constructor 'TrayIcon::TrayIcon(QMainWindow*)':
:info:build trayicon.cpp:31:53: error: 'void QSystemTrayIcon::activated(ActivationReason)' is protected within this context
:info:build    31 |     QObject::connect(sysTrayIcon, &QSystemTrayIcon::activated, this,
:info:build       |                                                     ^~~~~~~~~
:info:build /opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers/qsystemtrayicon.h:112:10: note: declared protected here
:info:build   112 |     void activated(QSystemTrayIcon::ActivationReason reason);
:info:build       |          ^~~~~~~~~
:info:build trayicon.cpp:31:21: error: no matching function for call to 'TrayIcon::connect(QSystemTrayIcon*&, void (QSystemTrayIcon::*)(QSystemTrayIcon::ActivationReason), TrayIcon*, void (TrayIcon::*)(QSystemTrayIcon::ActivationReason))'
:info:build    31 |     QObject::connect(sysTrayIcon, &QSystemTrayIcon::activated, this,
:info:build       |     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build    32 |                      &TrayIcon::iconActivated);
:info:build       |                      ~~~~~~~~~~~~~~~~~~~~~~~~~
. . .
:info:build trayicon.cpp:78:33: error: 'void QAction::triggered(bool)' is protected within this context
:info:build    78 |   connect(quitAction, &QAction::triggered, qApp, &QApplication::quit);
:info:build       |                                 ^~~~~~~~~
:info:build /opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers/qaction.h:228:10: note: declared protected here
:info:build   228 |     void triggered(bool checked = false);
:info:build       |          ^~~~~~~~~
:info:build trayicon.cpp:78:10: error: no matching function for call to 'TrayIcon::connect(QAction*&, void (QAction::*)(bool), QApplication*, void (*)())'
:info:build    78 |   connect(quitAction, &QAction::triggered, qApp, &QApplication::quit);
:info:build       |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Okay, the build was apparently broken by IJHack/QtPass@bd1f363#diff-40ab92941994ec9418dbb76ae46d5aef0e4cb8b034f2be2b31562bb9aca8070f
This has to be reverted.

@barracuda156
Copy link
Contributor

UPD. Okay, forget it for now, the port is pretty broken at least back to 1.2.3. I may look into it some time later, provided that this PR gets merged. But apparently either an archaic version should be used or it gonna require quite a bit of work to fix it :(

@sideeffect42 sideeffect42 force-pushed the feature/aqua/QtPass branch 2 times, most recently from 35fe738 to de5be31 Compare October 3, 2023 08:05
@sideeffect42
Copy link
Contributor Author

TBH, the more time I spend with this Portfile, the more I wonder if it's even worth it do add this port.
QtPass is really not high quality software. The only reason I wrote this Portfile is because I don't feel good downloading .dmgs from GitHub releases, especially not for my password manager.

So I decided I rather have a quick&dirty Portfile to build it (even if on my machine) instead.

But ideally, QtPass would need to be rewritten from scratch.

aqua/QtPass/Portfile Outdated Show resolved Hide resolved
@sideeffect42
Copy link
Contributor Author

@barracuda156 Just checked on the PowerPC system I have QtPass installed on: it's running QtPass 1.1.6 (on Qt 4).

@barracuda156
Copy link
Contributor

@sideeffect42 Does it build with Qt6 by the way?

@sideeffect42
Copy link
Contributor Author

@sideeffect42 Does it build with Qt6 by the way?

Yes, it would (with one trivial patch) if there was a qmake6 PortGroup.

I hacked one together (based on qmake5) which worked for this build on my Mac.
I can commit what I have, but it would need to be finished by somebody else.

@barracuda156
Copy link
Contributor

@sideeffect42 I guess it would be awesome to have qmake6 PG. I bumped into the fact that Qt4 is broken on aarch64, so I want to add Qt6 versions to my Qt-related ports to support new systems in addition to PPC ones.

@sideeffect42
Copy link
Contributor Author

@sideeffect42 I guess it would be awesome to have qmake6 PG.

If it is of any help to you, @barracuda156, I pushed my hacked qmake6 PortGroup to https://github.com/sideeffect42/macports-ports/tree/feature/group/qmake6

@reneeotten
Copy link
Contributor

so what's the status of this?

@barracuda156
Copy link
Contributor

@reneeotten Just in case, fallback versions are irrelevant for now (it is too broken, I won’t bother dealing with it any soon). So whatever works for Intel and Apple Silicon is good.

@reneeotten
Copy link
Contributor

Currently the CI fails everywhere, so something is still broken. If none of the people involved here plan to do something to fix this soon I will close the PR.

@barracuda156
Copy link
Contributor

@reneeotten Well, the PR is not mine, and since it is presently impossible to fix it for older OSs, consider me uninvolved here.

@sideeffect42
Copy link
Contributor Author

so what's the status of this?

@reneeotten: apparently there was a misunderstanding between me and @barracuda156.
I thought he might be doing work on Qt 4/6 support.

As it is, both are "non trivial":

  • Qt 4 support requires either patching the current QtPass version (as Qt 4 is not supported anymore) or going back to an older version (1.1.6);
  • Qt 6 support is doable and I currently have a working version using it on my machine, it only requires someone to implement a proper qmake6 portgroup.

If neither Qt 4 nor Qt 6 support are required for this PR to be merged it is finished from my side. I've been using QtPass built by this Portfile for almost two months now without any problems.

As far as CI is concerned: the builds on macos-11 and macos-12 are cancelled by GitHub for some reason and I don't have the permissions to restart them.

The build on macos-13 is the only one which completes (and fails) with the following error:

  /Library/Developer/CommandLineTools/usr/bin/clang++ -stdlib=libc++ -L/opt/local/lib -Wl,-headerpad_max_install_names -headerpad_max_install_names  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=13.0 -Wl,-sdk_version -Wl,13.3 -Wl,-rpath,@executable_path/../Frameworks -o QtPass.app/Contents/MacOS/QtPass main.o   -F/opt/local/libexec/qt5/lib -L/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_aqua_QtPass/QtPass/work/QtPass-1.4.0/main/../src/./ -lqtpass -framework QtSvg -framework QtWidgets -framework QtGui -framework AppKit -framework Metal -framework QtNetwork -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL   
  ld: unknown options: -sdk_version 
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

The -sdk_version is not added by this port however, as far as I can tell it originates from QMAKE_MAC_SDK set here:

puts ${cache} "QMAKE_MAC_SDK=${qt5.mac_sdk}"

If I comment this line the CI goes green, cf. https://github.com/sideeffect42/macports-ports/actions/runs/6847284242

@reneeotten
Copy link
Contributor

I don't care about Qt4 or Qt6 support right now. But the CO failure needs to be fixed. Please investigate that locally and update this PR once you found the correct solution.

@sideeffect42
Copy link
Contributor Author

But the CO failure needs to be fixed. Please investigate that locally and update this PR once you found the correct solution.

I'm assuming by CO you meant CI, @reneeotten.

Please read my last comment in full.

The CI only fails on macOS 13 which is not even a platform supported upstream for Qt 5.

If you want I can comment out QMAKE_MAC_SDK in the qmake5 port group or limit it to ${os.major} < 22, but I don't know if that's the right way to handle it, since I don't know why this line was added in the first place.

I feel that it makes more sense if someone with a deeper knowledge of Qt would have a look at it.
I'd be surprised if this was the only Qt 5 port which fails to build on macOS 13.

@reneeotten
Copy link
Contributor

I have no interest in this port and will not spend time on it.

If you want to get this merged you'll have to fix the remaining build/CI issues. You can do so at tour earliest convenience and re-open the PR once ready.

@barracuda156
Copy link
Contributor

@sideeffect42 Qt4 support is pointless as is, since the build is broken on old systems, where is would have made sense. It is unlikely someone gonna spend time fixing it, IMO, at least now.

Qt6 support is desirable but not required and poorly supported in Macports at the moment, AFAIU.

Qt5 on macos-13 should work, and it is very much desirable to have the port working on new systems (as long as there is no very compelling reason making it infeasible).

@sideeffect42
Copy link
Contributor Author

GitHub Actions is green now.

@sideeffect42
Copy link
Contributor Author

Did you have a chance to look at the changes already, @reneeotten?

@reneeotten reneeotten merged commit 3f32039 into macports:master Dec 30, 2023
3 checks passed
@sideeffect42 sideeffect42 deleted the feature/aqua/QtPass branch December 30, 2023 21:03
@barracuda156
Copy link
Contributor

Great. I will see if we can find a working version for Qt4. Upstream is silent, sadly: IJHack/QtPass#665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants