apm-agent-php icon indicating copy to clipboard operation
apm-agent-php copied to clipboard

Fixed building error on Mac OS

Open SergeyKleyman opened this issue 3 years ago • 5 comments

Closes #308

SergeyKleyman avatar Apr 12 '21 09:04 SergeyKleyman

This does not build on OSX still.

In file included from /tmp/apm-agent-php/src/ext/ConfigManager.c:33:
In file included from ./elastic_apm_alloc.h:28:
./platform.h:24:17: fatal error: 'features.h' file not found
#       include <features.h>
                ^~~~~~~~~~~~

GCC is installed, hence the issue I would assume.

try ifndef __APPLE__ perhaps? The issue is this is not the only build error. The sys/sysinfo.h stuff also fails after this one is fixed as that also doesn't exist on osx.

dangoscomb avatar Apr 12 '21 10:04 dangoscomb

:green_heart: Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-12-29T10:20:19.823+0000

  • Duration: 47 min 51 sec

Test stats :test_tube:

Test Results
Failed 0
Passed 15907
Skipped 0
Total 15907

:green_heart: Flaky test report

Tests succeeded.

:robot: GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

apmmachine avatar Apr 12 '21 10:04 apmmachine

@dangoscomb Hi. Did you have a chance to test the latest update (i.e., with ! defined( __APPLE__ )) to this PR?

SergeyKleyman avatar May 03 '21 11:05 SergeyKleyman

Hi

I have not, however I did it this way:

https://github.com/dangoscomb/apm-agent-php/tree/osx-build

As mentioned in the issue it builds but I have not yet tested it works properly. Have you considered a build and test on a GitHub action running on OSX?

dangoscomb avatar May 05 '21 08:05 dangoscomb

Latest version still has an error compiling. Would be nice to have this compiling an a Mac.

./TextOutputStream.h:47:33: error: redefinition of typedef 'TextOutputStream' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct TextOutputStream TextOutputStream;
                                ^
./elastic_apm_assert.h:210:33: note: previous definition is here
typedef struct TextOutputStream TextOutputStream;
                                ^
2 errors generated.
make: *** [AST_instrumentation.lo] Error 1

using home-brew installed php and build tools:

gcc -v
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.4.0
Thread model: posix

webpatser avatar Apr 28 '22 14:04 webpatser

run docs-build

v1v avatar Feb 09 '24 08:02 v1v

We will close it for now as it has low priority. We can always can back to MacOS build in future.

intuibase avatar Mar 12 '24 09:03 intuibase