Skip to content

No longer builds on OS X #52

Closed
Closed
@webbnh

Description

@webbnh

I do development for a variety of targets (mostly Docker-based). I do my actual deployment builds on Ubuntu, but it's been really handy to be able to do test builds in my local environment which is Mac OS X.

I just started setting up a new development environment, and I pulled fresh aws-lambda-cpp sources, and, I'm sad to report, they no longer build on OS X. The last time I pulled the code for aws-lambda-cpp was in March, and they built fine then. That was prior to the v0.2.0 changes for stack trace support.

I realize that that OS X is not quite Linux (i.e., it's Darwin, which I believe is a BSD derivative), and that aws-lambda-cpp is targeted at Linux. But, it would be really nice if I could at least build locally.

Looking at the aws-lambda-cpp source, I see what look like provisions for Darwin in include/backward.h, but they don't seem to be being used. Here's what I get when I try to build the current aws-lambda-cpp commit:

[ 20%] Building CXX object CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o
In file included from /Users/webb/URSA/aws-lambda-cpp/src/backward.cpp:26:
/Users/webb/URSA/aws-lambda-cpp/include/backward.h:188:22: fatal error: 
      'link.h' file not found
#            include <link.h>
                     ^~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o] Error 1
make[1]: *** [CMakeFiles/aws-lambda-runtime.dir/all] Error 2
make: *** [all] Error 2

I presume that this is because the compiler is being forced down the Linux path by line 46.

Commenting that line out and allowing the file to auto-detect the platform allows my build on OS X to get far enough to hit a complaint about converting size_t to an int in the invocation of backtrace_symbols() in TraceResolverDarwinImpl<>::load_stacktrace().

If I add the same typecast there which was added to TraceResolverLinuxImpl<>::load_stacktrace(), then the build completes.

Was there a reason for forcing the compilation down the Linux path? (E.g., does the auto-detection code not work reliably?) If not, would you be willing to accept a change to allow the code to build on OS X? (The two changes are trivial -- I could submit a pull request if you don't want to do them by hand.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions