Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No more src folder in 1.9.1 tar.gz #1029

Closed
doyelese opened this issue Jul 19, 2023 · 17 comments
Closed

No more src folder in 1.9.1 tar.gz #1029

doyelese opened this issue Jul 19, 2023 · 17 comments
Assignees
Labels
agent-php bug Something isn't working triaged
Milestone

Comments

@doyelese
Copy link

doyelese commented Jul 19, 2023

The 1.9.1 tar.gz does not contain a src folder rendering the build from source instructions invalid

https://www.elastic.co/guide/en/apm/agent/php/current/setup.html#build-from-source

@doyelese doyelese added the bug Something isn't working label Jul 19, 2023
@maclonghorn
Copy link

Looks like this was removed with commit: 13e8b0b
My builds are now failing. I'm going to specify the tag: v1.9.0

@coding-bunny
Copy link

Ran into the same problem with our docker builds.
Please update the official documentation on how to build from source or fix this.

@doyelese
Copy link
Author

Ran into the same problem with our docker builds. Please update the official documentation on how to build from source or fix this.

Our commands to get it working if you're interested or stuck

COPY apm-agent-php-1.9.1.tar.gz /etc/apm-agent/apm-agent-php-1.9.1.tar.gz
RUN cd /etc/apm-agent/ \
    && tar -xf apm-agent-php-1.9.1.tar.gz \
    && cd apm-agent-php-1.9.1/agent/native/ext \
    && phpize \
    && CFLAGS="-std=gnu99" ./configure --enable-elastic_apm \
    && make clean \
    && make \
    && make install

@intuibase intuibase self-assigned this Jul 25, 2023
@doyelese
Copy link
Author

Ran into the same problem with our docker builds. Please update the official documentation on how to build from source or fix this.

Our commands to get it working if you're interested or stuck

COPY apm-agent-php-1.9.1.tar.gz /etc/apm-agent/apm-agent-php-1.9.1.tar.gz
RUN cd /etc/apm-agent/ \
    && tar -xf apm-agent-php-1.9.1.tar.gz \
    && cd apm-agent-php-1.9.1/agent/native/ext \
    && phpize \
    && CFLAGS="-std=gnu99" ./configure --enable-elastic_apm \
    && make clean \
    && make \
    && make install

Actually this doesn't work, we are reverting to previous install method as this will let the elastic-apm show up in PHP modules but our elastic application stopped reporting to APM

@intuibase intuibase added this to the 8.10 milestone Jul 31, 2023
intuibase added a commit to intuibase/apm-agent-php that referenced this issue Jul 31, 2023
@intuibase
Copy link
Contributor

Hey @doyelese @maclonghorn @coding-bunny

I have updated documentation in this pull request

Can you follow new steps and check if it helped?

Best regards,
Pawel

@coding-bunny
Copy link

Doesn't seem to work for me.
Our Dockerfile does the following:

RUN mkdir -p /home/apm-agent && \
    cd /home/apm-agent && \
    git clone https://github.com/elastic/apm-agent-php.git apm && \
    cd apm && \
    /usr/local/bin/phpize CFLAGS="-std=gnu99" && \
    BUILD_ARCHITECTURE=linux-x86-64 make -f .ci/Makefile build && \
    PHP_CONFIG=php-config sudo cp agent/native/_build/${BUILD_ARCHITECTURE}-release/ext/elastic_apm-`$PHP_CONFIG --phpapi`.so `$PHP_CONFIG --extension-dir`

And since i am not familiar with PHP or the tooling used in this case, I don't know what to fix to make this work the way it did before.

@intuibase
Copy link
Contributor

intuibase commented Aug 22, 2023

Hi @coding-bunny

The problem with your script is that you need to remove old style build command and keep it like this:

RUN mkdir -p /home/apm-agent && \
    cd /home/apm-agent && \
    git clone https://github.com/elastic/apm-agent-php.git apm && \
    cd apm && \
    BUILD_ARCHITECTURE=linux-x86-64 make -f .ci/Makefile build && \
    PHP_CONFIG=php-config sudo cp agent/native/_build/${BUILD_ARCHITECTURE}-release/ext/elastic_apm-`$PHP_CONFIG --phpapi`.so `$PHP_CONFIG --extension-dir`

but the problem here is that you're trying to run docker container inside docker container. You can bypass that by mounting docker socket, but it is tricky.

It will make more sense to build agent on the host you're building (or starting) your docker image and simply use Dockerfile ADD/COPY command to put agent files into container filesystem.

Latest build from source instruction can be found here:
https://www.elastic.co/guide/en/apm/agent/php/master/setup.html#build-from-source

@alexbaileyuk
Copy link

This has also tripped us up today simply attempting to build for ARM.

Given that we would like to build the extension for ARM using this process, does Elastic provide an ARM version of this image elasticobservability/apm-agent-php-dev:native-build-gcc-12.2.0-linuxmusl-x86-64-0.0.2

@intuibase
Copy link
Contributor

Hey @alexbaileyuk

Do you need aarch64v8 Alpine musl or glibc build?

Best regards,
Pawel

@alexbaileyuk
Copy link

@intuibase Alpine musl version please

@intuibase
Copy link
Contributor

Hi @alexbaileyuk
I started working on that, will update you soon.
You can track progress in this issue #564

Regards,
Pawel

@intuibase
Copy link
Contributor

intuibase commented Sep 18, 2023

@alexbaileyuk you can try building Alpine aarch64 version with latest 1.10.0 release. You can follow https://github.com/intuibase/apm-agent-php/blob/main/DEVELOPMENT.md or just compile it with:

## To compile the library for all supported PHP releases for musl libc Linux distributions for aarch64 (ARMv8) architecture. This build is not officially supported.
BUILD_ARCHITECTURE=linuxmusl-arm64 make -f .ci/Makefile build

@alexbaileyuk
Copy link

@alexbaileyuk you can try building Alpine aarch64 version with laters 1.10.0 release. You can follow https://github.com/intuibase/apm-agent-php/blob/main/DEVELOPMENT.md or just compile it with:

## To compile the library for all supported PHP releases for musl libc Linux distributions for aarch64 (ARMv8) architecture. This build is not officially supported.
BUILD_ARCHITECTURE=linuxmusl-arm64 make -f .ci/Makefile build

Thanks. I'll give that a go later this week. Do you ever plan to make it officially supported?

@intuibase
Copy link
Contributor

Hey @alexbaileyuk

We are considering official support for ARM. The problem here is the lack of github support for this architecture.

@intuibase
Copy link
Contributor

Hey @doyelese @coding-bunny

Have you tried building agent in the latest version (v1.10.0) ?

@intuibase intuibase modified the milestones: 8.10, 8.11 Sep 22, 2023
@coding-bunny
Copy link

I have not, simply not a priority at the moment for us.
Will try to get back to this when I can.

@intuibase intuibase modified the milestones: 8.11, 8.12 Oct 3, 2023
@intuibase
Copy link
Contributor

I'm closing it now. Please try it out and reopen if it will fail to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-php bug Something isn't working triaged
Projects
Status: Done
Development

No branches or pull requests

5 participants