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

CI: Add FreeBSD build tests for staged commits #1948

Closed
wants to merge 28 commits into from
Closed
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7cd4b0a
Initial status
kinkie Nov 4, 2024
45b311f
Force ubuntu version
kinkie Nov 4, 2024
626fa2e
test multiple freebsd versions
kinkie Nov 4, 2024
8a1356d
Speed development up: only test default layer
kinkie Nov 4, 2024
7285e22
Fix syntax
kinkie Nov 4, 2024
3a432fe
FreeBSD 12.4 EOLd by the project
kinkie Nov 4, 2024
32c0a66
specify matrix dimenion in uploaded artifacts
kinkie Nov 4, 2024
6979b08
Merge FreeBSD tests into slow.yaml
kinkie Nov 17, 2024
bd56e81
Merge remote-tracking branch 'upstream/master' into bsd-merge-tests
kinkie Nov 17, 2024
25f2cf5
freebsd: add ccache
kinkie Nov 17, 2024
cc23c00
try ccache with relative path
kinkie Nov 17, 2024
f3f7248
type ccache path
kinkie Nov 17, 2024
6ddd23c
quote CC and CXX definitions
kinkie Nov 17, 2024
f6fbcaf
test setup: skip linux and macos for now
kinkie Nov 17, 2024
3bc138e
Ccache is in /usr/local/bin
kinkie Nov 17, 2024
8f42e00
Ready for submission
kinkie Nov 18, 2024
1dcc91d
Remove openbsd
kinkie Nov 18, 2024
d1cf890
avoid unnecessary command in package install
kinkie Nov 18, 2024
4021851
Adopt suggestion from code review
kinkie Nov 18, 2024
317566f
Remove libxml2, not needed for trunk
kinkie Nov 19, 2024
8a8d8e2
experiment: remove -Wno-compound-token-split-by-macro flag
kinkie Nov 18, 2024
ee91e33
Use workflow env directive for env variables
kinkie Nov 18, 2024
30023e0
Environment variables are not propagated inside the VM
kinkie Nov 19, 2024
5ec8fe8
add translate-toolkit
kinkie Nov 19, 2024
4593fd9
Specify layers to be tested
kinkie Nov 19, 2024
e3ab17c
Ccache is useless inside the vm
kinkie Nov 19, 2024
c814258
revert tested layers selection
kinkie Nov 20, 2024
93174c7
do not explicitly mention we are testing on clang
kinkie Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,52 @@ jobs:
with:
name: build-logs-macos
path: btlayer-*.log

freebsd:
strategy:
matrix:
osversion:
- 14.1
- 13.3

runs-on: ubuntu-22.04
name: freebsd(${{ matrix.osversion }})

steps:
- name: Checkout Sources
uses: actions/checkout@v4

- name: Run test-builds
id: test-builds
uses: vmactions/freebsd-vm@v1
with:
usesh: true
release: ${{ matrix.osversion }}
prepare: |
pkg update
pkg install -y \
autoconf \
autoconf-archive \
automake \
bash \
cppunit \
gmake \
libltdl \
libtool \
m4 \
nettle \
pkgconf \
translate-toolkit

rousskov marked this conversation as resolved.
Show resolved Hide resolved
run: |
export MAKE=gmake
export CC=clang
export CXX=clang++
Copy link
Contributor

@rousskov rousskov Nov 20, 2024

Choose a reason for hiding this comment

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

Now that ccache optimization is removed, why do we need these customizations? Please either remove them (if they are not needed) or add a YAML comment to explain them (otherwise).

Suggested change
export CC=clang
export CXX=clang++

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without these, in practice, we would still use clang, but it would be called 'gcc'.
Would that be confusing to you or anyone else looking at it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Without these, in practice, we would still use clang, but it would be called 'gcc'.

Understood. If compiler naming is the only effect of these customizations, then please remove these customizations.

Would that be confusing to you or anyone else looking at it?

I am sure that will be confusing or at least puzzling to some folks (possibly including me). However, customizing this confuses or puzzles some folks as well (obviously including me)! We are selecting among two evils here.

This PR is not about improving FreeBSD (or autoconf or whatever) approach to naming things. With all other factors being equal, the closer we stay to FreeBSD customs/conventions when testing on FreeBSD, the better, regardless of how problematic those customs/conventions are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the closer we stay to FreeBSD customs/conventions when testing on FreeBSD,

we have no idea about what FreeBSD customs/conventions are. I suspect that just like MacOS does, they install portability shims to make nonportable software content.

I don't agree we should follow problematic customs or conventions, especially when it comes to explicitly naming what compiler we target. But this is not a hill I'm going to die for

Copy link
Contributor

Choose a reason for hiding this comment

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

the closer we stay to FreeBSD customs/conventions when testing on FreeBSD,

we have no idea about what FreeBSD customs/conventions are.

In this context, we do: Whatever happens by default (i.e. without our customizations) is likely to be customary/conventional.

I suspect that just like MacOS does, they install portability shims to make nonportable software content.

You may be right, but it is their business. Folks using FreeBSD ought to be accustomed to whatever FreeBSD is doing.

I don't agree we should follow problematic customs or conventions, especially when it comes to explicitly naming what compiler we target.

With all other factors being equal, I think we should approximate, to the extent it is feasible/practical, what a typical admin sees/does when compiling Squid on FreeBSD. Any unnecessary customizations are unwanted in this "Does Squid build on FreeBSD?" context. We are not trying to build on FreeBSD configured "our way". We are trying to build on FreeBSD configured "their way" (again, to the extent it is feasible/practical).

