Page MenuHomeFreeBSD

tests/ci: Fix building in Github
AcceptedPublic

Authored by bofh on Wed, Dec 17, 8:52 PM.

Details

Reviewers
emaste
lwhsu
jrm
Summary

When we are using Cirrus-CI and using a PR branch it creates a filename
in the form "pull/XXXX" which becomes a path seperator and the file
creation process fails.

Fails to complete the process with the following:
/bin/sh: cannot create
/tmp/meta.hUNGUq/ci-FreeBSD-16.0-pull/1932-amd64-nullhash-GENERIC.env:
No such file or directory

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69348
Build 66231: arc lint + arc unit

Event Timeline

bofh requested review of this revision.Wed, Dec 17, 8:52 PM

Just in case I created PR and it was fired into our persistent worker.

https://cirrus-ci.com/task/5235415789076480?logs=ci

This seems a bit strange - BRANCH should be coming out of newvers.sh and be something like BRANCH="CURRENT" (unless BRANCH_OVERRIDE is set). How is pull/XXXX making its way in?

This seems a bit strange - BRANCH should be coming out of newvers.sh and be something like BRANCH="CURRENT" (unless BRANCH_OVERRIDE is set). How is pull/XXXX making its way in?

I think CIRRUS-CI also has an environment variable named BRANCH.

It's not mentioned specifically but in an snippet of code I can see the following:

only_if: $BRANCH == "master" #

And as we have the following our script is not overriding or reading the BRANCH:

.  for _V in TYPE BRANCH REVISION
.    if !defined(${_V}) || empty(${_V})
${_V}!= eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../../sys/conf/newvers.sh); echo $$${_V}
.    endif
.  endfor

Oh yeah, of course -- I missed the . if !defined(${_V}) || empty(${_V}). So then the question is do we want to take the branch from Cirrus? I.e., is FreeBSD-16.0-CURRENT-amd64 desired, or FreeBSD-16.0-pull_1234-amd64?

I think it's fine to have this change regardless of the answer to that question, although maybe we can just use :C/[.-/]/_/g in both OSRELEASE and VOLUME_LABEL?

Change the regex for both OSRELEASE and VOLUME_LABEL.

Oh it looks like / needs to be escaped in the [] expression, so [.-\/]. I tried that expression locally and it looked OK but double check

@emaste you are correct / needs escaping in regex pattern groups.

This revision is now accepted and ready to land.Wed, Dec 17, 10:04 PM