alihalabyah / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Apple build scripts are broken .. #316

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Graham, 

symlink or changing the path in apxs is not the issue. Issue is something to 
lib tool and error spit out is 
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
apxs:Error: Command failed with rc=65536

so, question becomes what is lib tool reading? or Is there a configure and make 
that will work on Mac OS X 10.9.1 or any older version of Mac OS X that was 
tested completely. 

Regards, Madhu

On Feb 10, 2014, at 2:54 PM, Madhu Seshadri <madhuseshadri@icloud.com> wrote:

I fixed the path issue in apxs. lib tool is giving this error not sure how to 
apxs can be fix this. Is the lib tool reading tagged configuration? If so, from 
where so that I can go after that. 

Regards, Madhu

On Feb 6, 2014, at 3:25 PM, Graham Dumpleton <graham.dumpleton@gmail.com> wrote:

Normally one would fix the apxs config issue by creating a symlink in the 
filesystem rather than modifying apxs config.

http://code.google.com/p/modwsgi/issues/detail?id=312

I am considering a better fix for mod_wsgi configure/build script but haven't 
got to it yet.

I can't check the other issue right now as my laptop which has latest MacOS has 
stopped charging and taking it to Mac Store on weekend to see if can get fixed.

Try the symlink fix and see if that resolves it. Quite possible something else 
is dependent on the symlink existing.

Graham

On 07/02/2014, at 5:54 AM, Madhu Seshadri <madhuseshadri@icloud.com> wrote:

Graham, 

/usr/sbin/apxs -c 
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE   mod_wsgi.c 
-Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error 
/System/Library/Frameworks/  -ldl  -framework CoreFoundation  
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/usr/share/apr-1/build-1/libtool --silent --mode=compile 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin    -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I/usr/local/include 
-I/usr/include/apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -c -o mod_wsgi.lo 
mod_wsgi.c && touch mod_wsgi.slo

libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1

my CFG_CC getvars in apxs is getting wrong path for cc. I had manually hard 
code to the right path.  

I'm installing using OS provided Webserver (apache) and /usr/bin/python. How do 
I cross the hurdle? 

As such I'm using mod_python on Ubuntu and trying to get mod_wsgi work on a Mac.

Regards, 
Madhukumar Seshadri
http://letustalkweb.org

Original issue reported on code.google.com by madhuses...@gmail.com on 13 Feb 2014 at 7:10

GoogleCodeExporter commented 9 years ago
This is still not the mailing list which I said should be used. Am still 
waiting on laptop to be repaired so still cannot investigate.

Original comment by Graham.Dumpleton@gmail.com on 13 Feb 2014 at 10:32

GoogleCodeExporter commented 9 years ago
What do you get if you run:

  which lib tool

and:

  libtool -V

Is it definitely from:

  /usr/bin/libtool

and if so what version?

Original comment by Graham.Dumpleton@gmail.com on 14 Feb 2014 at 4:45

GoogleCodeExporter commented 9 years ago
Also provide the output of running:

    ls -las /usr/share/apr-1/build-1/libtool 

and:

    /usr/share/apr-1/build-1/libtool --version

Original comment by Graham.Dumpleton@gmail.com on 14 Feb 2014 at 4:48

GoogleCodeExporter commented 9 years ago
And finally from running:

    las -las /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/usr/share/apr-1/build-1/libtool

and:

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/usr/share/apr-1/build-1/libtool --version

Original comment by Graham.Dumpleton@gmail.com on 14 Feb 2014 at 4:49

GoogleCodeExporter commented 9 years ago
Next up, provide the output from running:

    apxs -q CC

Original comment by Graham.Dumpleton@gmail.com on 14 Feb 2014 at 5:09

GoogleCodeExporter commented 9 years ago
inside:~ madhu$ libtool -V
Apple Inc. version cctools-846.2.4

inside:~ madhu$ apxs -q CC
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc

Regards, Madhu

Original comment by madhuses...@gmail.com on 17 Feb 2014 at 11:20

GoogleCodeExporter commented 9 years ago
I haven't yet tried on MacOS X 10.9, but do have my laptop back now.

From my investigation on MacOS X 10.8, the reason you are getting the error 
about tagged configuration is because you changed the apxs configuration to use:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/cc

You cannot do this, as it will only be able to find a tag configuration for:

/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc

and will error with anything else, unless other parts of the configuration are 
overridden to insert a '--tag CC' argument to the invocation of libtool.

You have to therefore put back any apxs configuration files to:

/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc

you must then create the symlink as explained previously but adjust it to use 
different name for tool chain on MacOS X 10.9. Thus:

cd /Applications/Xcode.app/Contents/Developer/Toolchains/
sudo ln -s XcodeDefault.xctoolchain OSX10.9.xctoolchain

