Re: [Kicad-developers] Libcurl patch.

2016-01-11 Thread Wayne Stambaugh
Sorry about the confusion.  I don't remember you saying that you were
working on a fix so if I missed that, I apologize.  The problem on
windows is not that it crashes (at least it hasn't for me yet) but that
it apparently gets tripped up during initialization which causes every
github footprint repo to fail to load.  It doesn't happen often but it's
enough to be annoying.

On 1/10/2016 7:19 PM, Mark Roszko wrote:
> Wayne, the only libcurl bug I know of is the fact that even libcurl is
> affected by openssl apparently not being truely thread safe (even via
> libcurl) and this patch will not fix it and it will still crash. I was
> working on a patch to truely fix it.
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Bernhard Stegmaier
What specifically should be tested?
I can give it a try right now, but I didn’t follow this so I don’t know what to 
look for…


Regards,
Bernhard

> On 10 Jan 2016, at 16:10, Wayne Stambaugh  wrote:
> 
> Did anyone get a chance to test this on OSX?  I didn't see any response
> since I sent out the original message.  I got bit by the libcurl bug
> that this patch fixes twice in the last week so I would like to get it
> committed.
> 
> Thanks,
> 
> Wayne
> 
>  Forwarded Message 
> Subject: Libcurl patch.
> Date: Sat, 26 Dec 2015 10:50:08 -0500
> From: Wayne Stambaugh 
> To: KiCad Developers 
> 
> Dick discovered an issue with the libcurl patch for the github plugin.
> Attached is his patch to fix these issues.  One thing he did that I
> asked him to do was make libcurl dynamically loadable since it isn't
> always necessary to load it at run time.  I've tested the patch on
> windows and linux but I would like one of our osx devs to please test it
> to make sure it works on osx when you get a chance.
> 
> Thanks,
> 
> Wayne
> 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Bernhard Stegmaier
Thanks, it applied now.

clang doesn’t like the static_cast:
std::string msg = StrPrintf( "%s not 
wxDynamicLibrary::Load()ed",
 static_cast( 
canonicalName ) );
and also the same some lines below.

[ 35%] Building CXX object 
common/CMakeFiles/common.dir/kicad_curl/kicad_curl.cpp.o
/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad/common/kicad_curl/kicad_curl.cpp:108:46:
 error: cannot cast from type
  'wxString' to pointer type 'const char *'
 static_cast( 
canonicalName ) );
 
^

I can remember there was a discussion about that (or sth similar?) on the list… 
I can’t remember what the agreement was, though.

I worked around changing those 2 spots to (as suggested by wxWidgets docs):
std::string msg = StrPrintf( "%s not 
wxDynamicLibrary::Load()ed",
 static_cast( 
canonicalName.mb_str() ) );

Therewith it compiles and works fine.
At least, it did load Github footprints.


Regards,
Bernhard

> On 10.01.2016, at 16:49, Wayne Stambaugh  wrote:
> 
> Patch rebased against r6437.  I just rebuild this on windows without any
> issues.
> 
> On 1/10/2016 10:28 AM, Bernhard Stegmaier wrote:
>> Do you have an up-to-date version of the patch?
>> It doesn’t apply to pcbnew/github/github_plugin.cpp anymore, but doesn’t 
>> seem compile without resolving the rejects.
>> 
>> 
>> Regards,
>> Bernhard
>> 
>> 
>>> On 10.01.2016, at 16:19, Wayne Stambaugh  wrote:
>>> 
>>> I just need to make sure it compiles and loads the github footprint
>>> libraries correctly.  It loads libcurl on demand, I need to make sure
>>> that is working on osx.  I've got it tested and working on linux and
>>> windows and I want to make sure we don't introduce any bugs in osx if I
>>> can avoid it.
>>> 
>>> Thanks,
>>> 
>>> Wayne
>>> 
>>> On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
 What specifically should be tested?
 I can give it a try right now, but I didn’t follow this so I don’t know 
 what to look for…
 
 
 Regards,
 Bernhard
 
> On 10 Jan 2016, at 16:10, Wayne Stambaugh  wrote:
> 
> Did anyone get a chance to test this on OSX?  I didn't see any response
> since I sent out the original message.  I got bit by the libcurl bug
> that this patch fixes twice in the last week so I would like to get it
> committed.
> 
> Thanks,
> 
> Wayne
> 
>  Forwarded Message 
> Subject: Libcurl patch.
> Date: Sat, 26 Dec 2015 10:50:08 -0500
> From: Wayne Stambaugh 
> To: KiCad Developers 
> 
> Dick discovered an issue with the libcurl patch for the github plugin.
> Attached is his patch to fix these issues.  One thing he did that I
> asked him to do was make libcurl dynamically loadable since it isn't
> always necessary to load it at run time.  I've tested the patch on
> windows and linux but I would like one of our osx devs to please test it
> to make sure it works on osx when you get a chance.
> 
> Thanks,
> 
> Wayne
> 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
 
>>> 
>> 
> 
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Wayne Stambaugh
I just need to make sure it compiles and loads the github footprint
libraries correctly.  It loads libcurl on demand, I need to make sure
that is working on osx.  I've got it tested and working on linux and
windows and I want to make sure we don't introduce any bugs in osx if I
can avoid it.

Thanks,

Wayne

On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
> What specifically should be tested?
> I can give it a try right now, but I didn’t follow this so I don’t know what 
> to look for…
> 
> 
> Regards,
> Bernhard
> 
>> On 10 Jan 2016, at 16:10, Wayne Stambaugh  wrote:
>>
>> Did anyone get a chance to test this on OSX?  I didn't see any response
>> since I sent out the original message.  I got bit by the libcurl bug
>> that this patch fixes twice in the last week so I would like to get it
>> committed.
>>
>> Thanks,
>>
>> Wayne
>>
>>  Forwarded Message 
>> Subject: Libcurl patch.
>> Date: Sat, 26 Dec 2015 10:50:08 -0500
>> From: Wayne Stambaugh 
>> To: KiCad Developers 
>>
>> Dick discovered an issue with the libcurl patch for the github plugin.
>> Attached is his patch to fix these issues.  One thing he did that I
>> asked him to do was make libcurl dynamically loadable since it isn't
>> always necessary to load it at run time.  I've tested the patch on
>> windows and linux but I would like one of our osx devs to please test it
>> to make sure it works on osx when you get a chance.
>>
>> Thanks,
>>
>> Wayne
>>
>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Bernhard Stegmaier
Do you have an up-to-date version of the patch?
It doesn’t apply to pcbnew/github/github_plugin.cpp anymore, but doesn’t seem 
compile without resolving the rejects.


