-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-126623: Update libexpat to 2.6.4, make future updates easier #126792
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update libexpat to 2.6.4, make future updates easier
- Loading branch information
commit 1e8a6fbc9da56d738426874e8be91f81f1519a16
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Security/2024-11-13-11-09-12.gh-issue-126623.TO7NnR.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Upgrade libexpat to 2.6.4 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Use this script to update libexpat | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then | ||
echo "A bash version >= 4 required. Got: $BASH_VERSION" >&2 | ||
exit 1 | ||
fi | ||
|
||
# Update this when updating to a new version after verifying that the changes | ||
# the update brings in are good. These values are used for verifying the SBOM, too. | ||
expected_libexpat_tag="R_2_6_4" | ||
expected_libexpat_version="2.6.4" | ||
expected_libexpat_sha256="fd03b7172b3bd7427a3e7a812063f74754f24542429b634e0db6511b53fb2278" | ||
|
||
expat_dir="$(realpath "$(dirname -- "${BASH_SOURCE[0]}")")" | ||
cd ${expat_dir} | ||
|
||
# Step 1: download and copy files | ||
curl --location "https://github.com/libexpat/libexpat/releases/download/${expected_libexpat_tag}/expat-${expected_libexpat_version}.tar.gz" > libexpat.tar.gz | ||
echo "${expected_libexpat_sha256} libexpat.tar.gz" | sha256sum --check | ||
|
||
# Step 2: Pull files from the libexpat distribution | ||
declare -a lib_files | ||
lib_files=( | ||
ascii.h | ||
asciitab.h | ||
expat.h | ||
expat_external.h | ||
iasciitab.h | ||
internal.h | ||
latin1tab.h | ||
nametab.h | ||
siphash.h | ||
utf8tab.h | ||
winconfig.h | ||
xmlparse.c | ||
xmlrole.c | ||
xmlrole.h | ||
xmltok.c | ||
xmltok.h | ||
xmltok_impl.c | ||
xmltok_impl.h | ||
xmltok_ns.c | ||
) | ||
for f in "${lib_files[@]}"; do | ||
tar xzvf libexpat.tar.gz "expat-${expected_libexpat_version}/lib/${f}" --strip-components 2 | ||
done | ||
rm libexpat.tar.gz | ||
|
||
# Step 3: Add the namespacing include to expat_external.h | ||
sed -i 's/#define Expat_External_INCLUDED 1/&\n\n\/* Namespace external symbols to allow multiple libexpat version to\n co-exist. \*\/\n#include "pyexpatns.h"/' expat_external.h | ||
|
||
echo "Updated; verify all is okay using git diff and git status." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this so we have an easier anchor point for
sed
.