So long as apxs configuration is left as the defaults and not touched, that 
should be all that is required.

BTW, you previously quoted:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/usr/share/apr-1/build-1/libtool --silent --mode=compile 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin    -DDARWIN ….

Was that a bad cut and paste as it is broken in a couple of ways? Specifically 
lib tool path is bogus and 'cc' is missing on end of compiler path.

Original comment by Graham.Dumpleton@gmail.com on 17 Feb 2014 at 11:30

GoogleCodeExporter commented 9 years ago
Thanks. That seem to work but apache header files is not in /usr/include like 
unix distribution. 

So,

/usr/sbin/apxs -c 
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -Wc,'-arch x86_64' 
mod_wsgi.c -Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error 
/System/Library/Frameworks/  -arch x86_64 -ldl  -framework CoreFoundation  
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc/usr/share/apr-1/build-1/libtool --silent --mode=compile 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc    -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I/usr/local/include 
-I/usr/include/apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  -arch 
x86_64 
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -c -o mod_wsgi.lo 
mod_wsgi.c && touch mod_wsgi.slo
mod_wsgi.c:34:10: fatal error: 'httpd.h' file not found
#include "httpd.h"
         ^
1 error generated.
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1

I'm trying to get src of apache downloaded and compile that in mac. Is there 
another way? I have run root level find for apache include files couldn't find 
it. I shall download apache and see whether it compiles. 

BTW, Mac OS X server distributes mod-wsgi with very little documentation on how 
to get started. Is there any docs other than the PEP 333. 

Regards, Madhu 

Original comment by madhuses...@gmail.com on 21 Feb 2014 at 9:09

GoogleCodeExporter commented 9 years ago
The Apache header files are located under /usr/include/apache2 and the APR 
headers files under /usr/include/apr-1. The compiler line has -I directories 
for them. If you do not have those directories, then your operating system 
installation has somehow been mucked up. Ensure you have the latest Xcode 
version and that those directories exist.

I have no issues under 10.9.1 with only that symlink. I even have a solution 
now that doesn't even require the symlink be added, but that still will not 
help if for some reason the Apache headers have been removed from where they 
are supposed to be.

Original comment by Graham.Dumpleton@gmail.com on 21 Feb 2014 at 9:35

GoogleCodeExporter commented 9 years ago
Thanks. I still don't have .so file but I have provided the listing. 

madhu$ make
/usr/sbin/apxs -c 
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -Wc,'-arch x86_64' 
mod_wsgi.c -Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error 
/System/Library/Frameworks/  -arch x86_64 -ldl  -framework CoreFoundation  
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc/usr/share/apr-1/build-1/libtool --silent --mode=compile 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc    -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I/usr/local/include 
-I/usr/include/apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  -arch 
x86_64 
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -c -o mod_wsgi.lo 
mod_wsgi.c && touch mod_wsgi.slo
mod_wsgi.c:9375:23: warning: using the result of an assignment as a condition 
without parentheses
      [-Wparentheses]
            if (value = apr_table_get(r->notes, "mod_wsgi.process_group"))
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_wsgi.c:9375:23: note: place parentheses around the assignment to silence 
this warning
            if (value = apr_table_get(r->notes, "mod_wsgi.process_group"))
                      ^
                (                                                        )
mod_wsgi.c:9375:23: note: use '==' to turn this assignment into an equality 
comparison
            if (value = apr_table_get(r->notes, "mod_wsgi.process_group"))
                      ^
                      ==
mod_wsgi.c:9377:23: warning: using the result of an assignment as a condition 
without parentheses
      [-Wparentheses]
            if (value = apr_table_get(r->notes, "mod_wsgi.application_group"))
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_wsgi.c:9377:23: note: place parentheses around the assignment to silence 
this warning
            if (value = apr_table_get(r->notes, "mod_wsgi.application_group"))
                      ^
                (                                                            )
mod_wsgi.c:9377:23: note: use '==' to turn this assignment into an equality 
comparison
            if (value = apr_table_get(r->notes, "mod_wsgi.application_group"))
                      ^
                      ==
mod_wsgi.c:9379:23: warning: using the result of an assignment as a condition 
without parentheses
      [-Wparentheses]
            if (value = apr_table_get(r->notes, "mod_wsgi.callable_object"))
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_wsgi.c:9379:23: note: place parentheses around the assignment to silence 
this warning
            if (value = apr_table_get(r->notes, "mod_wsgi.callable_object"))
                      ^
                (                                                          )
mod_wsgi.c:9379:23: note: use '==' to turn this assignment into an equality 
comparison
            if (value = apr_table_get(r->notes, "mod_wsgi.callable_object"))
                      ^
                      ==