Regards,
Bernhard


> On 10.01.2016, at 16:19, Wayne Stambaugh  wrote:
> 
> I just need to make sure it compiles and loads the github footprint
> libraries correctly.  It loads libcurl on demand, I need to make sure
> that is working on osx.  I've got it tested and working on linux and
> windows and I want to make sure we don't introduce any bugs in osx if I
> can avoid it.
> 
> Thanks,
> 
> Wayne
> 
> On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
>> What specifically should be tested?
>> I can give it a try right now, but I didn’t follow this so I don’t know what 
>> to look for…
>> 
>> 
>> Regards,
>> Bernhard
>> 
>>> On 10 Jan 2016, at 16:10, Wayne Stambaugh  wrote:
>>> 
>>> Did anyone get a chance to test this on OSX?  I didn't see any response
>>> since I sent out the original message.  I got bit by the libcurl bug
>>> that this patch fixes twice in the last week so I would like to get it
>>> committed.
>>> 
>>> Thanks,
>>> 
>>> Wayne
>>> 
>>>  Forwarded Message 
>>> Subject: Libcurl patch.
>>> Date: Sat, 26 Dec 2015 10:50:08 -0500
>>> From: Wayne Stambaugh 
>>> To: KiCad Developers 
>>> 
>>> Dick discovered an issue with the libcurl patch for the github plugin.
>>> Attached is his patch to fix these issues.  One thing he did that I
>>> asked him to do was make libcurl dynamically loadable since it isn't
>>> always necessary to load it at run time.  I've tested the patch on
>>> windows and linux but I would like one of our osx devs to please test it
>>> to make sure it works on osx when you get a chance.
>>> 
>>> Thanks,
>>> 
>>> Wayne
>>> 
>>> 
>>> 
>>> ___
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>> 
> 


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Wayne Stambaugh
Patch rebased against r6437.  I just rebuild this on windows without any
issues.

On 1/10/2016 10:28 AM, Bernhard Stegmaier wrote:
> Do you have an up-to-date version of the patch?
> It doesn’t apply to pcbnew/github/github_plugin.cpp anymore, but doesn’t seem 
> compile without resolving the rejects.
> 
> 
> Regards,
> Bernhard
> 
> 
>> On 10.01.2016, at 16:19, Wayne Stambaugh  wrote:
>>
>> I just need to make sure it compiles and loads the github footprint
>> libraries correctly.  It loads libcurl on demand, I need to make sure
>> that is working on osx.  I've got it tested and working on linux and
>> windows and I want to make sure we don't introduce any bugs in osx if I
>> can avoid it.
>>
>> Thanks,
>>
>> Wayne
>>
>> On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
>>> What specifically should be tested?
>>> I can give it a try right now, but I didn’t follow this so I don’t know 
>>> what to look for…
>>>
>>>
>>> Regards,
>>> Bernhard
>>>
 On 10 Jan 2016, at 16:10, Wayne Stambaugh  wrote:

 Did anyone get a chance to test this on OSX?  I didn't see any response
 since I sent out the original message.  I got bit by the libcurl bug
 that this patch fixes twice in the last week so I would like to get it
 committed.

 Thanks,

 Wayne

  Forwarded Message 
 Subject: Libcurl patch.
 Date: Sat, 26 Dec 2015 10:50:08 -0500
 From: Wayne Stambaugh 
 To: KiCad Developers 

 Dick discovered an issue with the libcurl patch for the github plugin.
 Attached is his patch to fix these issues.  One thing he did that I
 asked him to do was make libcurl dynamically loadable since it isn't
 always necessary to load it at run time.  I've tested the patch on
 windows and linux but I would like one of our osx devs to please test it
 to make sure it works on osx when you get a chance.

 Thanks,

 Wayne



 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers
 More help   : https://help.launchpad.net/ListHelp
>>>
>>
> 

=== modified file 'common/CMakeLists.txt'
--- common/CMakeLists.txt   2015-12-21 20:30:33 +
+++ common/CMakeLists.txt   2015-12-22 00:00:19 +
@@ -283,7 +283,10 @@
 add_library( common STATIC ${COMMON_SRCS} )
 add_dependencies( common lib-dependencies )
 add_dependencies( common version_header )
