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

[libvirt] Problems with pdwtags on Ubuntu 10.04



The "help avoid accidental remote_protocol.x changes" commit 180d4b2b
added a make check rule that tried using pdwtags from the dwarves
package to protect against accidental remote_protocol.x changes.

I installed dwarves package on Ubuntu 10.04 and make check fails for me now.

The temporary file remote_protocol-structs-t is empty for me. It seems
that pdwtags doesn't output the expected format for the embedded perl
script. pdwtags output doesn't contain /* DD */ comments between the
structs. A snippet from the pdwtags output looks like this:



struct remote_nonnull_network {
	remote_nonnull_string      name;                 /*     0     8 */
	remote_uuid                uuid;                 /*     8    16 */

	/* size: 24, cachelines: 1 */
	/* last cacheline: 24 bytes */
};

typedef struct remote_nonnull_network remote_nonnull_network;

struct remote_nonnull_nwfilter {
	remote_nonnull_string      name;                 /*     0     8 */
	remote_uuid                uuid;                 /*     8    16 */

	/* size: 24, cachelines: 1 */
	/* last cacheline: 24 bytes */
};

typedef struct remote_nonnull_nwfilter remote_nonnull_nwfilter;



If i run pdwtags with the --verbose flag then the output looks like this:



/* <44e> remote/remote_protocol.h:71 */
typedef struct remote_nonnull_domain remote_nonnull_domain;

/* <459> remote/remote_protocol.h:73 */
struct remote_nonnull_network {
	remote_nonnull_string      name;                 /*     0     8 */
	remote_uuid                uuid;                 /*     8    16 */

	/* size: 24, cachelines: 1 */
	/* last cacheline: 24 bytes */
};

/* <482> remote/remote_protocol.h:77 */
typedef struct remote_nonnull_network remote_nonnull_network;

/* <48d> remote/remote_protocol.h:79 */
struct remote_nonnull_nwfilter {
	remote_nonnull_string      name;                 /*     0     8 */
	remote_uuid                uuid;                 /*     8    16 */

	/* size: 24, cachelines: 1 */
	/* last cacheline: 24 bytes */
};

/* <4b6> remote/remote_protocol.h:83 */
typedef struct remote_nonnull_nwfilter remote_nonnull_nwfilter;



Now there are "markers" that can be used for splitting, but they still
differ from the expected format.

The attached patch fixes this issue for me on Ubuntu, but I doubt that
this can be the general solution.

Matthias
diff --git a/src/Makefile.am b/src/Makefile.am
index 889de8e..3f7bfa6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -170,9 +170,9 @@ EXTRA_DIST += remote/remote_protocol.x remote/rpcgen_fix.pl
 .PHONY: remote_protocol-structs
 remote_protocol-structs:
 	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
-	  pdwtags libvirt_driver_remote_la-remote_protocol.$(OBJEXT)	\
+	  pdwtags --verbose libvirt_driver_remote_la-remote_protocol.$(OBJEXT)	\
 	    | perl -0777 -n						\
-		-e 'foreach my $$p (split m!\n\n/\* \d+ \*/\n!)'	\
+		-e 'foreach my $$p (split m!\n\n/\* <\S+> \S+ \*/\n!)'	\
 		-e '  { if ($$p =~ /^struct remote_/) {'		\
 		-e '      $$p =~ s!\t*/\*.*?\*/!!sg;'			\
 		-e '      $$p =~ s!\s+\n!\n!sg;'			\

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