Skip to content

Fix python3 six and make issue on Amazon Linux 2 #48

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 4 commits into from
Nov 1, 2021

Conversation

shahmishal
Copy link
Member

@shahmishal shahmishal commented Oct 21, 2021

---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE.
---------------------------------------------

@shahmishal shahmishal changed the title Fix python3 six issue on Amazon Linux 2 Fix python3 six and make issue on Amazon Linux 2 Oct 21, 2021
@shahmishal shahmishal requested a review from tomerd October 21, 2021 19:29
@shahmishal
Copy link
Member Author

@@ -32,6 +32,9 @@ cp patches/*.patch $HOME/rpmbuild/SOURCES/
pushd $HOME/rpmbuild/SPECS
# install all the dependencies needed to build Swift from the spec file itself
yum-builddep -y ./swiftlang.spec
# fix python six
mkdir -p /usr/local/lib/python3.7/site-packages/
easy_install-3.7 six
Copy link
Contributor

Choose a reason for hiding this comment

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

these workarounds should be done in the Docker file not the build_rpm.sh file. I did't notice that in one of the earlier PRs (centos 7?) so that needs to be moved as well

Copy link
Contributor

Choose a reason for hiding this comment

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

additionally if we are now building cmake from source, should we remove it from the "BuildRequires" list?

Copy link
Member Author

Choose a reason for hiding this comment

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

Dockerfile would not have the package installed at this point, we can move it to swiftlang.spec file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we should drop CMake from BuildRequires. I will create a new PR for that

Copy link
Contributor

@tomerd tomerd Oct 22, 2021

Choose a reason for hiding this comment

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

dockerfile does install the deps: https://github.com/apple/swift-installer-scripts/blob/main/platforms/Linux/amazonlinux/2/Dockerfile#L23

so it could and should be moved there

@futurejones
Copy link
Contributor

@tomerd @shahmishal
Can we get the issues section opened on this repository? Currently we have nowhere to post anything that isn't directly associated with an individual PR.

I have done some testing on the amazon linux rpm - swiftlang-5.5.0-1.amzn2.x86_64.rpm and there are some issues with dependencies(requires) that are preventing the package installing.

I also uploaded the package to a test repository which revealed some strange errors in the package requires and provides lists.

Requires
/bin/sh
/sbin/ldconfig
/sbin/ldconfig
/usr/bin/env
binutils
gcc
git
glibc-static
gzip
ld-linux-x86-64.so.2()(64bit)
ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)
libBlocksRuntime.so()(64bit)
libFoundation.so()(64bit)
libFoundationNetworking.so()(64bit)
libFoundationXML.so()(64bit)
libIndexStore.so.10git()(64bit)
libbsd
libc.so.6(GLIBC_2.17)(64bit)
libcurl
libcurl.so.4()(64bit)
libdispatch.so()(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libedit
libedit.so.0()(64bit)
libform.so.6()(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libgcc_s.so.1(GCC_3.3)(64bit)
libgcc_s.so.1(GCC_3.3.1)(64bit)
libicu
libicudataswift.so.65()(64bit)
libicui18nswift.so.65()(64bit)
libicuucswift.so.65()(64bit)
libllbuild.so()(64bit)
liblldb.so.10git()(64bit)
liblldb.so.10git(LLVM_10)(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libm.so.6(GLIBC_2.23)(64bit)
libncurses.so.6()(64bit)
libpanel.so.6()(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.12)(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libpthread.so.0(GLIBC_2.3.4)(64bit)
libpython3.7m.so.1.0()(64bit)
librt.so.1()(64bit)
librt.so.1(GLIBC_2.2.5)(64bit)
libsqlite
libsqlite3.so.0()(64bit)
libstdc++-static
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
libstdc++.so.6(CXXABI_1.3.1)(64bit)
libstdc++.so.6(CXXABI_1.3.11)(64bit)
libstdc++.so.6(CXXABI_1.3.3)(64bit)
libstdc++.so.6(CXXABI_1.3.5)(64bit)
libstdc++.so.6(CXXABI_1.3.7)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
libstdc++.so.6(GLIBCXX_3.4.11)(64bit)
libstdc++.so.6(GLIBCXX_3.4.14)(64bit)
libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
libstdc++.so.6(GLIBCXX_3.4.17)(64bit)
libstdc++.so.6(GLIBCXX_3.4.18)(64bit)
libstdc++.so.6(GLIBCXX_3.4.19)(64bit)
libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
libstdc++.so.6(GLIBCXX_3.4.22)(64bit)
libstdc++.so.6(GLIBCXX_3.4.9)(64bit)
libswiftCore.so()(64bit)
libswiftDispatch.so()(64bit)
libswiftGlibc.so()(64bit)
libswift_Concurrency.so()(64bit)
libtinfo.so.6()(64bit)
libutil.so.1()(64bit)
libuuid
libuuid.so.1()(64bit)
libuuid.so.1(UUID_1.0)(64bit)
libxml2
libxml2.so.2()(64bit)
libxml2.so.2(LIBXML2_2.4.30)(64bit)
libxml2.so.2(LIBXML2_2.5.7)(64bit)
libxml2.so.2(LIBXML2_2.5.8)(64bit)
libxml2.so.2(LIBXML2_2.5.9)(64bit)
libxml2.so.2(LIBXML2_2.6.0)(64bit)
libxml2.so.2(LIBXML2_2.6.18)(64bit)
libxml2.so.2(LIBXML2_2.6.23)(64bit)
libxml2.so.2(LIBXML2_2.6.8)(64bit)
libxml2.so.2(LIBXML2_2.7.3)(64bit)
libxml2.so.2(LIBXML2_2.9.1)(64bit)
libz.so.1()(64bit)
libz.so.1(ZLIB_1.2.0)(64bit)
tar
tzdata
Provides
libBlocksRuntime.so()(64bit)
libFoundation.so()(64bit)
libFoundationNetworking.so()(64bit)
libFoundationXML.so()(64bit)
libIndexStore.so.10git()(64bit)
libIndexStore.so.10git(LLVM_10)(64bit)
libPackageDescription.so()(64bit)
libPackagePlugin.so()(64bit)
libXCTest.so()(64bit)
lib_InternalSwiftScan.so()(64bit)
lib_InternalSwiftScan.so(LLVM_10)(64bit)
lib_InternalSwiftSyntaxParser.so()(64bit)
lib_InternalSwiftSyntaxParser.so(LLVM_10)(64bit)
libclang_rt.asan-x86_64.so()(64bit)
libclang_rt.dyndd-x86_64.so()(64bit)
libclang_rt.hwasan-x86_64.so()(64bit)
libclang_rt.memprof-x86_64.so()(64bit)
libclang_rt.scudo-x86_64.so()(64bit)
libclang_rt.scudo_minimal-x86_64.so()(64bit)
libclang_rt.ubsan_minimal-x86_64.so()(64bit)
libclang_rt.ubsan_standalone-x86_64.so()(64bit)
libdispatch.so()(64bit)
libicudataswift.so.65()(64bit)
libicui18nswift.so.65()(64bit)
libicuucswift.so.65()(64bit)
libllbuild.so()(64bit)
libllbuildSwift.so()(64bit)
liblldb.so.10git()(64bit)
liblldb.so.10git(LLVM_10)(64bit)
libsourcekitdInProc.so()(64bit)
libsourcekitdInProc.so(LLVM_10)(64bit)
libswiftCore.so()(64bit)
libswiftDemangle.so()(64bit)
libswiftDispatch.so()(64bit)
libswiftGlibc.so()(64bit)
libswiftRemoteMirror.so()(64bit)
libswiftSwiftOnoneSupport.so()(64bit)
libswift_Concurrency.so()(64bit)
libswift_Differentiation.so()(64bit)
swiftlang(x86-64) = 5.5.0-1.amzn2
swiftlang = 5.5.0-1.amzn2

These errors are also present in the centos 7 package and the swift-lang-5.5-1.el8.x86_64.rpm package provided by @tachoknight on the Fedora repository.

It seems to indicate a problem in the spec files setup.

@tachoknight
Copy link
Contributor

Sorry, but I'm missing what the errors are.

@futurejones
Copy link
Contributor

The Requires list should only list the additional packages (dependencies) that need to be installed.
e.g.

Requires
binutils
gcc
git
glibc-static
gzip
libbsd
libcurl
libedit
libicu
libsqlite3x
libstdc++-static
libuuid
libxml2
python3
tar
tzdata

The Provides list should only list the actual package being installed i.e. swiftlang.
Not all the internal libs e.g libBlocksRuntime.so()(64bit), libFoundation.so()(64bit) etc.

Provides
swiftlang(x86-64) = 5.5.0-1.amzn2
swiftlang = 5.5.0-1.amzn2

@tachoknight
Copy link
Contributor

tachoknight commented Oct 22, 2021

I'm confused; the spec file doesn't explicitly mention any of those files under "provides".

@futurejones
Copy link
Contributor

It looks like the requires and provides are automatically added in the build process and it sometimes picks up "private" packages which need to be filtered out.
https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/

@shahmishal
Copy link
Member Author

@futurejones

Can we get the issues section opened on this repository? Currently we have nowhere to post anything that isn't directly associated with an individual PR.

Currently for Swift Project, we are using bugs.swift.org. In the future, we are planning on switching over to GitHub Issues.

I have done some testing on the amazon linux rpm - swiftlang-5.5.0-1.amzn2.x86_64.rpm and there are some issues with dependencies(requires) that are preventing the package installing.

Thanks for testing the package! If you already know the fix can you put up a PR to resolve the issue?

@tomerd
Copy link
Contributor

tomerd commented Oct 22, 2021

I would love to switch to GH issues if possible

@tomerd
Copy link
Contributor

tomerd commented Oct 22, 2021

thanks for testing this @futurejones, do you know what the issue may be in the spec setup?

@compnerd
Copy link
Member

The Requires list should only list the additional packages (dependencies) that need to be installed. e.g.

Requires
binutils
gcc
git
glibc-static
gzip
libbsd
libcurl
libedit
libicu
libsqlite3x
libstdc++-static
libuuid
libxml2
python3
tar
tzdata

I think that gcc should be a BuildRequires only. Additionally, the libstdc++-static and glibc-static should be replaced with libstdc++ and glibc. The runtime dynamically links against the C/C++ runtime (and must in order to avoid any ODR). libbsd has not been needed for a while and should be dropped. libicu seems suspect - we provide our own ICU library builds. I wonder if we can tweak the build to statically link against sqlite, libxml2, uuid, and libcurl.

I think that we are including more runtimes than necessary (e.g. hwasan), and simultaneously under including files (e.g. the profile runtime).

@tomerd
Copy link
Contributor

tomerd commented Nov 1, 2021

I think that gcc should be a BuildRequires only. Additionally, the libstdc++-static and glibc-static should be replaced with libstdc++ and glibc. The runtime dynamically links against the C/C++ runtime (and must in order to avoid any ODR). libbsd has not been needed for a while and should be dropped. libicu seems suspect - we provide our own ICU library builds. I wonder if we can tweak the build to statically link against sqlite, libxml2, uuid, and libcurl.

I think that we are including more runtimes than necessary (e.g. hwasan), and simultaneously under including files (e.g. the profile runtime).

I'd be happy to see this list paired down if possible. less is better in this case. this list comes from our existing docker setup and iirc the -static variants are needed for static linking. @drexin could you chime in here or work with @compnerd to determine if anything should be removed?

@compnerd in any case, I think this PR can move forward?

@compnerd
Copy link
Member

compnerd commented Nov 1, 2021

Just to verify, cmake is being dropped because we build it and use it? If so, doing the rest subsequently SGTM.

@shahmishal
Copy link
Member Author

Correct, we are building CMake to make sure we have the latest version required for Swift build system.

@tachoknight
Copy link
Contributor

Correct, we are building CMake to make sure we have the latest version required for Swift build system.

Is this a new change in main? I've modified my spec file to build ninja so that BuildDependency is gone, but I don't see a recipe in the build-presets.ini that also builds CMake as well.

@shahmishal
Copy link
Member Author

This was added ~2 years back by @compnerd - swiftlang/swift#26301

@shahmishal
Copy link
Member Author

It would be a good to review all of the requirements in Dockerfiles and RPM spec file. Created an issue - https://bugs.swift.org/browse/SR-15418 to track the work.

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.

5 participants