-target_link_libraries( common ${Boost_LIBRARIES} ${CURL_LIBRARIES} )
+target_link_libraries( common
+${Boost_LIBRARIES}
+#${CURL_LIBRARIES}  we dynamically link to this ON DEMAND, not at load 
time
+)
 
 
 set( PCB_COMMON_SRCS

=== modified file 'common/footprint_info.cpp'
--- common/footprint_info.cpp   2015-11-11 18:35:26 +
+++ common/footprint_info.cpp   2015-12-22 00:00:19 +
@@ -2,7 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2011 Jean-Pierre Charras, 
- * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck 
+ * Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck 

  * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
  *
  * This program is free software; you can redistribute it and/or
@@ -28,7 +28,12 @@
  */
 
 
-#define USE_WORKER_THREADS  1   // 1:yes, 0:no. use worker thread to 
load libraries
+/**
+No. concurrent threads doing "http(s) GET". More than 6 is not 
significantly
+faster, less than 6 is likely slower. Main thread is in this count, so if
+set to 1 then no temp threads are created.
+*/
+#define READER_THREADS  6
 
 /*
  * Functions to read footprint libraries and fill m_footprints by available 
footprints names
@@ -119,20 +124,13 @@
 }
 
 
-#define JOBZ6   // no. libraries per worker thread.  It 
takes about
-// a second to load a GITHUB library, so 
assigning
-// this no. libraries to each thread 
should give a little
-// over this no. seconds total time if the 
original delay
-// were caused by latencies alone.
-// (If https://github.com does not mind.)
-
 #define NTOLERABLE_ERRORS   4   // max errors before aborting, although 
threads
 // in progress will still pile on for a 
bit.  e.g. if 9 threads
 // expect 9 greater than this.
 
 void FOOTPRINT_LIST::loader_job( const wxString* aNicknameList, int aJobZ )
 {
-//DBG(printf( "%s: first:'%s' count:%d\n", __func__, (char*) TO_UTF8( 

Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Bernhard Stegmaier
wxWidgets docs also used a cast:

Using an explicit conversion to narrow, multibyte, string:
printf("Hello, %s", (const char *)s.mb_str 
())
 

So, I didn’t further think about it… :)


> On 10.01.2016, at 17:11, Chris Pavlina  wrote:
> 
> Yeah, you can't static_cast wxString to const char*, no idea why GCC 
> allowed that, if it even did. Nothing wrong with the approach you used 
> to replace it, though the static_cast in that case is 
> unnecessary (no reason you can't just pass canonicalName.mb_str() 
> directly to StrPrintf).
> 
> On Sun, Jan 10, 2016 at 05:08:42PM +0100, Bernhard Stegmaier wrote:
>> Thanks, it applied now.
>> 
>> clang doesn’t like the static_cast:
>>std::string msg = StrPrintf( "%s not 
>> wxDynamicLibrary::Load()ed",
>> static_cast( 
>> canonicalName ) );
>> and also the same some lines below.
>> 
>> [ 35%] Building CXX object 
>> common/CMakeFiles/common.dir/kicad_curl/kicad_curl.cpp.o
>> /Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad/common/kicad_curl/kicad_curl.cpp:108:46:
>>  error: cannot cast from type
>>  'wxString' to pointer type 'const char *'
>> static_cast( 
>> canonicalName ) );
>> 
>> ^
>> 
>> I can remember there was a discussion about that (or sth similar?) on the 
>> list… I can’t remember what the agreement was, though.
>> 
>> I worked around changing those 2 spots to (as suggested by wxWidgets docs):
>>std::string msg = StrPrintf( "%s not 
>> wxDynamicLibrary::Load()ed",
>> static_cast( 
>> canonicalName.mb_str() ) );
>> 
>> Therewith it compiles and works fine.
>> At least, it did load Github footprints.
>> 
>> 
>> Regards,
>> Bernhard
>> 
>>> On 10.01.2016, at 16:49, Wayne Stambaugh  wrote:
>>> 
>>> Patch rebased against r6437.  I just rebuild this on windows without any
>>> issues.
>>> 
>>> On 1/10/2016 10:28 AM, Bernhard Stegmaier wrote:
 Do you have an up-to-date version of the patch?
 It doesn’t apply to pcbnew/github/github_plugin.cpp anymore, but doesn’t 
 seem compile without resolving the rejects.
 
 
 Regards,
 Bernhard
 
 
> On 10.01.2016, at 16:19, Wayne Stambaugh  wrote:
> 
> I just need to make sure it compiles and loads the github footprint
> libraries correctly.  It loads libcurl on demand, I need to make sure
> that is working on osx.  I've got it tested and working on linux and
> windows and I want to make sure we don't introduce any bugs in osx if I
> can avoid it.
> 
> Thanks,
> 
> Wayne
> 
> On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
>> What specifically should be tested?
>> I can give it a try right now, but I didn’t follow this so I don’t know 
>> what to look for…
>> 
>> 
>> Regards,
>> Bernhard
>> 
>>> On 10 Jan 2016, at 16:10, Wayne Stambaugh  wrote:
>>> 
>>> Did anyone get a chance to test this on OSX?  I didn't see any response
>>> since I sent out the original message.  I got bit by the libcurl bug
>>> that this patch fixes twice in the last week so I would like to get it
>>> committed.
>>> 
>>> Thanks,
>>> 
>>> Wayne
>>> 
>>>  Forwarded Message 
>>> Subject: Libcurl patch.
>>> Date: Sat, 26 Dec 2015 10:50:08 -0500
>>> From: Wayne Stambaugh 
>>> To: KiCad Developers 
>>> 
>>> Dick discovered an issue with the libcurl patch for the github plugin.
>>> Attached is his patch to fix these issues.  One thing he did that I
>>> asked him to do was make libcurl dynamically loadable since it isn't
>>> always necessary to load it at run time.  I've tested the patch on
>>> windows and linux but I would like one of our osx devs to please test it
>>> to make sure it works on osx when you get a chance.
>>> 
>>> Thanks,
>>> 
>>> Wayne
>>> 
>>> 
>>> 
>>> ___
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>> 
> 
 
>>> 
>>> 
>> 
> 
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing 

Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Chris Pavlina
Yeah, you can't static_cast wxString to const char*, no idea why GCC 
allowed that, if it even did. Nothing wrong with the approach you used 
to replace it, though the static_cast in that case is 
unnecessary (no reason you can't just pass canonicalName.mb_str() 
directly to StrPrintf).

On Sun, Jan 10, 2016 at 05:08:42PM +0100, Bernhard Stegmaier wrote:
> Thanks, it applied now.
> 
> clang doesn’t like the static_cast:
> std::string msg = StrPrintf( "%s not 
> wxDynamicLibrary::Load()ed",
>  static_cast( 
> canonicalName ) );
> and also the same some lines below.
> 
> [ 35%] Building CXX object 
> common/CMakeFiles/common.dir/kicad_curl/kicad_curl.cpp.o
> /Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad/common/kicad_curl/kicad_curl.cpp:108:46:
>  error: cannot cast from type
>   'wxString' to pointer type 'const char *'
>  static_cast( 
> canonicalName ) );
>  
> ^
> 
> I can remember there was a discussion about that (or sth similar?) on the 
> list… I can’t remember what the agreement was, though.
> 
> I worked around changing those 2 spots to (as suggested by wxWidgets docs):
> std::string msg = StrPrintf( "%s not 
> wxDynamicLibrary::Load()ed",
>  static_cast( 
> canonicalName.mb_str() ) );
> 
> Therewith it compiles and works fine.
> At least, it did load Github footprints.
> 
> 
> Regards,
> Bernhard
> 
> > On 10.01.2016, at 16:49, Wayne Stambaugh  wrote:
> > 
> > Patch rebased against r6437.  I just rebuild this on windows without any
> > issues.
> > 
> > On 1/10/2016 10:28 AM, Bernhard Stegmaier wrote:
> >> Do you have an up-to-date version of the patch?
> >> It doesn’t apply to pcbnew/github/github_plugin.cpp anymore, but doesn’t 
> >> seem compile without resolving the rejects.
> >> 
> >> 
> >> Regards,
> >> Bernhard
> >> 
> >> 
> >>> On 10.01.2016, at 16:19, Wayne Stambaugh  wrote:
> >>> 
> >>> I just need to make sure it compiles and loads the github footprint
> >>> libraries correctly.  It loads libcurl on demand, I need to make sure
> >>> that is working on osx.  I've got it tested and working on linux and
> >>> windows and I want to make sure we don't introduce any bugs in osx if I
> >>> can avoid it.
> >>> 
> >>> Thanks,
> >>> 
> >>> Wayne
> >>> 
> >>> On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
>  What specifically should be tested?
>  I can give it a try right now, but I didn’t follow this so I don’t know 
>  what to look for…
>  
>  
>  Regards,
>  Bernhard
>  
> > On 10 Jan 2016, at 16:10, Wayne Stambaugh  wrote:
> > 
> > Did anyone get a chance to test this on OSX?  I didn't see any response
> > since I sent out the original message.  I got bit by the libcurl bug
> > that this patch fixes twice in the last week so I would like to get it
> > committed.
> > 
> > Thanks,
> > 
> > Wayne
> > 
> >  Forwarded Message 
> > Subject: Libcurl patch.
> > Date: Sat, 26 Dec 2015 10:50:08 -0500
> > From: Wayne Stambaugh 
> > To: KiCad Developers 
> > 
> > Dick discovered an issue with the libcurl patch for the github plugin.
> > Attached is his patch to fix these issues.  One thing he did that I
> > asked him to do was make libcurl dynamically loadable since it isn't
> > always necessary to load it at run time.  I've tested the patch on
> > windows and linux but I would like one of our osx devs to please test it
> > to make sure it works on osx when you get a chance.
> > 
> > Thanks,
> > 
> > Wayne
> > 
> > 
> > 
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
>  
> >>> 
> >> 
> > 
> > 
> 

> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Wayne Stambaugh
Thanks Bernhard.  I'll make the change to the wxString cast and commit
the patch some time later today.

On 1/10/2016 11:08 AM, Bernhard Stegmaier wrote:
> Thanks, it applied now.
> 
> clang doesn’t like the static_cast:
> std::string msg = StrPrintf( "%s not
> wxDynamicLibrary::Load()ed",
>  static_cast(
> canonicalName ) );
> and also the same some lines below.
> 
> [ 35%] Building CXX object
> common/CMakeFiles/common.dir/kicad_curl/kicad_curl.cpp.o
> */Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad/common/kicad_curl/kicad_curl.cpp:108:46:
> **error: **cannot cast from type*
> *  'wxString' to pointer type 'const char *'*
>  static_cast(
> canonicalName ) );
> *
> ^*
> 
> I can remember there was a discussion about that (or sth similar?) on
> the list… I can’t remember what the agreement was, though.
> 
> I worked around changing those 2 spots to (as suggested by wxWidgets docs):
> std::string msg = StrPrintf( "%s not
> wxDynamicLibrary::Load()ed",
>  static_cast(
> canonicalName.mb_str() ) );
> 
> Therewith it compiles and works fine.
> At least, it did load Github footprints.
> 
> 
> Regards,
> Bernhard
> 
>> On 10.01.2016, at 16:49, Wayne Stambaugh > > wrote:
>>
>> Patch rebased against r6437.  I just rebuild this on windows without any
>> issues.
>>
>> On 1/10/2016 10:28 AM, Bernhard Stegmaier wrote:
>>> Do you have an up-to-date version of the patch?
>>> It doesn’t apply to pcbnew/github/github_plugin.cpp anymore, but
>>> doesn’t seem compile without resolving the rejects.
>>>
>>>
>>> Regards,
>>> Bernhard
>>>
>>>
 On 10.01.2016, at 16:19, Wayne Stambaugh > wrote:

 I just need to make sure it compiles and loads the github footprint
 libraries correctly.  It loads libcurl on demand, I need to make sure
 that is working on osx.  I've got it tested and working on linux and
 windows and I want to make sure we don't introduce any bugs in osx if I
 can avoid it.

 Thanks,

 Wayne

 On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
