Gasman2014 / KiCad-Diff

Scripts for performing image diffs between pcbnew layout revisions
MIT License
243 stars 41 forks source link

KiCad 6: Error in pcbnew when calling `plotpcb` (create wxApp before calling this) #68

Closed edahlseng closed 2 years ago

edahlseng commented 3 years ago

I'm trying to run plotpcb, but getting an error in what I think is the pcbnew library. I'm seeing the following error message printed out multiple times:

./src/common/stdpbase.cpp(59): assert ""traits"" failed in Get(): create wxApp before calling this

Do you know what might be causing this?

Gasman2014 commented 2 years ago

Yes, have done all of that and had a thorough spring clean of my brew and conda setups. Will investigate further as I have got this at least partially running on Catalina so need to check the exact setup and see if there is something different on M1 Monterey.

The wx panel needs a bit of work and I am hitting a problem again with the paths. If you run KiDiff from outside the checkout of interest, it mucks up the path. I have been running it directly from the KiDiff repo and its is failing after selecting the revisions from the board repository..

On 22 Feb 2022, at 01:15, Leandro Heck @.***> wrote:

Do not forget these 2

brew update brew upgrade — Reply to this email directly, view it on GitHub https://github.com/Gasman2014/KiCad-Diff/issues/68#issuecomment-1047337761, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACADFON42GTZ2KQ56ZAA7HLU4LPTXANCNFSM5ED4AQDQ. You are receiving this because you were mentioned.

Gasman2014 commented 2 years ago

With conda inactive (and therefore using the brew version of python3), I get this;

./kidiff.py 3.9.10 (main, Jan 15 2022, 11:40:53) [Clang 13.0.0 (clang-1300.0.29.3)] This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

And if I activate the base environment in conda, I get this

base  22:33:40  johnpateman  ~  Documents  …  kidiff   leoheck-wxwidges_and_pcm  ✎  ?  %  ./kidiff.py 3.8.11 (default, Jul 29 2021, 14:57:32) [Clang 12.0.0 ] This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

On 21 Feb 2022, at 22:32, John Pateman @.***> wrote:

./kidiff.py 3.9.10 (main, Jan 15 2022, 11:40:53) [Clang 13.0.0 (clang-1300.0.29.3)] This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

On 21 Feb 2022, at 22:12, Leandro Heck @. @.>> wrote:

What does it show for which pythonw after disabling conda? Also, I forget to check, which versoion is used when I call kidiff directly.

Can you add this in your kidiff.py and launch it to see what it is going to show.

import sys print(sys.version) I think a good place to put this is right under the main()

— Reply to this email directly, view it on GitHub https://github.com/Gasman2014/KiCad-Diff/issues/68#issuecomment-1047261732, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACADFOI2EABR6NUCLERRWU3U4K2EFANCNFSM5ED4AQDQ. You are receiving this because you were mentioned.

leoheck commented 2 years ago

I don't have any issue related to path on Linux.

This is running Inside the repo

➜  pwd
/home/lheck/Documents/assoc-board
➜  assoc-board git:(main) ✗ kidiff board.kicad_pcb    

      SCM Selected: git 
  Kicad Board Path: /home/lheck/Documents/assoc-board/board.kicad_pcb
Kicad Project Path: /home/lheck/Documents/assoc-board
         REPO Path: /home/lheck/Documents/assoc-board
 Kicad Project Dir: .
   Board File Name: board.kicad_pcb
        Output Dir: /home/lheck/Documents/assoc-board/.kidiff

Commit 1 (a): board.kicad_pcb
Commit 2 (b): 5be11dd | 2021-12-29 14:58:15 -0300 | Leandro Heck | Update 3d models dir variable

Starting webserver at http://127.0.0.1:9092/web/index.html
(Hit Ctrl+C to exit)
^C

This is running Outside the Repo

➜  assoc-board git:(main) ✗ cd ..
➜  pwd
/home/lheck/Documents/
➜  Documents kidiff assoc-board/board.kicad_pcb    

      SCM Selected: git 
  Kicad Board Path: /home/lheck/Documents/assoc-board/board.kicad_pcb
Kicad Project Path: /home/lheck/Documents/assoc-board
         REPO Path: /home/lheck/Documents/assoc-board
 Kicad Project Dir: .
   Board File Name: board.kicad_pcb
        Output Dir: /home/lheck/Documents/assoc-board/.kidiff

Commit 1 (a): board.kicad_pcb
Commit 2 (b): 5be11dd | 2021-12-29 14:58:15 -0300 | Leandro Heck | Update 3d models dir variable

Starting webserver at http://127.0.0.1:9092/web/index.html
(Hit Ctrl+C to exit)
^C

And, this is running on a completely different path

➜  Documents cd /tmp    
➜  pwd
/tmp
➜  /tmp kidiff ~/Documents/assoc-board/board.kicad_pcb

      SCM Selected: git 
  Kicad Board Path: /home/lheck/Documents/assoc-board/board.kicad_pcb
Kicad Project Path: /home/lheck/Documents/assoc-board
         REPO Path: /home/lheck/Documents/assoc-board
 Kicad Project Dir: .
   Board File Name: board.kicad_pcb
        Output Dir: /home/lheck/Documents/assoc-board/.kidiff

Commit 1 (a): board.kicad_pcb
Commit 2 (b): 5be11dd | 2021-12-29 14:58:15 -0300 | Leandro Heck | Update 3d models dir variable

Starting webserver at http://127.0.0.1:9092/web/index.html
(Hit Ctrl+C to exit)
^C

You can see all PATH output from Kica-Diff shows the same address. Also, you can pass the flag -r to make sure the .kidiff folder is being deleted before kidiff starts to make sure the old files are gone.

I have no idea how, but it runs perfectly on my macOS. However, I haven't tested running it from other places like outside of the repo. I still want to get a clean macOS to validate this, or to create a process so you can at least try something different.

Also, I was testing this on Windows this time, and there the GUI looks good as it is on Linux. I have no idea why the GUI is so ugly on macOS too. But if you run with the brew's interpreter it at least inherits the dark theme from the OS.

Capture