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

Document zlib install #113

Merged
merged 10 commits into from
Sep 1, 2023
Merged

Document zlib install #113

merged 10 commits into from
Sep 1, 2023

Conversation

mnapoli
Copy link
Member

@mnapoli mnapoli commented Aug 31, 2023

Follow-up for #110

# We compile a newer version because Lambda uses an old version (1.2.7) that
# has a security vulnerability (CVE-2022-37434).
# See https://github.com/brefphp/aws-lambda-layers/pull/110
# Can be removed once Lambda updates their version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they ever will, for BC reasons. We'll likely have to wait till Lambda gets AL 2023, if that ever happens. ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GrahamCampbell yep these are my notes for AL2023 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason you used the HTTP URL and not HTTPS?

I'm trying to debug why the build is failing now… The HTTPS Url worked fine for me, I assumed it was all the same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied this from bref v1. I didn't notice the http/s.

@@ -80,7 +80,7 @@ ENV VERSION_ZLIB=1.3
ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib
RUN set -xe; \
mkdir -p ${ZLIB_BUILD_DIR}; \
curl -Ls https://zlib.net/zlib-${VERSION_ZLIB}.tar.xz \
curl -Ls http://zlib.net/zlib-${VERSION_ZLIB}.tar.xz \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could try https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.gz instead?

RUN set -xe; \
mkdir -p ${ZLIB_BUILD_DIR}; \
# Download and upack the source code
curl -Ls http://zlib.net/zlib-${VERSION_ZLIB}.tar.xz \
curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.gz \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, whoops. that is .gz, but the extract command expends .xz

RUN set -xe; \
make distclean \
&& CFLAGS="" \
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
./configure \
--prefix=${INSTALL_DIR} \
--64
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GrahamCampbell I removed this line (after reading madler/zlib#143) at it seemed to do the trick. Do you see any reason to be worried?

If not I'll merge and release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeh, I think i did something similar when making vapor work with arm. This is fine. 👍

Copy link
Contributor

@GrahamCampbell GrahamCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finishing off my jank.

| tar xJC ${ZLIB_BUILD_DIR} --strip-components=1

# Move into the unpackaged code directory
curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.gz \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also just use the .tar.xz version of this URL, to keep the extract command the same.

@mnapoli mnapoli merged commit fcd306b into main Sep 1, 2023
9 checks passed
@mnapoli mnapoli deleted the document-zlib-install branch September 1, 2023 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants