macOs: “test_bitcoin-qt -platform cocoa” no longer works #17013

issue Sjors openend this issue on October 1, 2019
  1. Sjors commented at 5:05 pm on October 1, 2019: member

    As of v0.18.1 I can use test_bitcoin-qt -platform cocoa to run GUI tests; this opens and closes a regtest GUI a bunch of times.

    As of master (6e4f6553913978fcdddba30e0bb6f97edcb12e80) it seems to ignore the -platform cocoa and just run the test as with minimal.

    As seen on macOS 10.14.6. Git bisect blames a2714a5c69f0b0506689af04c3e785f71ee0915d in #16578 Do not pass in command line arguments to QApplication (@achow101, @ryanofsky)

  2. Sjors added the label Bug on Oct 1, 2019
  3. achow101 commented at 5:56 pm on October 1, 2019: member
    You can use the QT_QPA_PLATFORM environment variable to set that instead.
  4. MarcoFalke commented at 5:59 pm on October 1, 2019: member
    I use QT_QPA_PLATFORM=wayland and it still works just like before
  5. MarcoFalke added the label GUI on Oct 1, 2019
  6. MarcoFalke removed the label Bug on Oct 1, 2019
  7. MarcoFalke added the label Questions and Help on Oct 1, 2019
  8. MarcoFalke removed the label Questions and Help on Oct 1, 2019
  9. MarcoFalke commented at 6:00 pm on October 1, 2019: member
    Should this workaround be mentioned in the release notes?
  10. MarcoFalke added the label Needs release note on Oct 1, 2019
  11. ryanofsky commented at 6:00 pm on October 1, 2019: member

    For reference my earlier comment is: #16578 (comment).

    I think the easiest fix would be to update the instructions to use environment variables instead of command line arguments.

    0QT_QPA_PLATFORM=xcb src/qt/test/test_bitcoin-qt
    1QT_QPA_PLATFORM=windows src/qt/test/test_bitcoin-qt
    2QT_QPA_PLATFORM=cocoa src/qt/test/test_bitcoin-qt
    

    I think this will just require replacing setenv with:

    0if (getenv("QT_QPA_PLATFORM") == nullptr) setenv("QT_QPA_PLATFORM", "minimal", 0);
    
  12. MarcoFalke added this to the milestone 0.19.0 on Oct 1, 2019
  13. Sjors commented at 7:46 pm on October 1, 2019: member
    Using QT_QPA_PLATFORM=cocoa works for me as well. Changing the instructions (also those printed by the test_bitcoin-qt command) seems like a good solution.
  14. ryanofsky commented at 8:00 pm on October 1, 2019: member
    Oh, I guess checking getenv("QT_QPA_PLATFORM") == nullptr is not necessary because the setenv override argument is 0. This might be needed for the windows _putenv_s call above, though
  15. MarcoFalke removed the label Needs release note on Oct 1, 2019
  16. fanquake closed this on Oct 1, 2019

  17. humbleDasher referenced this in commit dd37d5f947 on Dec 5, 2021
  18. MarcoFalke locked this on Dec 16, 2021


Sjors achow101 MarcoFalke ryanofsky

Labels
GUI

Milestone
0.19.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-06 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me