You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Johan Corveleyn <jc...@gmail.com> on 2013/05/30 21:59:33 UTC

errno intersects APR error codes

Running gen-make.py on trunk@1487954, I get the following warning at the end:

[[[
WARNING: errno intersects APR error codes: set([10000, 10004, 10009,
10013, 10014, 10022, 10024, 10035, 10036, 10037, 10038, 10039, 10040,
10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
10061, 10062, 10063, 10064, 10065, 10066])
]]]

I have not seen this before. Is this something new? Anyone else seeing this?

I haven't built trunk for a while, and just changed a couple of
dependencies, so it might also be something local.

For reference:
Visual Studio 2010 on Windows XP
Release build
OPENSSLVER=1.0.1c
HTTPDVER=2.2.22
SERFVER=1.2.0
SQLITEVER=3.7.17
ZLIBVER=1.2.6
JUNITVER=4.10

C:\research\svn\client_build\trunk2>python gen-make.py --release
--with-junit=C:\research\svn\client_build\svn_deps\junit-4.10\junit.jar
--with-httpd=C:\research\svn\client_build\svn_deps\httpd-2.2.22
--with-serf=C:\research\svn\client_build\svn_deps\serf-1.2.0
--with-openssl=C:\research\svn\client_build\svn_deps\openssl-1.0.1c
--with-sqlite=C:\research\svn\client_build\svn_deps\sqlite-amalgamation-3.7.17
--enable-ml --with-zlib=C:\research\svn\client_build\svn_deps\zlib-1.2.6
--vsnet-version=2010 -t vcproj

--
Johan

Re: errno intersects APR error codes

Posted by Daniel Shahaf <da...@elego.de>.
Johan Corveleyn wrote on Thu, May 30, 2013 at 21:59:33 +0200:
> Running gen-make.py on trunk@1487954, I get the following warning at the end:
> 
> [[[
> WARNING: errno intersects APR error codes: set([10000, 10004, 10009,
> 10013, 10014, 10022, 10024, 10035, 10036, 10037, 10038, 10039, 10040,
> 10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
> 10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
> 10061, 10062, 10063, 10064, 10065, 10066])
> ]]]
> 
> I have not seen this before. Is this something new? Anyone else seeing this?
> 
> I haven't built trunk for a while, and just changed a couple of
> dependencies, so it might also be something local.

It's not local to you, the buildbots have it too.  The code printing
that warning was added to trunk only recently.  If it's a problem the
fix is to narrow down the check in build/generator/gen_base.py:287.
Exempting the SOC* codes from the intersection check when generating for
windows, for example.

Re: errno intersects APR error codes

Posted by Daniel Shahaf <da...@elego.de>.
Johan Corveleyn wrote on Sun, Jun 02, 2013 at 22:01:07 +0200:
> If I add a 'self' parameter to the signature of errno_filter in
> gen_win.py, it seems to work (i.e. no error / warning output anymore).
> But I'm not sure if that's the right fix ... my Python knowledge is
> not very advanced :-).
> 

Yes, it is.  errno_filter() is an instance method and as such needs
a 'self' first parameter (like the other errno_filter method in the
patch already has).  The definition is in gen_win.py is used by
gen_msvc_dsp.py and gen_vcnet_vcproj.py, one of which is used by
gen-make.py.

r1488803.

> (thanks for the patch BTW)
> 
> --
> Johan

Re: errno intersects APR error codes

