Comment 14 for bug 1740022

Revision history for this message
Jeff Young (jeyjey) wrote : Re: [Bug 1740022] Re: custom Environment variables are not used immediately

Yeah, that’s what I thought, but thanks for confirming.

I’ll reverse the existing logic.

> On 8 Mar 2018, at 16:16, Wayne Stambaugh <email address hidden> wrote:
>
> If this is the case, then the logic is broken. In the original design
> externally defined variables always took precedence over internally
> defined variables. Setting an internal variable should not replace the
> externally defined variable when edited using the path configuration
> dialog nor should a variable defined in the settings.
>
> On 3/8/2018 6:35 AM, Jeff Young wrote:
>> The logic is broken.
>>
>> The first time you run KiCad, we apply the env-vars-override-kicad-
>> settings rule.
>>
>> However, if you ever open the Configure Paths dialog and click OK, we'll
>> write ALL the path definitions into the settings file -- but you only
>> get a warning if you modified one of the externally set ones.
>>
>> After that we always overwrite the env-vars with the settings file, so
>> there are no more externally-defined flags. And you therefore won't get
>> a warning if you change one of them. (Nor will kicad pay any attention
>> to changes made in the env vars.)
>>
>> You might say: only write out the changed paths, and this is fine.
>> Except that everyone out there already has them all written into their
>> settings files, and we probably don't want to just blast those. Beside,
>> the warning says changes only take effect until the next run -- which
>> means we shouldn't be saving those at all -- even if changed.
>>
>> Shall I reverse the logic so that we only pay attention to the settings
>> file if the variable was NOT set externally?
>>
>> ** Changed in: kicad
>> Status: Opinion => Triaged
>>
>> ** Changed in: kicad
>> Importance: Undecided => Medium
>>
>> ** Changed in: kicad
>> Assignee: (unassigned) => Jeff Young (jeyjey)
>>
>> ** Changed in: kicad
>> Milestone: None => 5.0.0-rc2
>>
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1740022
>
> Title:
> custom Environment variables are not used immediately
>
> Status in KiCad:
> Triaged
>
> Bug description:
> Hi!
>
> I'm using 64-bit KiCAD Nightly 2017-12-21 (7586afd53) on win7-64bit.
> As a library maintainer I'm using customized environment variable to
> make KiCAD use libs that I checked out somewhere on my system.
>
> I set them using the KiCAD menu entry "Preferences | Configure Paths".
> They point to checkouts of the KiCAD libs that I made below D:\KiCAD.
> I.e. ${KICAD_SYMBOL_DIR} = "D:\KiCAD\kicad-symbols", see attached
> screenshot
>
> Now I'm doing the following:
> 1. Start KiCAD, with the last project I used (sometimes I'm using a local sym-lib-table sometimes not, the global sym-lib-table is emotied, The sym-lib-table always references using environment vars, e.g. "${KICAD_SYMBOL_DIR}/Amplifier_Buffer.lib")
> 2. Opening the library editor, I see a full list of all libs in
> 3. Now I see a list of all the libs that are currently referenced by the currently used sym-lib-table, but when I try to open the libs in the "Search Tree" the nodes are empty, i.e. the libs do not expand and show NO entries. This is true for all libs that not part of the default libs installed with the nightly (remember I'm a lib maintainer, so I'm working with cutting-edge versions and PRs that cannot yet be part of the nightly package). I can though expand libraries that are part of the standard installation and then see the contents in the installed libraries, NOT in the downloaded.
> 4. Now I go to the KiCAD main screen, click on "Preferences | Configure Paths", click OK and reopen the library editor. After it reloads the libs, I can now expand a lib and its contents from the checkout is shown.
>
> To me this looks like KiCAD does not use the values for the
> environment variables set in its dialog "Preferences | Configure
> Paths", but only after the dialog has been opened. Until then it seems
> KiCAD uses the system environment variable, as it was generated during
> Install, which points to the installed libs.
>
> This behaviour is a bit unexpected ... True, I can easily fix it by
> setting the system environment variables, but since I CAN set them in
> KiCAD, I would expect KiCAD to use these right away.
>
> BTW: Would it be possible to set these environment variable on a per-
> project basis? That would be great for library review (I could have a
> project for libs in state 1 and another projet for libs in state 2 ...
> but I also see that that's maybe a special request that not many
> people will profit from ;-)
>
> Would be great to see this fixed. Unfortunately I currently don't have
> enough time to look into the code myself and propose a patch :-(
>
> PS: To all that do celebrate it: Merry christmas!
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1740022/+subscriptions