Inconsistent configuration path in Pcbnew

Bug #1438897 reported by Sven D
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
KiCad
Invalid
Undecided
Unassigned

Bug Description

I set the environent variable for KISYSMOD and KISYS3DMOD to a subdirectory in my home directory. The variables are defined externally on system level.

In the Footprint Libraries Manager the variables are displayed with the values correct values, to my home directory

In the Configures Path dialoag, the variables show a path to /usr/share/kicad/modules.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1438897] [NEW] Inconsistent configuration path in Pcbnew

This is not a bug. This is by design. When you use the path
configuration dialog, you are editing your own (local) environment
variables which are stored in the kicad_common config file not system
defined paths which take precedent over you locally defined paths.

On 3/31/2015 4:13 PM, Sven D wrote:
> Public bug reported:
>
> I set the environent variable for KISYSMOD and KISYS3DMOD to a
> subdirectory in my home directory. The variables are defined externally
> on system level.
>
> In the Footprint Libraries Manager the variables are displayed with the
> values correct values, to my home directory
>
> In the Configures Path dialoag, the variables show a path to
> /usr/share/kicad/modules.
>
> ** Affects: kicad
> Importance: Undecided
> Status: New
>

Changed in kicad:
status: New → Invalid
Revision history for this message
Sven D (sven-d) wrote :

This should a normal user understand?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1438897] Re: Inconsistent configuration path in Pcbnew

A normal user should no longer have to set environment variables at the
system level and the default local environment variable should be
correct when using installers which should eliminate setting any
environment variables for a default install. This has cause countless
hours of grief and frustration.

On 3/31/2015 5:22 PM, Sven D wrote:
> This should a normal user understand?
>

Revision history for this message
Oivind Toien (otoien) wrote :

"In the Footprint Libraries Manager the variables are displayed with the values correct values, to my home directory

In the Configures Path dialoag, the variables show a path to /usr/share/kicad/modules."

These two problem affects me too. I might be misunderstanding, but are you saying that we are not allowed to keep libraries under our home directories, but just have to place them where ever Kicad dictates under the program folder?

The default path is placed under Program Files which means users cannot write to those folders and modify footprints and 3D modules unde Win7. Nor can the default profiles under the shared folders be written too...

There is more to it than that.

 When I start Kicad 4.01 stable, and open PCBnew directly, a board will display i 3D without showing the 3D modules. Nor will it find modules while browsing for them. When I check the path listed under under the footprint libraries manager the KYSYS3DMOD path and the KYSYSMOD path point to the folder under Program files. If I open preferences - path configuration it list my correct folders under the home directory, but 3D modules are not displayed even if I click OK.

If I start KICAD, and go into the preferences paths in main window, I see the correct paths to the folders under my home directory. If I now klick OK and go into Pcbnew and it will display 3D moduels correctly and both the footprint libraries manager and preferences-configure paths now displays the correct path to the folders in my home directory.

Please do not tell me that this behavior is by design. (I probably misunderstand what you mean).
This is observed with the 4.01 release under 64 bit win7.

I also have a KICAD product install (BZR 6311) which obeys the folder paths defined in the batch file, nicely, but the stable install need to be fixed so that it is working with the paths defined by the users in the program itself (Does not need to know about what is set at system level. Perhaps this is what you mean by saying it is by design) . ***It appears that there are multiple copies of these path names stored in the program, and they are not always kept synchronous, and the program does not always obey the ones listed in PCBnew under Preferences-Configure paths.***

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :
Download full text (3.3 KiB)

