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

Adjust Ubuntu related patches to build 5.7.1 #149

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

mz2
Copy link

@mz2 mz2 commented Dec 6, 2022

I noticed the work done to make Deb packages for 5.7.1 on the main branch is only partial: it got mentioned somewhere, but the changelog entry didn't note 5.7.1 so the package was attempted to be built with the old 5.6.2 as its name, and some further patching seems to be necessary to make this package build work on 5.7.1 in the first place?

I am unable to get the build passing in the current state though, posting the current error message into the comment thread on this draft PR in follow-up.

@mz2
Copy link
Author

mz2 commented Dec 6, 2022

With these changes, build is still not succeeding at least on amd64 (effect looks to be the same with and without the skip-build-benchmarks so I am not sure I have in that case identified the correct change to the build preset)? Without the skip-early-swift-driver change to the build.ini, a similar error I see with the build script on Jammy and Focal both with 5.7.1 shows up.

The following shows up right after "Building benchmarks" (which I thought I had disabled with the skip-build-benchmarks?):

  File "/tmp/swift-deb-builder/swiftlang-5.7.1/swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 791, in execute_product_build_steps
    product.build(host_target)
  File "/tmp/swift-deb-builder/swiftlang-5.7.1/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py", line 49, in build
    run_build_script_helper(host_target, self, self.args)
  File "/tmp/swift-deb-builder/swiftlang-5.7.1/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py", line 123, in run_build_script_helper
    toolchain_path = _get_toolchain_path(host_target, product, args)
  File "/tmp/swift-deb-builder/swiftlang-5.7.1/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py", line 107, in _get_toolchain_path
    if swiftpm.SwiftPM.has_cross_compile_hosts(args):
  File "/tmp/swift-deb-builder/swiftlang-5.7.1/swift/utils/swift_build_support/swift_build_support/products/product.py", line 248, in has_cross_compile_hosts
    return self.args.cross_compile_hosts
AttributeError: 'Namespace' object has no attribute 'args'
ERROR: command terminated with a non-zero exit status 1, aborting

make[1]: *** [debian/rules:71: override_dh_auto_build] Error 1
make[1]: Leaving directory '/tmp/swift-deb-builder/swiftlang-5.7.1'
make: *** [debian/rules:19: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -sa failed

@MaxDesiatov MaxDesiatov changed the title Adjusts Ubuntu related patches to build 5.7.1 Adjust Ubuntu related patches to build 5.7.1 Dec 6, 2022
@@ -4,7 +4,7 @@ debversion=5.7.1

swift_version=5.7.1-RELEASE
icu_version=65-1
yams_version=4.0.2
yams_version=5.0.1
Copy link
Author

Choose a reason for hiding this comment

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

This looks to be the version used by 5.7.1?

@tomerd
Copy link
Contributor

tomerd commented Dec 21, 2022

cc @shahmishal - could we work with @mz2 to get these functional again + add them to regular CI runs (along side RPMs) so they do not regress?

@shahmishal
Copy link
Member

cc @shahmishal - could we work with @mz2 to get these functional again + add them to regular CI runs (along side RPMs) so they do not regress?

Yes, looks like most of the patch don't cleanly apply to 5.7 releases.

I will see if build system team can help upstream these.

@mz2
Copy link
Author

mz2 commented Dec 21, 2022

@shahmishal, @tomerd awesome, thanks! I forgot to note here in a further comment that I resolved that toolchain benchmark related build fail with a further tweak to the patch (more info at https://forums.swift.org/t/how-to-build-the-5-7-1-toolchain-in-swift-org-release-like-archive-layout-on-ubuntu-20-04-or-22-04/61837/4).

I'll be very happy to help make further changes as needed. At least the changelog file needs cleaning up, I notice.

Since putting this branch together I have also started working on a separate branch in my fork of this repo with which I built, for both arm64 and amd64 the Swift 5.7.2 package over at https://launchpad.net/~mz2/+archive/ubuntu/swiftlang, also making some quick & dirty changes to make the filesystem layout (at least technically) compatible with Ubuntu conventions. No further source patches were needed for 5.7.2, which is nice, but the more notable change I'm working on there is building instead of a binary package a source package (which is then built into a binary deb on Launchpad infrastructure, which allows building it into a ppa, or indeed into a Universe package later I hope). I'll follow up on the forum + as a separate PR for more info on that once that's ready.

@shahmishal
Copy link
Member

shahmishal commented Dec 30, 2022

Thanks @mz2 for working on the Debs packages!

Looks like you are making good progress -- https://forums.swift.org/t/how-to-build-the-5-7-1-toolchain-in-swift-org-release-like-archive-layout-on-ubuntu-20-04-or-22-04/61837/8

Let me know if you have any questions, and also when this PR is ready for review.

@mz2
Copy link
Author

mz2 commented Jan 1, 2023

I didn't end up updating this PR yet because I ended up instead finishing the alternative route I was exploring that I mention above, now available at #162 for review.

It probably makes sense to close this draft PR, and for you to review that other one, potentially skipping the 5.7.1 changes here altogether (I updated the patches for 5.7.2 in that other PR beside other changes).

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.

3 participants