BOM plugins failing seemingly due to App Translocation

I used the plugin to drop a BOM about a week ago. Things worked okay.

Now today I get:
“Plugin file:
/private/var/folders/0b/v4y__0t57zd5z6x1x8smpjg80000gn/T/AppTranslocation/A5C489EA-F87B-428D-B2FC-F5D89E5CBBF5/d/kicad.app/Contents/SharedSupport/plugins/bom_csv_grouped_by_value.py
not found. Plugin not available.”

This is true, but unhelpful. /private/var/folders/0b/v4y__0t57zd5z6x1x8smpjg80000gn/T/AppTranslocation is completely empty.

The python file exists quite happily:
$ ls /Applications/KiCad/kicad.app/Contents/SharedSupport/plugins/bom_csv_grouped_by_value.py
/Applications/KiCad/kicad.app/Contents/SharedSupport/plugins/bom_csv_grouped_by_value.py

Now, this couldn’t be so bad, but even if I edit the Command line to something that does exist, the “Generate” button remains greyed out. Screenshot will be attached.

Reinstall does NOT fix the problem–I already did that. 3 different times.

In the short term, how do I use the command line to drop the XML netlist as input I need in order to run bom_csv_grouped_by_value.py file from the command line.

In the long term, how do I beat that path into submission?

Thanks.

1 Like

I assume you are on a Mac. I sadly have no idea where the BOM scripts are typically installed on that system. On linux it is under /usr/share/kicad/plugins/ as Mac is derived from it you could look there as well. Otherwise, just use the file system search feature to search for the script file in question.

As I pointed out in my post, I know where the BOM plugins are in reality (/Applications/KiCad/kicad.app/Contents/SharedSupport/plugins). I can run them, but they need an XML file netlist as an input file.

How do I generate that XML netlist from either the command line or from the GUI?

I can run this plugin without any .xml file. Using Linux here.
The plugin generates a .xml file and a text in csv format file. And I do not have a netlist file, I use the Update pcb from schematic tool.

The xml file is generated with the eeschema bom tool. I would point that tool to the real script location. If that doesn’t work then run it without a plugin. That will only generate the xml.

On macOS 10.13, the following invocation works for me

python “/Applications/KiCad/kicad.app/Contents/SharedSupport/plugins/bom_csv_grouped_by_value.py” “%I” “%O”`

(If i use the code formatting tag this splits the command over 2 lines)

This is still broken and I have no ability to fix it. Workarounds actually generated a faulty BOM.

Does nobody have a suggestion?

Apparently a signed DMG actually avoids the whole App Translocation idiocy. (Edit: Maybe–I can’t verify the failure anymore)

Thanks.

For anyone who bumps into this later, I “solved” it by using the little trashcan in the to delete all the plugins. The I used the “+” to re-add each one individually.

This seems to have cleared whatever cache KiCad stashed the path in and is allowing the scripts to run again.

2 Likes

This started to really annoy me, so I spent a bit of time trying to understand what is going on. After a bit of searching, I found this article, which explains the motivation and functionality of App Translocation. Basically, KiCad is getting copied to a randomized, read-only directory before being executed. If the scripts have this randomized path, they won’t work on the next launch.

Initially, I played around with making the plugin paths in the configuration relative, which appears to also work, but requires a bit of sed trickery. Reading more carefully about App Translocation, though, I found the following:

If you move the app, using Finder, from the app’s original unarchived location to another folder, even a subfolder, e.g., ~/Downloads/Test/ , then App Translocation does not occur.

Thus, there turns out to be a quick fix: move KiCad out of the KiCad folder using Finder (e.g., cmd+drag the application to the Desktop) and then move it back into the KiCad folder. You can verify that this worked by launching KiCad and executing the following command in Terminal:

ps aux | grep kicad | grep -v grep

The output should show something like the following if App Translocation is disabled (note the lack of /**/T/AppTranslocation/**/kicad.app...):

64267   0.0  0.4  5034116  66008   ??  S     4:53PM   0:00.45 /Applications/KiCad/kicad.app/Contents/MacOS/kicad

At this point you can just use the trash can to remove all the bom scripts and re-add them individually (as you did before). Because App Translocation is disabled, the path remains the same (e.g., inside /Applications/KiCad/) rather than changing every launch.

1 Like