> What specifically should be tested?
> I can give it a try right now, but I didn’t follow this so I don’t
> know what to look for…
>
>
> Regards,
> Bernhard
>
>> On 10 Jan 2016, at 16:10, Wayne Stambaugh > > wrote:
>>
>> Did anyone get a chance to test this on OSX?  I didn't see any
>> response
>> since I sent out the original message.  I got bit by the libcurl bug
>> that this patch fixes twice in the last week so I would like to get it
>> committed.
>>
>> Thanks,
>>
>> Wayne
>>
>>  Forwarded Message 
>> Subject: Libcurl patch.
>> Date: Sat, 26 Dec 2015 10:50:08 -0500
>> From: Wayne Stambaugh > >
>> To: KiCad Developers > >
>>
>> Dick discovered an issue with the libcurl patch for the github plugin.
>> Attached is his patch to fix these issues.  One thing he did that I
>> asked him to do was make libcurl dynamically loadable since it isn't
>> always necessary to load it at run time.  I've tested the patch on
>> windows and linux but I would like one of our osx devs to please
>> test it
>> to make sure it works on osx when you get a chance.
>>
>> Thanks,
>>
>> Wayne
>>
>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> 
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>

>>>
>>
>> 
> 


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Wayne Stambaugh
From the wxWidgets 3 docs, it appears the correct way to deal with this is:

But a better solution is to use wxWidgets-provided functions, if
possible, as is the case for printf family of functions:

