[Gluster-devel] No more unused-variables in the glusterfs sources!

Niels de Vos ndevos at redhat.com
Sun Sep 18 17:00:01 UTC 2016


After ~80 patches from Kaleb, the unused variables have been removed
from the glusterfs sources. The change that makes it possible to pass
the compile options through to all files is included below. It was a
major cleanup to place the generated XDR-files in the correct location.

While getting the 'unused variable' patches included, many others were
introduced... It is dangerous to include #pragma statements that
override compiler options in header files that are included almost
everywhere.

Thanks for your persistence, Kaleb!


----- Forwarded message from "Niels de Vos (Code Review)" <review at dev.gluster.org> -----

> Date: Sun, 18 Sep 2016 09:34:38 -0700
> From: "Niels de Vos (Code Review)" <review at dev.gluster.org>
> To: Niels de Vos <ndevos at redhat.com>, Kaleb KEITHLEY <kkeithle at redhat.com>
> CC: Gluster Build System <jenkins at build.gluster.org>, Kaushal M <kaushal at redhat.com>, Milind Changire <mchangir at redhat.com>, Anoop C S <anoopcs at redhat.com>
> Subject: Change in glusterfs[master]: build: out-of-tree builds generates files in the wrong direc...
> 
> Niels de Vos has submitted this change and it was merged.
> 
> Change subject: build: out-of-tree builds generates files in the wrong directory
> ......................................................................
> 
> 
> build: out-of-tree builds generates files in the wrong directory
> 
> And minor cleanup of a few of the Makefile.am files while we're
> at it.
> 
> Rewrite the make rules to do what xdrgen does. Now we can get rid
> of xdrgen.
> 
> Note 1. netbsd6's sed doesn't do -i. Why are we still running
> smoke tests on netbsd6 and not netbsd7? We barely support netbsd7
> as it is.
> 
> Note 2. Why is/was libgfxdr.so (.../rpc/xdr/src/...) linked with
> libglusterfs? A cut-and-paste mistake? It has no references to
> symbols in libglusterfs.
> 
> Note3. "/#ifndef\|#define\|#endif/" (note the '\'s) is a _basic_
> regex that matches the same lines as the _extended_ regex
> "/#(ifndef|define|endif)/". To match the extended regex sed needs to
> be run with -r on Linux; with -E on *BSD. However NetBSD's and
> FreeBSD's sed helpfully also provide -r for compatibility. Using a
> basic regex avoids having to use a kludge in order to run sed with
> the correct option on OS X.
> 
> Note 4. Not copying the bit of xdrgen that inserts copyright/license
> boilerplate. AFAIK it's silly to pretend that machine generated
> files like these can be copyrighted or need license boilerplate.
> The XDR source files have their own copyright and license; and
> their copyrights are bound to be more up to date than old
> boilerplate inserted by a script. From what I've seen of other
> Open Source projects -- e.g. gcc and its C parser files generated
> by yacc and lex -- IIRC they don't bother to add copyright/license
> boilerplate to their generated files.
> 
> It appears that it's a long-standing feature of make (SysV, BSD,
> gnu) for out-of-tree builds to helpfully pretend that the source
> files it can find in the VPATH "exist" as if they are in the $cwd.
> rpcgen doesn't work well in this situation and generates files
> with "bad" #include directives.
> 
> E.g. if you `rpcgen ../../../../$srcdir/rpc/xdr/src/glusterfs3-xdr.x`,
> you get an #include directive in the generated .c file like this:
> 
>   ...
>   #include "../../../../$srcdir/rpc/xdr/src/glusterfs3-xdr.h"
>   ...
> 
> which (obviously) results in compile errors on out-of-tree build
> because the (generated) header file doesn't exist at that location.
> Compared to `rpcgen ./glusterfs3-xdr.x` where you get:
> 
>   ...
>   #include "glusterfs3-xdr.h"
>   ...
> 
> Which is what we need. We have to resort to some Stupid Make Tricks
> like the addition of various .PHONY targets to work around the VPATH
> "help".
> 
> Warning: When doing an in-tree build, -I$(top_builddir)/rpc/xdr/...
> looks exactly like -I$(top_srcdir)/rpc/xdr/...  Don't be fooled though.
> And don't delete the -I$(top_builddir)/rpc/xdr/... bits
> 
> Change-Id: Iba6ab96b2d0a17c5a7e9f92233993b318858b62e
> BUG: 1330604
> Signed-off-by: Kaleb S KEITHLEY <kkeithle at redhat.com>
> Reviewed-on: http://review.gluster.org/14085
> Tested-by: Niels de Vos <ndevos at redhat.com>
> Smoke: Gluster Build System <jenkins at build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
> Reviewed-by: Niels de Vos <ndevos at redhat.com>
> ---
> M Makefile.am
> M api/src/Makefile.am
> D build-aux/xdrgen
> M cli/src/Makefile.am
> M contrib/umountd/Makefile.am
> M extras/LinuxRPM/Makefile.am
> M extras/geo-rep/Makefile.am
> M geo-replication/src/Makefile.am
> M glusterfsd/src/Makefile.am
> M heal/src/Makefile.am
> M libglusterfs/src/Makefile.am
> M libglusterfs/src/gfdb/Makefile.am
> M rpc/rpc-lib/src/Makefile.am
> M rpc/rpc-transport/rdma/src/Makefile.am
> M rpc/rpc-transport/socket/src/Makefile.am
> M rpc/xdr/src/Makefile.am
> M rpc/xdr/src/acl3-xdr.x
> M rpc/xdr/src/changelog-xdr.x
> M rpc/xdr/src/cli1-xdr.x
> M rpc/xdr/src/glusterd1-xdr.x
> M rpc/xdr/src/glusterfs-fops.x
> M rpc/xdr/src/glusterfs3-xdr.x
> M rpc/xdr/src/mount3udp.x
> M rpc/xdr/src/nlm4-xdr.x
> M rpc/xdr/src/nsm-xdr.x
> M rpc/xdr/src/portmap-xdr.x
> M rpc/xdr/src/rpc-common-xdr.x
> A rpc/xdr/src/rpc-pragmas.h
> M xlators/cluster/afr/src/Makefile.am
> M xlators/cluster/dht/src/Makefile.am
> M xlators/cluster/ec/src/Makefile.am
> M xlators/cluster/stripe/src/Makefile.am
> M xlators/debug/error-gen/src/Makefile.am
> M xlators/debug/io-stats/src/Makefile.am
> M xlators/debug/trace/src/Makefile.am
> M xlators/encryption/crypt/src/Makefile.am
> M xlators/encryption/rot-13/src/Makefile.am
> M xlators/experimental/dht2/dht2-client/src/Makefile.am
> M xlators/experimental/dht2/dht2-server/src/Makefile.am
> M xlators/experimental/fdl/src/Makefile.am
> M xlators/experimental/jbr-client/src/Makefile.am
> M xlators/experimental/jbr-server/src/Makefile.am
> M xlators/experimental/posix2/common/src/Makefile.am
> M xlators/experimental/posix2/ds/src/Makefile.am
> M xlators/experimental/posix2/mds/src/Makefile.am
> M xlators/features/arbiter/src/Makefile.am
> M xlators/features/barrier/src/Makefile.am
> M xlators/features/bit-rot/src/bitd/Makefile.am
> M xlators/features/bit-rot/src/stub/Makefile.am
> M xlators/features/changelog/lib/src/Makefile.am
> M xlators/features/changelog/src/Makefile.am
> M xlators/features/changetimerecorder/src/Makefile.am
> M xlators/features/compress/src/Makefile.am
> A xlators/features/ganesha/src/Makefile.am
> M xlators/features/gfid-access/src/Makefile.am
> M xlators/features/glupy/src/Makefile.am
> M xlators/features/index/src/Makefile.am
> M xlators/features/leases/src/Makefile.am
> M xlators/features/locks/src/Makefile.am
> M xlators/features/mac-compat/src/Makefile.am
> M xlators/features/marker/src/Makefile.am
> M xlators/features/protect/src/Makefile.am
> M xlators/features/quiesce/src/Makefile.am
> M xlators/features/quota/src/Makefile.am
> M xlators/features/read-only/src/Makefile.am
> M xlators/features/shard/src/Makefile.am
> M xlators/features/snapview-client/src/Makefile.am
> M xlators/features/snapview-server/src/Makefile.am
> M xlators/features/trash/src/Makefile.am
> M xlators/features/upcall/src/Makefile.am
> M xlators/meta/Makefile.am
> M xlators/meta/src/Makefile.am
> M xlators/mgmt/glusterd/src/Makefile.am
> M xlators/mount/fuse/src/Makefile.am
> M xlators/nfs/server/src/Makefile.am
> M xlators/performance/Makefile.am
> M xlators/performance/decompounder/src/Makefile.am
> M xlators/performance/io-cache/src/Makefile.am
> M xlators/performance/io-threads/src/Makefile.am
> M xlators/performance/md-cache/src/Makefile.am
> M xlators/performance/open-behind/src/Makefile.am
> M xlators/performance/quick-read/src/Makefile.am
> M xlators/performance/read-ahead/src/Makefile.am
> M xlators/performance/readdir-ahead/src/Makefile.am
> M xlators/performance/symlink-cache/src/Makefile.am
> M xlators/performance/write-behind/src/Makefile.am
> M xlators/playground/template/src/Makefile.am
> M xlators/protocol/auth/addr/src/Makefile.am
> M xlators/protocol/auth/login/src/Makefile.am
> M xlators/protocol/client/src/Makefile.am
> M xlators/protocol/server/src/Makefile.am
> M xlators/storage/bd/src/Makefile.am
> M xlators/storage/posix/src/Makefile.am
> M xlators/system/posix-acl/src/Makefile.am
> 94 files changed, 513 insertions(+), 388 deletions(-)
> 
> Approvals:
>   Niels de Vos: Verified; Looks good to me, approved
>   Gluster Build System: Smoke failed; CentOS regression failed
>   NetBSD Build System: NetBSD regression failed
> 
> 
> 
> -- 
> To view, visit http://review.gluster.org/14085
> To unsubscribe, visit http://review.gluster.org/settings
> 
> Gerrit-MessageType: merged
> Gerrit-Change-Id: Iba6ab96b2d0a17c5a7e9f92233993b318858b62e
> Gerrit-PatchSet: 22
> Gerrit-Project: glusterfs
> Gerrit-Branch: master
> Gerrit-Owner: Kaleb KEITHLEY <kkeithle at redhat.com>
> Gerrit-Reviewer: Anoop C S <anoopcs at redhat.com>
> Gerrit-Reviewer: Gluster Build System <jenkins at build.gluster.org>
> Gerrit-Reviewer: Kaleb KEITHLEY <kkeithle at redhat.com>
> Gerrit-Reviewer: Kaushal M <kaushal at redhat.com>
> Gerrit-Reviewer: Milind Changire <mchangir at redhat.com>
> Gerrit-Reviewer: NetBSD Build System <jenkins at build.gluster.org>
> Gerrit-Reviewer: Niels de Vos <ndevos at redhat.com>

----- End forwarded message -----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20160918/80c08ae7/attachment.sig>


More information about the Gluster-devel mailing list