[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 24/24] golang/xenlight: add make target for generated files



> One standard practice when making a series is to try to avoid any
> regressions, including build regressions, in the middle of the series.
> This is particularly helpful to aid in bisections, but in this case it
> makes it easier to observe the action of the `gengotypes.py` script (and
> how it's meant to be called).
>
> So I would basically make this part of patch 2, except remove references
> to xenlight_helpers.go until the patch where that file is generated.

Ah yeah that makes sense, I'll correct this in v2.

> It might be nice to have a naming convention for the generated files
> that clues people in to the fact that they're generated (other than the
> comment at the top of course).  In libxl, this is done by giving them a
> leading underscore (e.g., _libxl_type.h); but the go compiler will
> helpfully ignore such files. :-)
>
> The go compiler will also do special things sometimes with things after
> a `_`; e.g., "${foo}_test.go" will only be compiled for `go test`,
> "${foo}_linux.go" will only be compiled on Linux, and so on.  I'm pretty
> sure these names will be safe, but it might be slightly more
> future-proof to avoid using an underscore in the names.

+1 for a naming convention that says "this file is generated." But,
the only special
cases that I'm aware of for go file name suffixes are "test", and
valid GOOS and GOARCH
values. It's conventional to use underscores for compounded file
names, and unnecessary
to avoid them.

To reference gRPC again, their protobuf compiler writes file names
like 'package.pb.go', where
pb is short for protobuf. So, I think something like
'<name>_generated.go', or '<name>.idl.go'
could work.

> Kind of random, but would it make sense to `rm -rf` the whole directory
> here instead?

Yeah probably :)

-NR

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.