// This is the recommended way.
wxPrintf("You can do just this: %s", s);
wxPrintf("And this (but it is redundant): %s", s.c_str());
wxPrintf("And this (not using Unicode): %s", s.mb_str());
wxPrintf("And this (always Unicode): %s", s.wc_str());

I just used option 1 and it seemed to work just fine.  If the
documentation is correct it should work.  I'll commit it like this and
if breaks on osx, let me know.

On 1/10/2016 11:15 AM, Bernhard Stegmaier wrote:
> wxWidgets docs also used a cast:
> 
> Using an explicit conversion to narrow, multibyte, string:
> printf("Hello, %s", (const char *)s.mb_str
> ())
> 
> 
> So, I didn’t further think about it… :)
> 
> 
>> On 10.01.2016, at 17:11, Chris Pavlina > > wrote:
>>
>> Yeah, you can't static_cast wxString to const char*, no idea why GCC
>> allowed that, if it even did. Nothing wrong with the approach you used
>> to replace it, though the static_cast in that case is
>> unnecessary (no reason you can't just pass canonicalName.mb_str()
>> directly to StrPrintf).
>>
>> On Sun, Jan 10, 2016 at 05:08:42PM +0100, Bernhard Stegmaier wrote:
>>> Thanks, it applied now.
>>>
>>> clang doesn’t like the static_cast:
>>>std::string msg = StrPrintf( "%s not
>>> wxDynamicLibrary::Load()ed",
>>> static_cast(
>>> canonicalName ) );
>>> and also the same some lines below.
>>>
>>> [ 35%] Building CXX object
>>> common/CMakeFiles/common.dir/kicad_curl/kicad_curl.cpp.o
>>> /Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad/common/kicad_curl/kicad_curl.cpp:108:46:
>>> error: cannot cast from type
>>>  'wxString' to pointer type 'const char *'
>>> static_cast(
>>> canonicalName ) );
>>> 
>>> ^
>>>
>>> I can remember there was a discussion about that (or sth similar?) on
>>> the list… I can’t remember what the agreement was, though.
>>>
>>> I worked around changing those 2 spots to (as suggested by wxWidgets
>>> docs):
>>>std::string msg = StrPrintf( "%s not
>>> wxDynamicLibrary::Load()ed",
>>> static_cast(
>>> canonicalName.mb_str() ) );
>>>
>>> Therewith it compiles and works fine.
>>> At least, it did load Github footprints.
>>>
>>>
>>> Regards,
>>> Bernhard
>>>
 On 10.01.2016, at 16:49, Wayne Stambaugh > wrote:

 Patch rebased against r6437.  I just rebuild this on windows without any
 issues.

 On 1/10/2016 10:28 AM, Bernhard Stegmaier wrote:
> Do you have an up-to-date version of the patch?
> It doesn’t apply to pcbnew/github/github_plugin.cpp anymore, but
> doesn’t seem compile without resolving the rejects.
>
>
> Regards,
> Bernhard
>
>
>> On 10.01.2016, at 16:19, Wayne Stambaugh > > wrote:
>>
>> I just need to make sure it compiles and loads the github footprint
>> libraries correctly.  It loads libcurl on demand, I need to make sure
>> that is working on osx.  I've got it tested and working on linux and
>> windows and I want to make sure we don't introduce any bugs in osx
>> if I
>> can avoid it.
>>
>> Thanks,
>>
>> Wayne
>>
>> On 1/10/2016 10:15 AM, Bernhard Stegmaier wrote:
>>> What specifically should be tested?
>>> I can give it a try right now, but I didn’t follow this so I
>>> don’t know what to look for…
>>>
>>>
>>> Regards,
>>> Bernhard
>>>
 On 10 Jan 2016, at 16:10, Wayne Stambaugh > wrote:

 Did anyone get a chance to test this on OSX?  I didn't see any
 response
 since I sent out the original message.  I got bit by the libcurl bug
 that this patch fixes twice in the last week so I would like to
 get it
 committed.

 Thanks,

 Wayne

  Forwarded Message 
 Subject: Libcurl patch.
 Date: Sat, 26 Dec 2015 10:50:08 -0500
 From: Wayne Stambaugh >
 To: KiCad Developers >

 Dick discovered an issue with the libcurl patch for the github
 plugin.
 Attached is his patch to fix these issues.  One thing he did that I
 asked him to do 

Re: [Kicad-developers] Libcurl patch.

2016-01-10 Thread Mark Roszko
Wayne, the only libcurl bug I know of is the fact that even libcurl is
affected by openssl apparently not being truely thread safe (even via
libcurl) and this patch will not fix it and it will still crash. I was
working on a patch to truely fix it.

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2015-12-26 Thread Wayne Stambaugh
On 12/26/2015 11:00 AM, Chris Pavlina wrote:
> On Sat, Dec 26, 2015 at 10:50:08AM -0500, Wayne Stambaugh wrote:
>> [snip] One thing he did that I
>> asked him to do was make libcurl dynamically loadable since it isn't
>> always necessary to load it at run time. [snip]
> 
> Is there a real noticeable advantage to this, though? It seems to me 
> that it's just adding complexity - and possible bug space - for a 
> theoretical improvement in load time. I certainly didn't notice my load 
> time increase with the original libcurl patch.

The problem is that libcurl gets loaded due to the kiface design even in
the apps that don't use the github plugin (according to Dick, I didn't
have time to confirm this but I'm confident this is the case) so loading
libcurl at runtime for the bitmap2component app doesn't make a lot of
sense.  We could change it back to load at runtime if there are issues.
 We probably should push this into a kicad shared object instead of
statically linking which would solve some of the kiface/app
initialization issues that Dick discovered.  There is some stub code in
common/CMakeList.txt already in place it's just an issue of finding the
time to implement it.