mod_wsgi.c:9382:23: warning: using the result of an assignment as a condition 
without parentheses
      [-Wparentheses]
            if (value = apr_table_get(r->notes,
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
mod_wsgi.c:9382:23: note: place parentheses around the assignment to silence 
this warning
            if (value = apr_table_get(r->notes,
                      ^
mod_wsgi.c:9382:23: note: use '==' to turn this assignment into an equality 
comparison
            if (value = apr_table_get(r->notes,
                      ^
                      ==
mod_wsgi.c:9403:23: warning: using the result of an assignment as a condition 
without parentheses
      [-Wparentheses]
            if (value = entry->process_group)
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
mod_wsgi.c:9403:23: note: place parentheses around the assignment to silence 
this warning
            if (value = entry->process_group)
                      ^
                (                           )
mod_wsgi.c:9403:23: note: use '==' to turn this assignment into an equality 
comparison
            if (value = entry->process_group)
                      ^
                      ==
mod_wsgi.c:9405:23: warning: using the result of an assignment as a condition 
without parentheses
      [-Wparentheses]
            if (value = entry->application_group)
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
mod_wsgi.c:9405:23: note: place parentheses around the assignment to silence 
this warning
            if (value = entry->application_group)
                      ^
                (                               )
mod_wsgi.c:9405:23: note: use '==' to turn this assignment into an equality 
comparison
            if (value = entry->application_group)
                      ^
                      ==
mod_wsgi.c:9408:23: warning: using the result of an assignment as a condition 
without parentheses
      [-Wparentheses]
            if (value = entry->pass_authorization) {
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_wsgi.c:9408:23: note: place parentheses around the assignment to silence 
this warning
            if (value = entry->pass_authorization) {
                      ^
                (                                )
mod_wsgi.c:9408:23: note: use '==' to turn this assignment into an equality 
comparison
            if (value = entry->pass_authorization) {
                      ^
                      ==
7 warnings generated.
/usr/share/apr-1/build-1/libtool --silent --mode=link 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc -o mod_wsgi.la  -rpath /usr/libexec/apache2 -module -avoid-version    
mod_wsgi.lo -Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error 
/System/Library/Frameworks/ -arch x86_64 -ldl -framework CoreFoundation
warning: no debug symbols in executable (-arch x86_64)
Madhukumars-MacBook-Air:mod_wsgi-3.4 madhu$ ls
LICENCE         configure       mod_wsgi.lo     posix-ap2X.mk.in
Makefile        configure.ac        mod_wsgi.o      win32-ap22py26.mk
Makefile.in     mod_wsgi.c      mod_wsgi.slo        win32-ap22py27.mk
README          mod_wsgi.la     posix-ap1X.mk.in    win32-ap22py31.mk

Original comment by madhuses...@gmail.com on 22 Feb 2014 at 8:15

GoogleCodeExporter commented 9 years ago
Which looks correct. The results are in the .libs subdirectory. If you were to 
use 'sudo make install' it will install the .so file in the Apache modules 
directory.

Original comment by Graham.Dumpleton@gmail.com on 22 Feb 2014 at 9:04

GoogleCodeExporter commented 9 years ago
Thanks! It was very helpful 

Original comment by madhuses...@gmail.com on 4 Mar 2014 at 6:01

GoogleCodeExporter commented 9 years ago
Wish we can wrap this but mske install errors out. 

sh-3.2# make install
mkdir -p 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc/usr/libexec/apache2
mkdir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bi
n/cc/usr/libexec/apache2: Not a directory
make: *** 
[/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/b
in/cc/usr/libexec/apache2] Error 1

Is there any documentation other than Pep 333 which provides a sample .py?

Original comment by madhuses...@gmail.com on 4 Mar 2014 at 7:32

GoogleCodeExporter commented 9 years ago
There is still something broken in your operating system configuration files 
for apxs etc from whatever changes you made and then tried to revert.

What are the DESTDIR and LIBEXECDIR settings from the Makefile?

What do yo get from running:

apxs -q LIBEXECDIR

What do you get from running :

env | grep DESTDIR

The settings in the Makefile on MacOS X 10.9 should be:

DESTDIR =
LIBEXECDIR = /usr/libexec/apache2

For some reason, due to the changes you have been making they don't appear to 
be set to this.

After you made your changes, did you go back and do a:

make distclean

in the source code and rerun 'configure'.

If you didn't you likely didn't replace the Makefile with one which used the 
correct configuration.

As far as WSGI samples, don't use raw WSGI. Go use a simple framework such as 
Flask to get started.

Original comment by Graham.Dumpleton@gmail.com on 4 Mar 2014 at 8:45

GoogleCodeExporter commented 9 years ago
Closing this as don't deem there is anything to do. Version 4.X of mod_wsgi 
greatly improves the build experience for MacOS X and accommodates for fact 
that Apple breaks their apxs configuration.

Original comment by Graham.Dumpleton@gmail.com on 16 Sep 2014 at 6:48