Posted by Johan Corveleyn <jc...@gmail.com>.
'On Fri, May 31, 2013 at 12:23 PM, Daniel Shahaf <da...@apache.org> wrote:
> On Fri, May 31, 2013 at 11:30:57AM +0200, Branko Čibej wrote:
>> I meant specifically the bit that prints that warning, which maybe shouldn't
>> be quite so platform-agnostic.
>
> Agreed.  I don't have a windows box to test the following patch on:
>
> Index: build/generator/gen_base.py
> ===================================================================
> --- build/generator/gen_base.py (revision 1488101)
> +++ build/generator/gen_base.py (working copy)
> @@ -239,8 +239,7 @@ class GeneratorBase:
>          except: pass
>          os.rename(new_hdrfile, hdrfile)
>
> -  @staticmethod
> -  def write_errno_table():
> +  def write_errno_table(self):
>      # ### We generate errorcode.inc at autogen.sh time (here!).
>      # ###
>      # ### Currently it's only used by maintainer-mode builds.  If this
> @@ -278,9 +277,12 @@ class GeneratorBase:
>
>      ## sanity check
>      intersection = set(errno.errorcode.keys()) & set(dict(aprerr).keys())
> -    if intersection:
> +    if self.errno_filter(intersection):
>          print("WARNING: errno intersects APR error codes: %r" % intersection)
>
> +  def errno_filter(self, codes):
> +    return codes
> +
>  class DependencyGraph:
>    """Record dependencies between build items.
>
> Index: build/generator/gen_win.py
> ===================================================================
> --- build/generator/gen_win.py  (revision 1488100)
> +++ build/generator/gen_win.py  (working copy)
> @@ -337,6 +337,11 @@ class WinGeneratorBase(GeneratorBase):
>      else:
>        print("%s not found; skipping SWIG file generation..." % self.swig_exe)
>
> +  def errno_filter(codes):
> +    "Callback for gen_base.write_errno_table()."
> +    # Filter out apr_errno.h SOC* codes, which alias the windows API names.
> +    return set(filter(lambda code: not (10000 <= code <= 10100), codes))
> +
>    def find_rootpath(self):
>      "Gets the root path as understand by the project system"
>      return os.path.relpath('.', self.projfilesdir) + "\\"

This yields an error:

Traceback (most recent call last):
  File "gen-make.py", line 324, in <module>
    main(conf, gentype, skip_depends=skip, other_options=rest.list)
  File "gen-make.py", line 67, in main
    generator.write_errno_table()
  File "build\generator\gen_base.py", line 280, in write_errno_table
    if self.errno_filter(intersection):
TypeError: errno_filter() takes exactly 1 argument (2 given)

If I add a 'self' parameter to the signature of errno_filter in
gen_win.py, it seems to work (i.e. no error / warning output anymore).
But I'm not sure if that's the right fix ... my Python knowledge is
not very advanced :-).

(thanks for the patch BTW)

--
Johan

Re: errno intersects APR error codes

Posted by Daniel Shahaf <da...@apache.org>.
On Fri, May 31, 2013 at 11:30:57AM +0200, Branko Čibej wrote:
> I meant specifically the bit that prints that warning, which maybe shouldn't
> be quite so platform-agnostic.

Agreed.  I don't have a windows box to test the following patch on:

Index: build/generator/gen_base.py
===================================================================
--- build/generator/gen_base.py	(revision 1488101)
+++ build/generator/gen_base.py	(working copy)
@@ -239,8 +239,7 @@ class GeneratorBase:
         except: pass
         os.rename(new_hdrfile, hdrfile)
 
-  @staticmethod
-  def write_errno_table():
+  def write_errno_table(self):
     # ### We generate errorcode.inc at autogen.sh time (here!).
     # ###
     # ### Currently it's only used by maintainer-mode builds.  If this
@@ -278,9 +277,12 @@ class GeneratorBase:
 
     ## sanity check
     intersection = set(errno.errorcode.keys()) & set(dict(aprerr).keys())
-    if intersection:
+    if self.errno_filter(intersection):
         print("WARNING: errno intersects APR error codes: %r" % intersection)
 
+  def errno_filter(self, codes):
+    return codes
+
 class DependencyGraph:
   """Record dependencies between build items.
 
Index: build/generator/gen_win.py
===================================================================
--- build/generator/gen_win.py	(revision 1488100)
+++ build/generator/gen_win.py	(working copy)
@@ -337,6 +337,11 @@ class WinGeneratorBase(GeneratorBase):
     else:
       print("%s not found; skipping SWIG file generation..." % self.swig_exe)
 
+  def errno_filter(codes):
+    "Callback for gen_base.write_errno_table()."
+    # Filter out apr_errno.h SOC* codes, which alias the windows API names.
+    return set(filter(lambda code: not (10000 <= code <= 10100), codes))
+
   def find_rootpath(self):
     "Gets the root path as understand by the project system"
     return os.path.relpath('.', self.projfilesdir) + "\\"

Re: errno intersects APR error codes