> 
> 
>> windows and linux but I would like one of our osx devs to please test it
>> to make sure it works on osx when you get a chance.
>>
>> Thanks,
>>
>> Wayne
> 
>> === modified file 'common/CMakeLists.txt'
>> --- common/CMakeLists.txt2015-12-21 20:30:33 +
>> +++ common/CMakeLists.txt2015-12-22 00:00:19 +
>> @@ -283,7 +283,10 @@
>>  add_library( common STATIC ${COMMON_SRCS} )
>>  add_dependencies( common lib-dependencies )
>>  add_dependencies( common version_header )
>> -target_link_libraries( common ${Boost_LIBRARIES} ${CURL_LIBRARIES} )
>> +target_link_libraries( common
>> +${Boost_LIBRARIES}
>> +#${CURL_LIBRARIES}  we dynamically link to this ON DEMAND, not at 
>> load time
>> +)
>>  
>>  
>>  set( PCB_COMMON_SRCS
>>
>> === modified file 'common/footprint_info.cpp'
>> --- common/footprint_info.cpp2015-11-11 18:35:26 +
>> +++ common/footprint_info.cpp2015-12-22 00:00:19 +
>> @@ -2,7 +2,7 @@
>>   * This program source code file is part of KiCad, a free EDA CAD 
>> application.
>>   *
>>   * Copyright (C) 2011 Jean-Pierre Charras, 
>> - * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck 
>> 
>> + * Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck 
>> 
>>   * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for 
>> contributors.
>>   *
>>   * This program is free software; you can redistribute it and/or
>> @@ -28,7 +28,12 @@
>>   */
>>  
>>  
>> -#define USE_WORKER_THREADS  1   // 1:yes, 0:no. use worker thread 
>> to load libraries
>> +/**
>> +No. concurrent threads doing "http(s) GET". More than 6 is not 
>> significantly
>> +faster, less than 6 is likely slower. Main thread is in this count, so 
>> if
>> +set to 1 then no temp threads are created.
>> +*/
>> +#define READER_THREADS  6
>>  
>>  /*
>>   * Functions to read footprint libraries and fill m_footprints by available 
>> footprints names
>> @@ -119,20 +124,13 @@
>>  }
>>  
>>  
>> -#define JOBZ6   // no. libraries per worker thread.  It 
>> takes about
>> -// a second to load a GITHUB library, 
>> so assigning
>> -// this no. libraries to each thread 
>> should give a little
>> -// over this no. seconds total time if 
>> the original delay
>> -// were caused by latencies alone.
>> -// (If https://github.com does not 
>> mind.)
>> -
>>  #define NTOLERABLE_ERRORS   4   // max errors before aborting, although 
>> threads
>>  // in progress will still pile on for a 
>> bit.  e.g. if 9 threads
>>  // expect 9 greater than this.
>>  
>>  void FOOTPRINT_LIST::loader_job( const wxString* aNicknameList, int aJobZ )
>>  {
>> -//DBG(printf( "%s: first:'%s' count:%d\n", __func__, (char*) TO_UTF8( 
>> *aNicknameList ), aJobZ );)
>> +DBG(printf( "%s: first:'%s' aJobZ:%d\n", __func__, TO_UTF8( 
>> *aNicknameList ), aJobZ );)
>>  
>>  for( int i=0; i>  {
>> @@ -212,8 +210,6 @@
>>  // do all of them
>>  nicknames = aTable->GetLogicalLibs();
>>  
>> -#if USE_WORKER_THREADS
>> -
>>  // Even though the PLUGIN API implementation is the place for the
>>  // locale toggling, in order to keep LOCAL_IO::C_count at 1 or 
>> greater
>>  // for the duration of all helper threads, we increment by one here 
>> via instantiation.
>> @@ -229,6 +225,8 @@
>>  
>>  MYTHREADS threads;
>>  
>> +unsigned jobz = (nicknames.size() + READER_THREADS - 1) / 
>> READER_THREADS;
>> +
>>  

Re: [Kicad-developers] Libcurl patch.

2015-12-26 Thread Wayne Stambaugh
On 12/26/2015 11:20 AM, Chris Pavlina wrote:
> Fair enough, I just don't see how it makes sense. Even if 
> bitmap2component doesn't need libcurl, loading it anyway uses rather few 
> resources, and simplifies the code, reducing the number of places we can 
> expect to find bugs. Dynamically loading libraries like that is 
> generally something people avoid unless they really need to - even if 
> bitmap2component doesn't require libcurl, I promise you it doesn't mind 
> having it ;) and nobody's really hurting for the 100ms reduction in load 
> time either ;)
> 
> Just my two cents, anyway. Not something I feel particularly strongly 
> about, but it seems a little bit silly to me.

I take full responsibility for this.  I was the one who asked Dick to
code it this way.  After I saw his patch, I realized that I should have
just told him to keep the runtime loading.  For now I will leave it as
is.  I can revisit it should it prove to be problematic.

> 
> Agreed about the shared object, but that's a separate topic.
> 
> 
> On Sat, Dec 26, 2015 at 11:14:26AM -0500, Wayne Stambaugh wrote:
>> On 12/26/2015 11:00 AM, Chris Pavlina wrote:
>>> On Sat, Dec 26, 2015 at 10:50:08AM -0500, Wayne Stambaugh wrote:
 [snip] One thing he did that I
 asked him to do was make libcurl dynamically loadable since it isn't
 always necessary to load it at run time. [snip]
>>>
>>> Is there a real noticeable advantage to this, though? It seems to me 
>>> that it's just adding complexity - and possible bug space - for a 
>>> theoretical improvement in load time. I certainly didn't notice my load 
>>> time increase with the original libcurl patch.
>>
>> The problem is that libcurl gets loaded due to the kiface design even in
>> the apps that don't use the github plugin (according to Dick, I didn't
>> have time to confirm this but I'm confident this is the case) so loading
>> libcurl at runtime for the bitmap2component app doesn't make a lot of
>> sense.  We could change it back to load at runtime if there are issues.
>>  We probably should push this into a kicad shared object instead of
>> statically linking which would solve some of the kiface/app
>> initialization issues that Dick discovered.  There is some stub code in
>> common/CMakeList.txt already in place it's just an issue of finding the
>> time to implement it.
>>
>>>
>>>
 windows and linux but I would like one of our osx devs to please test it
 to make sure it works on osx when you get a chance.

 Thanks,

 Wayne
>>>
 === modified file 'common/CMakeLists.txt'
 --- common/CMakeLists.txt  2015-12-21 20:30:33 +
 +++ common/CMakeLists.txt  2015-12-22 00:00:19 +
 @@ -283,7 +283,10 @@
  add_library( common STATIC ${COMMON_SRCS} )
  add_dependencies( common lib-dependencies )
  add_dependencies( common version_header )
 -target_link_libraries( common ${Boost_LIBRARIES} ${CURL_LIBRARIES} )
 +target_link_libraries( common
 +${Boost_LIBRARIES}
 +#${CURL_LIBRARIES}  we dynamically link to this ON DEMAND, not at 
 load time
 +)
  
  
  set( PCB_COMMON_SRCS

 === modified file 'common/footprint_info.cpp'
 --- common/footprint_info.cpp  2015-11-11 18:35:26 +
 +++ common/footprint_info.cpp  2015-12-22 00:00:19 +
 @@ -2,7 +2,7 @@
   * This program source code file is part of KiCad, a free EDA CAD 
 application.
   *
   * Copyright (C) 2011 Jean-Pierre Charras, 
 - * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck 
 
 + * Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck 
 
   * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for 
 contributors.
   *
   * This program is free software; you can redistribute it and/or
 @@ -28,7 +28,12 @@
   */
  
  
 -#define USE_WORKER_THREADS  1   // 1:yes, 0:no. use worker thread 
 to load libraries
 +/**
 +No. concurrent threads doing "http(s) GET". More than 6 is not 
 significantly
 +faster, less than 6 is likely slower. Main thread is in this count, 
 so if
 +set to 1 then no temp threads are created.
 +*/
 +#define READER_THREADS  6
  
  /*
   * Functions to read footprint libraries and fill m_footprints by 
 available footprints names
 @@ -119,20 +124,13 @@
  }
  
  
 -#define JOBZ6   // no. libraries per worker thread.  
 It takes about
 -// a second to load a GITHUB library, 
 so assigning
 -// this no. libraries to each thread 
 should give a little
 -// over this no. seconds total time 
 if the original delay
 -// were caused by latencies alone.
 

Re: [Kicad-developers] Libcurl patch.

2015-12-26 Thread Chris Pavlina
Fair enough, I just don't see how it makes sense. Even if 
bitmap2component doesn't need libcurl, loading it anyway uses rather few 
resources, and simplifies the code, reducing the number of places we can 
expect to find bugs. Dynamically loading libraries like that is 
generally something people avoid unless they really need to - even if 
bitmap2component doesn't require libcurl, I promise you it doesn't mind 
having it ;) and nobody's really hurting for the 100ms reduction in load 
time either ;)

Just my two cents, anyway. Not something I feel particularly strongly 
about, but it seems a little bit silly to me.

Agreed about the shared object, but that's a separate topic.


On Sat, Dec 26, 2015 at 11:14:26AM -0500, Wayne Stambaugh wrote:
> On 12/26/2015 11:00 AM, Chris Pavlina wrote:
> > On Sat, Dec 26, 2015 at 10:50:08AM -0500, Wayne Stambaugh wrote:
> >> [snip] One thing he did that I
> >> asked him to do was make libcurl dynamically loadable since it isn't
> >> always necessary to load it at run time. [snip]
> > 
> > Is there a real noticeable advantage to this, though? It seems to me 
> > that it's just adding complexity - and possible bug space - for a 
> > theoretical improvement in load time. I certainly didn't notice my load 
> > time increase with the original libcurl patch.
> 
> The problem is that libcurl gets loaded due to the kiface design even in
> the apps that don't use the github plugin (according to Dick, I didn't
> have time to confirm this but I'm confident this is the case) so loading
> libcurl at runtime for the bitmap2component app doesn't make a lot of
> sense.  We could change it back to load at runtime if there are issues.
>  We probably should push this into a kicad shared object instead of
> statically linking which would solve some of the kiface/app
> initialization issues that Dick discovered.  There is some stub code in
> common/CMakeList.txt already in place it's just an issue of finding the
> time to implement it.
> 
> > 
> > 
> >> windows and linux but I would like one of our osx devs to please test it
> >> to make sure it works on osx when you get a chance.
> >>
> >> Thanks,
> >>
> >> Wayne
> > 
> >> === modified file 'common/CMakeLists.txt'
> >> --- common/CMakeLists.txt  2015-12-21 20:30:33 +
> >> +++ common/CMakeLists.txt  2015-12-22 00:00:19 +
> >> @@ -283,7 +283,10 @@
> >>  add_library( common STATIC ${COMMON_SRCS} )
> >>  add_dependencies( common lib-dependencies )
> >>  add_dependencies( common version_header )
> >> -target_link_libraries( common ${Boost_LIBRARIES} ${CURL_LIBRARIES} )
> >> +target_link_libraries( common
> >> +${Boost_LIBRARIES}
> >> +#${CURL_LIBRARIES}  we dynamically link to this ON DEMAND, not at 
> >> load time
> >> +)
> >>  
> >>  
> >>  set( PCB_COMMON_SRCS
> >>
> >> === modified file 'common/footprint_info.cpp'
> >> --- common/footprint_info.cpp  2015-11-11 18:35:26 +
> >> +++ common/footprint_info.cpp  2015-12-22 00:00:19 +
> >> @@ -2,7 +2,7 @@
> >>   * This program source code file is part of KiCad, a free EDA CAD 
> >> application.
> >>   *
> >>   * Copyright (C) 2011 Jean-Pierre Charras, 
> >> - * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck 
> >> 
> >> + * Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck 
> >> 
> >>   * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for 
> >> contributors.
> >>   *
> >>   * This program is free software; you can redistribute it and/or
> >> @@ -28,7 +28,12 @@
> >>   */
> >>  
> >>  
> >> -#define USE_WORKER_THREADS  1   // 1:yes, 0:no. use worker thread 
> >> to load libraries
> >> +/**
> >> +No. concurrent threads doing "http(s) GET". More than 6 is not 
> >> significantly
> >> +faster, less than 6 is likely slower. Main thread is in this count, 
> >> so if
> >> +set to 1 then no temp threads are created.
> >> +*/
> >> +#define READER_THREADS  6
> >>  
> >>  /*
> >>   * Functions to read footprint libraries and fill m_footprints by 
> >> available footprints names
> >> @@ -119,20 +124,13 @@
> >>  }
> >>  
> >>  
> >> -#define JOBZ6   // no. libraries per worker thread.  
> >> It takes about
> >> -// a second to load a GITHUB library, 
> >> so assigning
> >> -// this no. libraries to each thread 
> >> should give a little
> >> -// over this no. seconds total time 
> >> if the original delay
> >> -// were caused by latencies alone.
> >> -// (If https://github.com does not 
> >> mind.)
> >> -
> >>  #define NTOLERABLE_ERRORS   4   // max errors before aborting, 
> >> although threads
> >>  // in progress will still pile on for 
> >> a bit.  e.g. if 9 threads
> >>  // expect 9 

Re: [Kicad-developers] Libcurl patch.

2015-12-26 Thread Mark Roszko
No lie, it's a pretty hideous micro-optimization. The mingw "hack"
makes me seriously cringe.  It'll also be invalid the moment they spin
a new libcurl package upstream in msys2 and it becomes curl-5.

*goes to submit curl patch upstream, hehehe*

Like Chris wrote, I left it loading in all the pgms because the
millisecond load time increase is not worth the complexity or the now
future maintenance work required.

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Libcurl patch.

2015-12-26 Thread Chris Pavlina
On Sat, Dec 26, 2015 at 10:50:08AM -0500, Wayne Stambaugh wrote:
> [snip] One thing he did that I
> asked him to do was make libcurl dynamically loadable since it isn't
> always necessary to load it at run time. [snip]

Is there a real noticeable advantage to this, though? It seems to me 
that it's just adding complexity - and possible bug space - for a 
theoretical improvement in load time. I certainly didn't notice my load 
time increase with the original libcurl patch.


> windows and linux but I would like one of our osx devs to please test it
> to make sure it works on osx when you get a chance.
> 
> Thanks,
> 
> Wayne

> === modified file 'common/CMakeLists.txt'
> --- common/CMakeLists.txt 2015-12-21 20:30:33 +
> +++ common/CMakeLists.txt 2015-12-22 00:00:19 +
> @@ -283,7 +283,10 @@
>  add_library( common STATIC ${COMMON_SRCS} )
>  add_dependencies( common lib-dependencies )
>  add_dependencies( common version_header )
> -target_link_libraries( common ${Boost_LIBRARIES} ${CURL_LIBRARIES} )
> +target_link_libraries( common
> +${Boost_LIBRARIES}
> +#${CURL_LIBRARIES}  we dynamically link to this ON DEMAND, not at 
> load time
> +)
>  
>  
>  set( PCB_COMMON_SRCS
> 
> === modified file 'common/footprint_info.cpp'
> --- common/footprint_info.cpp 2015-11-11 18:35:26 +
> +++ common/footprint_info.cpp 2015-12-22 00:00:19 +
> @@ -2,7 +2,7 @@
>   * This program source code file is part of KiCad, a free EDA CAD 
> application.
>   *
>   * Copyright (C) 2011 Jean-Pierre Charras, 
> - * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck 
> + * Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck 
> 
>   * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for 
> contributors.
>   *
>   * This program is free software; you can redistribute it and/or
> @@ -28,7 +28,12 @@
>   */
>  
>  
> -#define USE_WORKER_THREADS  1   // 1:yes, 0:no. use worker thread to 
> load libraries
> +/**
> +No. concurrent threads doing "http(s) GET". More than 6 is not 
> significantly
> +faster, less than 6 is likely slower. Main thread is in this count, so if
> +set to 1 then no temp threads are created.
> +*/
> +#define READER_THREADS  6
>  
>  /*
>   * Functions to read footprint libraries and fill m_footprints by available 
> footprints names
> @@ -119,20 +124,13 @@
>  }
>  
>  
> -#define JOBZ6   // no. libraries per worker thread.  It 
> takes about
> -// a second to load a GITHUB library, so 
> assigning
> -// this no. libraries to each thread 
> should give a little
> -// over this no. seconds total time if 
> the original delay
> -// were caused by latencies alone.
> -// (If https://github.com does not mind.)
> -
>  #define NTOLERABLE_ERRORS   4   // max errors before aborting, although 
> threads
>  // in progress will still pile on for a 
> bit.  e.g. if 9 threads
>  // expect 9 greater than this.
>  
>  void FOOTPRINT_LIST::loader_job( const wxString* aNicknameList, int aJobZ )
>  {
> -//DBG(printf( "%s: first:'%s' count:%d\n", __func__, (char*) TO_UTF8( 
> *aNicknameList ), aJobZ );)
> +DBG(printf( "%s: first:'%s' aJobZ:%d\n", __func__, TO_UTF8( 
> *aNicknameList ), aJobZ );)
>  
>  for( int i=0; i  {
> @@ -212,8 +210,6 @@
>  // do all of them
>  nicknames = aTable->GetLogicalLibs();
>  
> -#if USE_WORKER_THREADS
> -
>  // Even though the PLUGIN API implementation is the place for the
>  // locale toggling, in order to keep LOCAL_IO::C_count at 1 or 
> greater
>  // for the duration of all helper threads, we increment by one here 
> via instantiation.
> @@ -229,6 +225,8 @@
>  
>  MYTHREADS threads;
>  
> +unsigned jobz = (nicknames.size() + READER_THREADS - 1) / 
> READER_THREADS;
> +
>  // Give each thread JOBZ nicknames to process.  The last portion of, 
> or if the entire
>  // size() is small, I'll do myself.
>  for( unsigned i=0; i @@ -240,18 +238,17 @@
>  break;
>  }
>  
> -int jobz = JOBZ;
> -
> -if( i + jobz >= nicknames.size() )
> +if( i + jobz >= nicknames.size() )  // on the last iteration of 
> this for(;;)
>  {
>  jobz = nicknames.size() - i;
>  
> -// Only a little bit to do, I'll do it myself, on current 
> thread.
> +// Only a little bit to do, I'll do it myself on current 
> thread.
> +// I am part of the READER_THREADS count.
>  loader_job( [i], jobz );
>  }
>  else
>  {
> -