On 12/14/2015 9:49 PM, Oivind Toien wrote:
> "In the Footprint Libraries Manager the variables are displayed with the
> values correct values, to my home directory
>
> In the Configures Path dialoag, the variables show a path to
> /usr/share/kicad/modules."
>
> These two problem affects me too. I might be misunderstanding, but are
> you saying that we are not allowed to keep libraries under our home
> directories, but just have to place them where ever Kicad dictates under
> the program folder?
>
> The default path is placed under Program Files which means users cannot
> write to those folders and modify footprints and 3D modules unde Win7.
> Nor can the default profiles under the shared folders be written too...
>
> There is more to it than that.
>
> When I start Kicad 4.01 stable, and open PCBnew directly, a board will
> display i 3D without showing the 3D modules. Nor will it find modules
> while browsing for them. When I check the path listed under under the
> footprint libraries manager the KYSYS3DMOD path and the KYSYSMOD path
> point to the folder under Program files. If I open preferences - path
> configuration it list my correct folders under the home directory, but
> 3D modules are not displayed even if I click OK.
>
> If I start KICAD, and go into the preferences paths in main window, I
> see the correct paths to the folders under my home directory. If I now
> klick OK and go into Pcbnew and it will display 3D moduels correctly and
> both the footprint libraries manager and preferences-configure paths now
> displays the correct path to the folders in my home directory.
>
> Please do not tell me that this behavior is by design. (I probably misunderstand what you mean).
> This is observed with the 4.01 release under 64 bit win7.
>
> I also have a KICAD product install (BZR 6311) which obeys the folder
> paths defined in the batch file, nicely, but the stable install need to
> be fixed so that it is working with the paths defined by the users in
> the program itself (Does not need to know about what is set at system
> level. Perhaps this is what you mean by saying it is by design) . ***It
> appears that there are multiple copies of these path names stored in the
> program, and they are not always kept synchronous, and the program does
> not always obey the ones listed in PCBnew under Preferences-Configure
> paths.***
>

This is where your confusion lies. If you have environment variables
that are defined before kicad is started that conflict with any of your
user defined paths, your user defined paths will be ignored and the
environment variables will take precedence. Conflicting variables are
highlighted in the path configuration dialog. This *is* by design so
that developers can temporarily use different paths when testing new
libraries without having to change their default configuration. You can
change your paths using the path configuration dialog and they will be
changed immediately but when you restart kicad, the environment
variables will take precedence again. If you have any environment
variables defined from previous kicad installs (KISYSMOD, KISYS3DMOD,
etc.) that conflict with the paths defined in th...

Read more...

Revision history for this message
Oivind Toien (otoien) wrote :

During my final test, I started the computer from scratch after a reboot, started the stable version 4.01 of KiCad, opened PCBnew, and launched 3Dview. No components in 3D view seen, only the circuit board with silk screen. I go into Preferences - Configure paths (in PCBnew). The correct paths under my home directory are listed. I go into Preferences - Footprint libraries manager. The paths fro KISYS3DMOD and KISYSMOD are listed as the defaults under the Program Files folder. This is not right, they should be the same, since there isn't any system wide defines.

