5.99 / 6 - How to redefine environment variables?

I’m trying to redefine the new environment variables introduced for KiCad 6 (e.g. KICAD6_3DMODEL_DIR, KICAD6_FOOTPRINT_DIR, KICAD6_SYMBOL_DIR) so that they point to my personal forks of the libraries. On Ubuntu 20.04.

Using Preferences > Configure Paths issues a warning:

This path was defined externally to the running process and will only be temporarily overwritten.

And that seems to be true, those environment variables exist. However, I can’t find where they get set. I’ve checked the usual ~/.profile, ~/.bashrc, etc.

Where do they get defined so that I can tweak them?
For end users, isn’t this going to be more difficult than using using Preferences > Configure Paths?
Am I missing something?

Thanks!

If you are using the KiCad PPA, then the variables may be defined in your launcher.

1 Like

Thanks for the quick reply.

That’s right, I’m using the PPA and I have found it on /etc/profile.d/kicad-nightly-env.sh

Is that going to be the same on the final release?

It feels hard to manage given that is a file owned by root and it will probably get overwritten with every update of KiCad.

Maybe a silly question, but, why do they need to be defined at all rather than relying on kicad_common.json?

Thanks!

1 Like

No, this is something specific to the nightly PPA packaging. The release version will not use these kinds of scripts to rename/relocate things.

Maybe a silly question, but, why do they need to be defined at all rather than relying on kicad_common.json?

We’re only just now wrapping up all the efforts to separate all the parts of KiCad paths so that you can have multiple installations side by side without path hacking or env var hacking. Probably the packaging can be updated to get rid of this now (I haven’t tested).

Because of a bug of a missing path I could not start the Python Console in Pcbnew-nightly V5.99. (See link below)

My temporary solution was to start the project manager and then add it to: KiCad-nightly / Preferences / Configure Paths, and that is where I added the “PYTHONPATH” environment variable manually.

Thanks @craftyjon for the explanation. I’ve raised an issue in case we could avoid defining those variables externally.

Yes, @paulvdh, that works when defining new variables. But for variables like KICAD6_SYMBOL_DIR which, in the nightlies at least, are defined externally to KiCad, that is not possible. Thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.