On Thu, Jun 06, 2024 at 10:02:04AM -0700, Junio C Hamano wrote: > Patrick Steinhardt <ps@xxxxxx> writes: > > > I was a little torn whether we really want to name the variable `O` > > here because it feels so easy to set it by accident. We could rename > > this to `OPTIMIZATION` or `OPTIMIZATION_LEVEL`, but that's quite a > > mouthful. > > > > Alternatively, if we don't want to have this variable in the first > > place, then I'm also happy to adapt the script itself to pass the > > optimization level via an argument. > > The latter is much more preferrable. It is too easy to stomp on > people's established workflow that already uses that variable for > other purposes or expects slightly different syntax. We're unlikely to break existing workflows though if we name this variable something like `OPTIMIZATION_LEVEL`. The workflows of both you and Peff would keep on working without any modification. Also, doesn't the fact that both of you have similar workarounds hint that this is something that other devs might want to have, as well? We could also generalize this a bit and introduce `CFLAGS_APPEND` instead. Optimization levels are last-one-wins anyway, so people can use that to append their own flags without overriding existing values. It would also mean that we can avoid repeating the CFLAGS that we already have in our Makefile in our CI scripts. I'll send a version along these lines. If people are still unhappy with that direction, then I'll give up and just repeat the whole CFLAGS in "ci/run-build-and-tests.sh". Patrick
Attachment:
signature.asc
Description: PGP signature