I then edit the path names, deleting the text (which looks correct, and pasting in the same text. Now the correct path names are listed under Preferences - Footprint libraries manager. However I still do not get a correct 3D view. I also try to save preferences. I can save to the .pro file in the project folder. I try to update default preference in the KiCad share template folder under Program Files. I cannot write to the file. This seems wrong, I think it should reside under the ..\Appdata\Roaming\Kicad folder so that it can be modified. Anyway inspection of the file reveals that path names are not stored there so it is irrelevant in this context.

Under the ..\Appdata\Roaming\Kicad folder I find the correct path names listed in kicad_common.

I close pcbnew and relaunch it again from Kicad's main window (which have not been closed). Now I get a correct 3D view. I close pcbnew and exit Kicad totally, and relaunch it. I start Pcbnew. 3D view is again incorrect with only circuit board showing. And the incorrect folder are again listed under Preferences - Footprint libraries manager. It seems that KiCad is not using the correct folders listed in kicad-common. To me it seems like some kind of program default is applied instead of the correct folder names. The problem cannot be that I previously before boot had at some point set up system wide definitions, as these are identical to the ones in kicad-common.

And to my knowledge no environment variables have been defined in the system when starting from scratch like this. (As I understand, for that to be the case I would have to run the batch file of the product version which defines the environment variables, which again have been set to the correct folder under my home directory, not the ones under program files, and anyway they should not stick after reboot).

I hope this can be resolved.

Revision history for this message
Oivind Toien (otoien) wrote :

Just for the record I solved the problem described by me above by uninstalling and reinstalling. During my initial install "environment variables" had been left on the default which was ticked on. This apparently caused Kicad to use default location for the two main environment variables. During reinstall I opted out of this and also opted out of installing libraries, footprints, and examples (as I manage libraries myself). Now it seems to work OK and my previously defined folders was showing up correctly. Another similar install in a fresh never used VM left some of these blank and I entered the directories in the main window and they stuck both there and in Pcbnew.

Revision history for this message
Danny (mpdanny) wrote :

I agree with the points from both otoien and stambaughw, and am trying to make sense of the expected workflow and settings - maybe I have something set up wrong. I've been using KiCAD for around a year now, making the transition from Eagle, and this is the single point that has caused me more grief and lost hours than anything else (now using 4.0.3, Win 10).

I've tried reinstalling to see if there's an option to change the default paths but I didn't get an option to change them. Would I need to uninstall KiCAD and then reinstall to get this option?

Because the default paths, which as stated by otoien, are in a read-only folder in Windows, are not usable, is the correct workflow supposed to be:

Open KiCAD
Open Path Configuration (so that the correct, modified paths are used)
Begin work

Danny

Revision history for this message
Oivind Toien (otoien) wrote :

Yes, I recommend completely uninstalling and reinstalling as in my last message above.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

On 8/16/2016 5:36 AM, Danny wrote:
> I agree with the points from both otoien and stambaughw, and am trying
> to make sense of the expected workflow and settings - maybe I have
> something set up wrong. I've been using KiCAD for around a year now,
> making the transition from Eagle, and this is the single point that has
> caused me more grief and lost hours than anything else (now using 4.0.3,
> Win 10).
>
> I've tried reinstalling to see if there's an option to change the
> default paths but I didn't get an option to change them. Would I need to
> uninstall KiCAD and then reinstall to get this option?
>
> Because the default paths, which as stated by otoien, are in a read-only
> folder in Windows, are not usable, is the correct workflow supposed to
> be:

Not being able to edit the install libraries is a good thing. You
should not edit these libraries. If you do, you changes will get
overwritten the next time you upgrade kicad. Copy the libraries to a
folder you do have write permission. It's probably a good idea to
rename the library and all of the symbol names in the library or you
will run into symbol naming clashes which will most likely mess up your
schematic.

>
> Open KiCAD
> Open Path Configuration (so that the correct, modified paths are used)
> Begin work

I believe some of the older installers set the KISYSMOD environment
variable. You may want to check your environment variable to make sure
it's not set to the wrong location or delete it an use the path
configuration dialog. External environment variables take precedence
over the one's defined in the path configuration dialoag. This is by
design.

>
> Danny
>

Revision history for this message
sdaau (sd-imi) wrote :

Just wanted to comment: I'm on Ubuntu 14.04, and I built kicad from source, and I want to run it from the source folder (but as that is difficult, I simply ran a `make install` to a directory parallel/sibling to the source. Currently I have Version: (2017-11-13 revision d98fc85)-master, release build.

So, I made a bash script to explicitly set environment variables and call:

    KISYSMOD=$INSTD/usr/local/share/kicad/modules ... $INSTD/usr/local/bin/kicad

When I'd run Kicad like this, I was very surprised to see Preferences/Configure Paths show `KISYSMOD=/usr/local/share/kicad/modules/`; after I found this thread, I realized that is actually written in the `~/.config/kicad/kicad_common` file; so I first renamed that file:

    mv ~/.config/kicad/kicad_common ~/.config/kicad/old.kicad_common

... then I ran my script again - and finally I could see `KISYSMOD=$INSTD/usr/local/share/kicad/modules` in Preferences/Configure Paths; however, I noticed that a new `~/.config/kicad/kicad_common` file had been created, which "hardcodes" the newly set `KISYSMOD=$INSTD/usr/local/share/kicad/modules` path.

So:

> When you use the path
> configuration dialog, you are editing your own (local) environment
> variables which are stored in the kicad_common config file ...

Ok, I understand this - except in my case, I didn't even edit the `kicad_common` config file;

> ...not system
> defined paths which take precedent over you locally defined paths.

That is not my experience, since I explicitly did set the environment variables (which as I understand, sets system defined paths), and they did not take precedence - at the least, they were not shown as such in Preferences/Configure Paths

> If you have environment variables
> that are defined before kicad is started that conflict with any of your
> user defined paths, your user defined paths will be ignored and the
> environment variables will take precedence. Conflicting variables are
> highlighted in the path configuration dialog.

Again, not my experience - I do have environment variables defined before kicad is started, and they will not "overwrite" the settings shown in Preferences/Configure Paths (which are the settings from the `kicad_common` config file), and thus env vars do not take precedence (and I've never seen any graphic indication of conflicting variables in the Preferences/Configure Paths dialog). Only after `kicad_common` is removed, a new one is recreated at next `kicad` start, which now does include the settings from the environment variables.

Given that I can run `kicad` as I want to (in an "out of tree" or "portable" setup on Linux), I don't have a problem either way - I just want to understand how this is supposed to function: i.e. do the env vars take precedence {which in my experience they don't}, or does the `kicad_common` take precedence {which in my experience it does; unless it is missing, in which case it gets reconstructed based on env vars values}.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.