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

add terminfo-db to FreeBSD package requirements #7588

Merged
merged 5 commits into from
Jul 30, 2021
Merged

add terminfo-db to FreeBSD package requirements #7588

merged 5 commits into from
Jul 30, 2021

Conversation

Thefrank
Copy link
Contributor

@Thefrank Thefrank commented Jul 4, 2021

* runtime can use terminfo under FreeBSD but only with this additional package
* from feedback: dotnet/runtime#55152 (comment)
@am11
Copy link
Member

am11 commented Jul 4, 2021

Thank you! 😎

Yes we can rev the FreeBSD OS version in arcade which are EOL. For the next major version, we would need to clone this directory https://github.com/dotnet/dotnet-buildtools-prereqs-docker/tree/main/src/ubuntu/18.04/cross/freebsd/12 (note some files in that dir are symlinks).

To pick up these changes in runtime CI, we would need to wait for the next tag in https://github.com/dotnet/versions/blob/main/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-main.json, then update these files: https://github.com/dotnet/runtime/search?q=ubuntu+cross+freebsd+extension%3Ayml with that latest tag.

(few moving parts, but it usually doesn't take long to update the whole flow)

@Thefrank Thefrank marked this pull request as ready for review July 4, 2021 23:03
@Thefrank
Copy link
Contributor Author

Debating if I should close this request and open a new PR that would cover updates to https://github.com/dotnet/arcade/blob/main/eng/common/cross/build-rootfs.sh alongside the terminfo-db addition.

Are PR renames OK here? If yes, then I can add a few more FreeBSD changes to this PR and rename it to more broadly cover the changes.

FreeBSD11 really should get removed sooner rather than later and FreeBSD 12.1 should get bumped to 12.2

@am11
Copy link
Member

am11 commented Jul 12, 2021

You can modify the PR as you want.
I think keeping old versions in build-rootfs.sh is not as important than updating its consumer https://github.com/dotnet/dotnet-buildtools-prereqs-docker.

cc @janvorli, @wfurt, for thoughts on deprecating EOL versions of FreeBSD.

@wfurt
Copy link
Member

wfurt commented Jul 12, 2021

Yes, I think we can drop 11. The docker is mostly only used only to guard agains build regressions.
What ever we do we should make sure the images can still build as I think we reference the script from
https://github.com/dotnet/dotnet-buildtools-prereqs-docker/tree/main/src/ubuntu/18.04/cross/freebsd

via https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/main/src/ubuntu/build-scripts/build-rootfs.sh

@Thefrank Thefrank marked this pull request as draft July 29, 2021 06:06
@Thefrank
Copy link
Contributor Author

Thefrank commented Jul 29, 2021

back to draft while I work on FreeBSD 13 addition and ABI support
also lttng-ust removal requires merge of dotnet/runtime#56435 so this PR should not be merged until that happens anyways

edit: I also wanted to bump the pkg version to 1.16.0 but the one listed 1.12.0 is the newest that builds without errors under the current setup

edit2: was too hasty on removing lttng-ust. Thankfully, it is only lttng-ust and not lttng-tools as that has been removed from FreeBSD 13+ (broken)

from runtime:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  LTTNG
      linked by target "coreclrtraceptprovider" in directory runtime/src/coreclr/pal/src/eventprovider/lttngprovider

@am11
Copy link
Member

am11 commented Jul 29, 2021

Great, afaict, LTTng team seem pretty open to wide range of platform support. FreeBSD and other BSD-based OSes are supported per userspace-rcu's README https://github.com/urcu/userspace-rcu (which is the only special prerequisite of https://github.com/lttng/lttng-ust).

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM.
Let me know when you feel it is ready.

also: use -j $JOBS during build while we are here
@Thefrank
Copy link
Contributor Author

Long version of a very short commit:

I added support for FreeBSD 13 into the script, but from what I understand of what @am11 said, I will also need to add some files/paths/symlinks into https://github.com/dotnet/dotnet-buildtools-prereqs-docker/tree/main/src/ubuntu/18.04/cross/freebsd/ for the tools to generate a docker for FreeBSD 13. Ubuntu looks like it will have official support for public images of 18.04 until mid-2023 so it should be a pretty safe place for FreeBSD for now.

As for FreeBSD 11, it is scheduled for EOL on September 30 2021. I am leaving it here, untouched (still 11.3), as it is currently used in CI for runtime (maybe others?)
and
Moving CI to FreeBSD 12 looks like it requires waiting for the docker update to 12.2 and then modifying a few yaml files in dotnet/runtime with the updated image.

Finally, ABI support is added so that 11 uses 11, 12 uses 12, and so forth. These are added as a variable; not extracted from the release version. I could not find any discussion on why the ABI was left at 11 even for 12 :(

[Massive thanks @am11 for the pointers on how all this fits together! 😎 ]

Nonblocking but annoying: version of pkg (1.12) is the newest that will build under the current system. Current is 1.16.3. This is not an issue as 11.3, 12.2, and 13.0 all are able to use it to download the packages they need on amd64. This is also pulled from GH and not the FreeBSD repo so there is less risk of it being removed due to age/EOL.

@Thefrank Thefrank marked this pull request as ready for review July 30, 2021 03:56
@Thefrank Thefrank requested a review from wfurt July 30, 2021 03:56
__FreeBSDPackages="libunwind"
__FreeBSDPackages+=" icu"
__FreeBSDPackages+=" libinotify"
__FreeBSDPackages+=" lttng-ust"
__FreeBSDPackages+=" krb5"
__FreeBSDPackages+=" terminfo-db"
Copy link
Member

Choose a reason for hiding this comment

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

Will this also work with freebsd11 ? This script is sucked in by the docker build process and I'm wondering if there is chance we break it.

If so, one option would be to first remove
https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/9458314c28f5c051299fc24f3cb602a113cfcf49/manifest.json#L553-L564

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, terminfo-db is found in the pkg repo for FreeBSD 11, 12, and 13.

https://www.freshports.org/misc/terminfo-db/

@wfurt wfurt merged commit 093cd72 into dotnet:main Jul 30, 2021
@Thefrank Thefrank deleted the freebsd-crossrootfs branch July 31, 2021 15:53
echo " for illumos can be: illumos."
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FReeBSD"
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FreeBSD"

Choose a reason for hiding this comment

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

This is not fully true for 12-STABLE and 13-STABLE. There are known issues with base clang, so lldb from ports gets pulled in for dependencies at the absolute minimum.

@@ -60,13 +60,15 @@ __AlpinePackages+=" krb5-dev"
__AlpinePackages+=" openssl-dev"
__AlpinePackages+=" zlib-dev"

__FreeBSDBase="12.1-RELEASE"
__FreeBSDBase="12.2-RELEASE"
__FreeBSDPkg="1.12.0"

Choose a reason for hiding this comment

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

We need to not define __FreeBSDPkg since this is still a fast moving target, or it needs to be >=1.17.0. 1.12.0 is way behind.

wget -O - https://download.freebsd.org/ftp/releases/amd64/${__FreeBSDBase}/base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version
# For now, ask for 11 ABI even on 12. This can be revisited later.
echo "ABI = \"FreeBSD:11:amd64\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf
echo "ABI = \"FreeBSD:${__FreeBSDABI}:amd64\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf

Choose a reason for hiding this comment

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

These settings are not aligned with pkgng documentation at this point. $REPO_AUTOUPDATE and $RUN_SCRIPTS are true/false. I would also recommend REPO_AUTOUPDATE = true; even with quarterly, to force security updates.

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.

4 participants