dotnet / dotnet-buildtools-prereqs-docker

Used to maintain the Docker images hosted at the mcr.microsoft.com/dotnet-buildtools/prereqs image repository
MIT License
57 stars 103 forks source link

Builds are blocked due to build failure in FreeBSD Crossdeps Dockerfile #965

Closed lbussell closed 8 months ago

lbussell commented 8 months ago

The failing Dockerfile appears to be https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/main/src/cbl-mariner/2.0/cross/freebsd/13/amd64/Dockerfile

Link to failure: https://dev.azure.com/dnceng/internal/_build/results?buildId=2358065&view=logs&j=9aada89a-2e24-5acb-2807-6900158b9cce&t=6f3c41b4-0b5c-55eb-81af-364314aaa449&l=183124 [internal MSFT link]

 > [builder 2/2] RUN /scripts/eng/common/cross/build-rootfs.sh freebsd13 x64:
#7 85.13 install -m 644 completion/_pkg.bash /crossrootfs/x64/host/etc/bash_completion.d/
#7 85.13 install -m 644 completion/_pkg  /crossrootfs/x64/host/share/zsh/site-functions/
#7 85.13 make[1]: Leaving directory '/crossrootfs/x64/tmp/pkg-1.20.0/scripts'
#7 85.31 Updating FreeBSD repository catalogue...
#7 85.65 Fetching meta.conf: . done
#7 85.75 Fetching packagesite.pkg: .......... done
#7 86.29 pkg: Error opening the trusted directory /crossrootfs/x64/usr/share/keys/pkg/trusted
#7 86.29 pkg: Error loading trusted certificates
#7 86.30 Unable to update repository FreeBSD
#7 86.30 Error updating repositories!

/cc @wfurt @mthalman

wfurt commented 8 months ago

cc: @am11 @Thefrank

wfurt commented 8 months ago

Also it is curious that all the checks passed on t he PR...

am11 commented 8 months ago

Some intermittent issue which just started? We already have arm/amd64 tags for freebsd 13 and 14 for a few days now.

mthalman commented 8 months ago

This is the Dockerfile which is failing: https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/main/src/cbl-mariner/2.0/cross/freebsd/13/amd64/Dockerfile, which is cross build for FreeBSD based on Mariner.

Thefrank commented 8 months ago
#7 86.29 pkg: Error opening the trusted directory /crossrootfs/x64/usr/share/keys/pkg/trusted
#7 86.29 pkg: Error loading trusted certificates

revert pkg version to 1.17.0 here https://github.com/dotnet/arcade/blob/3e1d8f1566e3e88816e816aff285bdd709c1260a/eng/common/cross/build-rootfs.sh#L75

It should be fine for 13.x. Unsure if 14.x can use the older version. Looking into that now.


EDIT:

diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh
index 9fa764e7..99a9dd6b 100755
--- a/eng/common/cross/build-rootfs.sh
+++ b/eng/common/cross/build-rootfs.sh
@@ -72,7 +72,7 @@ __AlpinePackages+=" openssl-dev"
 __AlpinePackages+=" zlib-dev"

 __FreeBSDBase="13.2-RELEASE"
-__FreeBSDPkg="1.20.0"
+__FreeBSDPkg="1.17.0"
 __FreeBSDABI="13"
 __FreeBSDPackages="libunwind"
 __FreeBSDPackages+=" icu"

frank@cbl-mariner [ ~ ]$ ./arcade/eng/common/cross/build-rootfs.sh x64 freebsd14 --rootfsdir /home/frank/fbsd/ ...

Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.pkg: 100%    7 MiB   7.2MB/s    00:01    
Processing entries: 100%
FreeBSD repository update completed. 33700 packages processed.
All repositories are up to date.

It looks like that method of building/installing/running pkg in the arcade script broke some time between pkg 1.17.0 and 1.18.0.

am11 commented 8 months ago

Thanks @Thefrank. I found that RELATIVE_PATH macro added post-1.17 is causing the issue. Opened https://github.com/freebsd/pkg/issues/2232 with findings. Lets revert back to v1.17 in the meanwhile https://github.com/dotnet/arcade/pull/14408 since it works for both, v13 and v14.

Thefrank commented 8 months ago

EDIT: Moving comment to pkg issue

lbussell commented 8 months ago

I've queued a new build to get automatic rebuilds rolling again (https://dev.azure.com/dnceng/internal/_build/results?buildId=2361592&view=results).