-
Notifications
You must be signed in to change notification settings - Fork 45
Update FreeBSD packaging script #443
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,23 @@ cd "$CURRENT_DIRECTORY" | |
SWIFT_VERSION="$("$SWIFT_TOOLCHAIN_HOME/bin/swift" --version | grep -Eo 'version [0-9.]+' | sed 's/version //')" | ||
echo "Swift version being packaged is $SWIFT_VERSION" | ||
|
||
# Get the currently installed version for all of the packages that we need. | ||
# This script assumes that it was run on the build machine and therefore | ||
# that the packages on this machine correspond to those Swift was built | ||
# against. | ||
get_package_version() | ||
{ | ||
echo "$(pkg info "$1" | grep Version | sed 's/Version.*: //')" | ||
} | ||
|
||
LIBUUID_PKG_VERSION=$(get_package_version libuuid) | ||
LIBFFI_PKG_VERSION=$(get_package_version libffi) | ||
LIBXML2_PKG_VERSION=$(get_package_version libxml2) | ||
MPDECIMAL_PKG_VERSION=$(get_package_version mpdecimal) | ||
PYTHON_PKG_VERSION=$(get_package_version python311) | ||
READLINE_PKG_VERSION=$(get_package_version readline) | ||
SQLITE3_PKG_VERSION=$(get_package_version sqlite3) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need SQLite? I thought we used swift-toolchain-sqlite now and thus do not need the system vended SQLite. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well the idea for swift-toolchain-sqlite is that it's for systems without a native package management system to provide sqlite... meaning Windows and Android. So far on Darwin we've been using the system SQLite and on Linux we've still been using the copy provided by the package manager... I expect it would make sense for FreeBSD to do the same as Linux here. |
||
|
||
# Create the manifest file. All fields below are required. pkg_create(3) | ||
# will add additional fields as part of generating the package. | ||
echo "Generating manifest..." | ||
|
@@ -93,32 +110,32 @@ cat > "$METADATA_STAGING/manifest" <<EOF | |
"maintainer": "[email protected]", | ||
"www": "https://www.swift.org", | ||
"deps": { | ||
"e2fsprogs-libuuid": { | ||
"version": "1.47.1", | ||
"origin": "misc/e2fsprogs-libuuid" | ||
"libuuid": { | ||
"version": "$LIBUUID_PKG_VERSION", | ||
"origin": "misc/libuuid" | ||
}, | ||
"libffi": { | ||
"version": "3.4.6", | ||
"version": "$LIBFFI_PKG_VERSION", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think libffi is needed only because of Python. I think we can just include the direct dependencies so the package manager can take care of the rest |
||
"origin": "devel/libffi" | ||
}, | ||
"libxml2": { | ||
"version": "2.11.9", | ||
"version": "$LIBXML2_PKG_VERSION", | ||
"origin": "textproc/libxml2" | ||
}, | ||
"mpdecimal": { | ||
"version": "4.0.0", | ||
"version": "$MPDECIMAL_PKG_VERSION", | ||
"origin": "math/mpdecimal", | ||
}, | ||
"python311": { | ||
"version": "3.11.11", | ||
"version": "$PYTHON_PKG_VERSION", | ||
"origin": "lang/python311" | ||
}, | ||
"readline": { | ||
"version": "8.2.13_2", | ||
"version": "$READLINE_PKG_VERSION", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is probably from Python too |
||
"origin": "devel/readline" | ||
}, | ||
"sqlite3": { | ||
"version": "3.46.1_1,1", | ||
"version": "$SQLITE3_PKG_VERSION", | ||
"origin": "databases/sqlite3" | ||
} | ||
} | ||
|
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.
This one I am weary about. Can we pin this to the exact version? I learnt that this library is not ABI stable and does not follow standard versioning practices. We are pinned to the exact version of libxml2 on Windows as there were ABI changes that break FoundationXML.
Uh oh!
There was an error while loading. Please reload this page.
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.
We've encountered this problem as well. I'd like Swift on FreeBSD to do a static link against this dependency, but @etcwilde would need to chime in as I don't think we can do static linking of the compiler.
Edit: It looks like the FreeBSD package repositories provide a
libxml2.a
alongside the dynamic libraries when you install the LibXML2 package. Perhaps it would be worth considering linking statically to that dependency on FreeBSD without statically linking the whole compiler.