Closed andig closed 3 years ago
As-is, this pull request enforces the same build options for all applications, which is not necessarily desirable.
Doh: Will update accordingly.
The proposed structure will lead to a lot of directories:
flags/github.com/gokrazy/timestamps/flags.txt
then becomes:
buildopt/github.com/gokrazy/timestamps/buildopt.txt
Would you be ok with flattening these and putting the various package-specific options into a single per-packege folder like
github.com/gokrazy/timestamps/flags.txt
github.com/gokrazy/timestamps/buildopt.txt
The proposed structure will lead to a lot of directories:
Yes, one per thing that you’re changing.
I like that you can do e.g. head -100 flags/**/*
(provided your shell expands **/*
) to see all flags for all packages.
I don’t think that’s a problem, though. I understand that some people might subjectively prefer one or the other.
What I’m shooting for here is maximum clarity, though. All flags go into the flags directory, all environment variables into the environ directory, etc.
I like that you can do e.g. head -100 flags/*/ (provided your shell expands */) to see all flags for all packages.
You could do the same by ./**/flags.txt
?
LGTM:
❯ gor github.com/gokrazy/tools/cmd/gokr-packer -http_port 8080 -update yes -hostname evcc github.com/gokrazy/breakglass github.com/andig/evcc
2021/01/11 15:40:09 packer.go:458: building [github.com/gokrazy/breakglass github.com/andig/evcc]
2021/01/11 15:40:09 packer.go:200: package github.com/andig/evcc will be compiled with build args from buildargs/github.com/andig/evcc/buildargs.txt
[build -tags gokrazy -o /var/folders/73/89ycv7qn51j4kbm04jsz9b840000gn/T/gokrazy-bins-302778475/dhcp github.com/gokrazy/gokrazy/cmd/dhcp]
[build -tags gokrazy -o /var/folders/73/89ycv7qn51j4kbm04jsz9b840000gn/T/gokrazy-bins-302778475/evcc -tags=release -ldflags '-X "github.com/andig/evcc/server.Version=${VERSION}" -X "github.com/andig/evcc/server.Commit=${SHA}"' github.com/andig/evcc]
You could do the same by
./**/flags.txt
?
Indeed, yes.
I still feel that having a top-level directory for per-package configuration files is a good idea.
You could do the same by
./**/flags.txt
?Indeed, yes.
I still feel that having a top-level directory for per-package configuration files is a good idea.
Maybe packageconf or buildconfig as top level? Then we could at least gather multiple files in the same package folder. Or .gocrazy-build?
Fix https://github.com/gokrazy/gokrazy/issues/80
Doing something like
seems to work fine. I had expected needing to use something like https://github.com/kballard/go-shellquote or https://github.com/google/shlex but that doesn't seem required.