But this is not a hill I'm going to die for

IMO, this design decision can and should be made based on merits rather than personal sacrifices. And since many other decisions are based on the same basic "what are we testing?" question, I hope that this discussion helps reduce the time spent on re-arguing them in the future. Every time we are about to add a customization to a build environment, we have to pause and ask ourselves: Is it justified? Do our actions really have to differ from what admins are going to do? And, if yes, where do we explain the necessity of this customization?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the closer we stay to FreeBSD customs/conventions when testing on FreeBSD,

we have no idea about what FreeBSD customs/conventions are.

In this context, we do: Whatever happens by default (i.e. without our customizations) is likely to be customary/conventional.

These aren't FreeBSD defaults, these are autotools' defaults. If we were to base our project on - say - cmake or bzl, we might be seeing something different. If FreeBSD has any default, it's cc and c++, but autoconf is opinionated

I suspect that just like MacOS does, they install portability shims to make nonportable software content.

You may be right, but it is their business. Folks using FreeBSD ought to be accustomed to whatever FreeBSD is doing.

I don't agree we should follow problematic customs or conventions, especially when it comes to explicitly naming what compiler we target.

With all other factors being equal, I think we should approximate, to the extent it is feasible/practical, what a typical admin sees/does when compiling Squid on FreeBSD. Any unnecessary customizations are unwanted in this "Does Squid build on FreeBSD?" context. We are not trying to build on FreeBSD configured "our way". We are trying to build on FreeBSD configured "their way" (again, to the extent it is feasible/practical).

As shown above, we aren't. I can agree to use CC=cc and CXX=c++, if that helps

But this is not a hill I'm going to die for

IMO, this design decision can and should be made based on merits rather than personal sacrifices. And since many other decisions are based on the same basic "what are we testing?" question, I hope that this discussion helps reduce the time spent on re-arguing them in the future. Every time we are about to add a customization to a build environment, we have to pause and ask ourselves: Is it justified? Do our actions really have to differ from what admins are going to do? And, if yes, where do we explain the necessity of this customization?

This is one of the decisions where it's hard or even impossible to agree based on merits, because we are comparing outcomes that boil down to different axes. On one side there's "let's be explicit about what we are testing against", and on the other there is "let's add as little context as possible". They are mutually exclusive, and achieve different goals. These goals cannot be ranked objectively, only subjectively; we are finding it hard to disagree because I think one goal is more valuable, and you think another one is. Our processes grant more power to the reviewer than to the author of a PR, therefore my statement, which could be expanded to "I disagree with your assessment, but I rank the goal of landing this PR more than I rank the goal of not landing it because I fixate on what I consider a valuable but minor detail, therefore I'll follow your opinions although I disagree with them".

So, let's have it your way and move on :)

Copy link
Contributor

Choose a reason for hiding this comment

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

These aren't FreeBSD defaults, these are autotools' defaults.

... which may depend on the OS. At any rate, my arguments apply to autotools' defaults just as well.

I can agree to use CC=cc and CXX=c++, if that helps

It does not help enough: The alleged problem of the customization itself being unnecessary and uncustomary would remain regardless of the chosen custom compiler name/alias.

Alex: Every time we are about to add a customization to a build environment, we have to pause and ask ourselves: Is it justified? Do our actions really have to differ from what admins are going to do? And, if yes, where do we explain the necessity of this customization?

Francesco: This is one of the decisions where it's hard or even impossible to agree based on merits, because we are comparing outcomes that boil down to different axes. On one side there's "let's be explicit about what we are testing against", and on the other there is "let's add as little context as possible".

Hm... I did not make "be explicit about what we are testing against" and "let's add as little context as possible" arguments (or their opposites). Bringing these arguments into this discussion appears to miss my primary argument/point -- avoiding customizations.

I disagree that adding CC=clang is "let's be explicit about what we are testing". Instead, it is "let's test clang build". Explicitness of that decision expression is secondary to the decision itself. If the wrong decision can be avoided in the first place, these secondary details do not matter.

While I agree that it is "hard to agree based on merits", I still think it is worth reaching such an agreement. As for "comparing outcomes [using] different axes", a merit-based argument should consider multiple angles if multiple angles are relevant to the decision, of course.

These goals cannot be ranked objectively, only subjectively; we are finding it hard to disagree because I think one goal is more valuable, and you think another one is

Those two goals are not the goals I am comparing because rejection of significant build environment customizations can and should be done before these secondary goals are considered.

Our processes grant more power to the reviewer than to the author of a PR

That statement is misleading IMO. Both roles have multiple powers. Those power sets are different, but neither set is strictly "more" or "less" than the other.

therefore my statement, which could be expanded to "I disagree with your assessment, but I rank the goal of landing this PR more than I rank the goal of not landing it because I fixate on what I consider a valuable but minor detail, therefore I'll follow your opinions although I disagree with them".

So, let's have it your way and move on :)

Unfortunately, the current approach results in an enormous waste of our time as we keep revisiting (and spending a lot of time on) the same basic decisions again and again and again. "[Eventually] moving on" is better than not moving, of course, but I was hoping for more efficient movement (through shared agreement regarding such basic principles as avoiding build environment customizations)...

./test-builds.sh layer-00-default layer-01-minimal layer-02-maximus
kinkie marked this conversation as resolved.
Show resolved Hide resolved

- name: Publish build logs
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-freebsd-${{ matrix.osversion }}
path: btlayer-*.log