Skip to content

Conversation

@am11
Copy link
Member

@am11 am11 commented Jul 29, 2022

We were using 2020Q1 repository to build illumos rootfs, which has older version of packages. To obtain newer versions, we need to either update the fixed repository reference in the URL each time we want a newer version, or use trunk as a floating reference and lookup the latest version of packages available in the manifest.

This PR switches the repository branch to trunk and looks up the package version by scraping the index page (HTML) and finding the latest version of archives we need.

I have used this approach for two reasons:

  • the fixed branches are sometimes old. Today we wanted zlib v1.2.12 which is only available in trunk branch.
  • to match how we download latest versions of packages on other platforms supported by this script.

cc @GrabYourPitchforks

wget "$BaseUrl"/"$package".tgz
ar -x "$package".tgz
tar --skip-old-files -xzf "$package".tmp.tgz -C "$__RootfsDir" 2>/dev/null
tar --skip-old-files -xzf "$package".tmp.tg* -C "$__RootfsDir" 2>/dev/null
Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason, icu in trunk branch has .tmp.tg instead of .tmp.tgz, while other packages have .tmp.tgz. Therefore I have used the glob.

ps - this script is only used in docker builder (https://github.com/dotnet/dotnet-buildtools-prereqs-docker), so it doesn't need to be resilient or portable).

Copy link
Member

Choose a reason for hiding this comment

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

The odd bit is

image

This one is giving me a tmp.tgz at https://pkgsrc.joyent.com/packages/SmartOS/trunk/x86_64/All/icu-71.1.tgz in 7zip. Do you know what version it was fetching before? Looks like ar is seeing the inner stream name as .tg

hoyosjs
hoyosjs previously approved these changes Aug 3, 2022
Copy link
Member

@hoyosjs hoyosjs left a comment

Choose a reason for hiding this comment

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

Given that Illumos is an unsupported OS on .NET, I am not sure what customers depend on this or who validates that the resulting runtime works correctly. The change looks sane, but have you had a chance to check it doesn't regress support? For example, I see openssl1.1.1n. I see it being potentially brittle with there being 2 mit-krb5 prefixed packages in the repo. The main one is 1.18.4. There's also zlib 1.2.12 and icu 71 which we should support.

for package in "${array[@]}"; do
echo "Installing $package..."
echo "Installing '$package'"
package="$(grep ">$package" All | head -1 | sed -En 's/.*href="(.*)\.tgz".*/\1/p')"
Copy link
Member

Choose a reason for hiding this comment

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

grep maybe with $package-[0-9] to avoid things like mit-krb5-app-<ver> over mit-krb5-<ver>

Copy link
Member Author

@am11 am11 Aug 3, 2022

Choose a reason for hiding this comment

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

head -1 is there to filter out the unneeded ones. Can use [0-9]. End result is the same..

Copy link
Member

Choose a reason for hiding this comment

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

I meant mostly that order of entries maters with the head scheme. Mostly wanted to be resilient to that.

@am11
Copy link
Member Author

am11 commented Aug 3, 2022

who validates that the resulting runtime works correctly.

So far I am doing it.

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

@wfurt wfurt merged commit 4900886 into dotnet:main Aug 12, 2022
@am11 am11 deleted the levib/zlib branch August 12, 2022 20:46
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