Posted by Branko Čibej <br...@e-reka.si>.
On 31.05.2013 06:57, Daniel Shahaf wrote:
> Branko Čibej wrote on Thu, May 30, 2013 at 22:40:11 +0200:
>> On 30.05.2013 21:59, Johan Corveleyn wrote:
>>> Running gen-make.py on trunk@1487954, I get the following warning at the end:
>>>
>>> [[[
>>> WARNING: errno intersects APR error codes: set([10000, 10004, 10009,
>>> 10013, 10014, 10022, 10024, 10035, 10036, 10037, 10038, 10039, 10040,
>>> 10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
>>> 10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
>>> 10061, 10062, 10063, 10064, 10065, 10066])
>>> ]]]
>>>
>>> I have not seen this before. Is this something new? Anyone else seeing this?
>> I wouldn't be surprised if that was the case on Windows, however, APR
>> does not map its error codes from errno but from Win32 status codes. So
>> I suspect this is a red herring and a side effect of the symbolic error
>> code printout thing.
> Yes it's related to the symbolic error names.  Those codes have 2 names
> - one in Python's errno.errorcode[] and one in apr_errno.h.
>
>> Very likely, the mapping generator is just a wee bit too Unix-centric.
> Thanks for assuming my code is buggy without reading it.  The logic in
> question is platform-agnostic.

Sorry, that's not what I meant -- I meant specifically the bit that
prints that warning, which maybe shouldn't be quite so platform-agnostic.

-- Brane

Re: errno intersects APR error codes

Posted by Daniel Shahaf <da...@elego.de>.
Branko Čibej wrote on Thu, May 30, 2013 at 22:40:11 +0200:
> On 30.05.2013 21:59, Johan Corveleyn wrote:
> > Running gen-make.py on trunk@1487954, I get the following warning at the end:
> >
> > [[[
> > WARNING: errno intersects APR error codes: set([10000, 10004, 10009,
> > 10013, 10014, 10022, 10024, 10035, 10036, 10037, 10038, 10039, 10040,
> > 10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
> > 10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
> > 10061, 10062, 10063, 10064, 10065, 10066])
> > ]]]
> >
> > I have not seen this before. Is this something new? Anyone else seeing this?
> 
> I wouldn't be surprised if that was the case on Windows, however, APR
> does not map its error codes from errno but from Win32 status codes. So
> I suspect this is a red herring and a side effect of the symbolic error
> code printout thing.

Yes it's related to the symbolic error names.  Those codes have 2 names
- one in Python's errno.errorcode[] and one in apr_errno.h.

> Very likely, the mapping generator is just a wee bit too Unix-centric.

Thanks for assuming my code is buggy without reading it.  The logic in
question is platform-agnostic.

Re: errno intersects APR error codes

Posted by Branko Čibej <br...@wandisco.com>.
On 30.05.2013 21:59, Johan Corveleyn wrote:
> Running gen-make.py on trunk@1487954, I get the following warning at the end:
>
> [[[
> WARNING: errno intersects APR error codes: set([10000, 10004, 10009,
> 10013, 10014, 10022, 10024, 10035, 10036, 10037, 10038, 10039, 10040,
> 10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
> 10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
> 10061, 10062, 10063, 10064, 10065, 10066])
> ]]]
>
> I have not seen this before. Is this something new? Anyone else seeing this?

I wouldn't be surprised if that was the case on Windows, however, APR
does not map its error codes from errno but from Win32 status codes. So
I suspect this is a red herring and a side effect of the symbolic error
code printout thing. Very likely, the mapping generator is just a wee
bit too Unix-centric.

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com


-- 
THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE 
PRIVILEGED.  If this message was misdirected, WANdisco, Inc. and its 
subsidiaries, ("WANdisco") does not waive any confidentiality or privilege. 
 If you are not the intended recipient, please notify us immediately and 
destroy the message without disclosing its contents to anyone.  Any 
distribution, use or copying of this e-mail or the information it contains 
by other than an intended recipient is unauthorized.  The views and 
opinions expressed in this e-mail message are the author's own and may not 
reflect the views and opinions of WANdisco, unless the author is authorized 
by WANdisco to express such views or opinions on its behalf.  All email 
sent to or from this address is subject to electronic storage and review by 
WANdisco.  Although WANdisco operates anti-virus programs, it does not 
accept responsibility for any damage whatsoever caused by viruses being 
passed.