Skip to contentSkip to conversation

recent patch breaks the build ?

DISCUSSION Andrew Wozniak 5 participants 15 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

Have just started using git for u-boot related development. After downloading git-snapshot-20051116 tarball and attempting a build under RH7.2, I get the following failure:

gcc -o http-fetch.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>' http-fetch.c http-fetch.c: In function `fetch_alternates':
http-fetch.c:911: warning: implicit declaration of function curl_multi_perform' http-fetch.c:911: curlm' undeclared (first use in this function) <snip>

It appears that a recent patch "Fix for multiple alternates requests in http" references curlm without the necessary #ifdef USE_CURL_MULTI

I'm not that familiar with the git architecture and codebase, so any suggestions for a workaround are much appreciated.

Thank you

#1 lore raw
Quoted 3 lines · Andrew Wozniak

Have just started using git for u-boot related development. After downloading git-snapshot-20051116 tarball and attempting a build under RH7.2, I get the following failure:

Would this help?

-- >8 --

http-fetch.c +3 -1
index 21cc1b9..45e97f9 100644
@@ -902,16 +902,18 @@ static void fetch_alternates(char *base)
 	char *data;
 	struct active_request_slot *slot;
 	static struct alt_request alt_req;
-	int num_transfers;
 
+#ifdef USE_CURL_MULTI
 	/* If another request has already started fetching alternates,
 	   wait for them to arrive and return to processing this request's
 	   curl message */
 	while (got_alternates == 0) {
+		int num_transfers;
 		curl_multi_perform(curlm, &num_transfers);
 		process_curl_messages();
 		process_request_queue();
 	}
+#endif
 
 	/* Nothing to do if they've already been fetched */
 	if (got_alternates == 1)
#2 lore raw

Yes, that suggestion worked - it is similar to other code fragments and ifdefs within the same file.

Unfortunately, now there are other failures:

gcc -o http-push.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>' http-push.c http-push.c: In function `start_mkcol':
http-push.c:479: `CURLOPT_HTTPGET' undeclared (first use in this function) http-push.c:479: (Each undeclared identifier is reported only once http-push.c:479: for each function it appears in.)
http-push.c: In function `start_move':
http-push.c:581: CURLOPT_HTTPGET' undeclared (first use in this function) http-push.c: In function refresh_lock':
http-push.c:615: CURLOPT_HTTPGET' undeclared (first use in this function) http-push.c: In function fetch_index':
http-push.c:890: CURLOPT_HTTPGET' undeclared (first use in this function) http-push.c: In function lock_remote':
http-push.c:1215: CURLOPT_HTTPGET' undeclared (first use in this function) http-push.c: In function main':

I grep'd for these defines and they are nowhere to be found! Is some other package needed to resolve these undefines on my RH7.2 build host?

I'm really surprised that the unmodified tarball source fails to build. Just curious, is the git project rebuilt on a "nightly" basis to verify recent patches?

Thanks again, Andrew

Quoted 34 lines · Junio C Hamano
Quoted 1 line · Andrew Wozniak

Have just started using git for u-boot related development. After downloading git-snapshot-20051116 tarball and attempting a build under RH7.2, I get the following failure:

Would this help?

-- >8 --

http-fetch.c +3 -1
index 21cc1b9..45e97f9 100644
@@ -902,16 +902,18 @@ static void fetch_alternates(char *base)
 	char *data;
 	struct active_request_slot *slot;
 	static struct alt_request alt_req;
-	int num_transfers;
 
+#ifdef USE_CURL_MULTI
 	/* If another request has already started fetching alternates,
 	   wait for them to arrive and return to processing this request's
 	   curl message */
 	while (got_alternates == 0) {
+		int num_transfers;
 		curl_multi_perform(curlm, &num_transfers);
 		process_curl_messages();
 		process_request_queue();
 	}
+#endif
 
 	/* Nothing to do if they've already been fetched */
 	if (got_alternates == 1)
#3 lore raw
Quoted 7 lines · Andrew Wozniak

Unfortunately, now there are other failures:

gcc -o http-push.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>' http-push.c
http-push.c: In function `start_mkcol':
http-push.c:479: `CURLOPT_HTTPGET' undeclared (first use in this function)

http-push requires a curl option that looks like it was added around version 7.8.1. If you have the option to upgrade your version of curl, it should fix the problem. You can also disable building http-push but keep http-fetch by defining NO_EXPAT.

Signature · 2 lines
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
#4 lore raw

Hi,

Quoted 10 lines · Nick Hengeveld
Quoted 7 lines · Andrew Wozniak

Unfortunately, now there are other failures:

gcc -o http-push.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>' http-push.c
http-push.c: In function `start_mkcol':
http-push.c:479: `CURLOPT_HTTPGET' undeclared (first use in this function)

Quoted 4 lines

http-push requires a curl option that looks like it was added around version 7.8.1. If you have the option to upgrade your version of curl, it should fix the problem. You can also disable building http-push but keep http-fetch by defining NO_EXPAT.

It was 7.8.1. I checked. You might want to add this somewhere:

#if LIBCURL_VERSION_NUM < 0x070801
#error http-push needs curl >= 7.8.1 (because of CURLOPT_HTTPGET) #endif

I tried quite a few things to work around it. Alas, I am now convinced that no set of option setting does exactly the same thing as CURLOPT_HTTPGET for a specific curl version < 7.8.1 (the one I tested with).

Ciao,
Dscho

#5 lore raw
Quoted 5 lines · Johannes Schindelin

It was 7.8.1. I checked. You might want to add this somewhere:

#if LIBCURL_VERSION_NUM < 0x070801
#error http-push needs curl >= 7.8.1 (because of CURLOPT_HTTPGET) #endif

Is it worth trying to figure this out in the Makefile instead, using eg. curl-config --vernum?

Signature · 2 lines
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
#6 lore raw
Quoted 8 lines · Nick Hengeveld
Quoted 3 lines · Johannes Schindelin

#if LIBCURL_VERSION_NUM < 0x070801
#error http-push needs curl >= 7.8.1 (because of CURLOPT_HTTPGET) #endif

Is it worth trying to figure this out in the Makefile instead, using eg. curl-config --vernum?

If we can do that reliably, that would be very nice for the users. Might be worth a try.

#7 lore raw
Quoted 5 lines · Junio C Hamano
Quoted 2 lines

Is it worth trying to figure this out in the Makefile instead, using eg. curl-config --vernum?

If we can do that reliably, that would be very nice for the users. Might be worth a try.

Well, it looks as though the --vernum option was added prior to 7.8.1, so if it doesn't work it's safe to assume that curl is too old - more than ~4.5 years old in this case.

Assuming --vernum does work, is there a reasonable/portable way to compare two hex values like 070801?

Signature · 2 lines
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
#8 lore raw
Quoted 2 lines · Nick Hengeveld

Assuming --vernum does work, is there a reasonable/portable way to compare two hex values like 070801?

I would assume that it is always 6 lowercase hexdigits %06x when supported, or showing nothing to stdout for ancient ones.

A horrible but probably portable way would be:

	case `(echo 070801; curl-config --vernum) 2>/dev/null |
        	sort -r | sed -ne 2p` in
	070801)
        	echo Happy ;;
        *)
        	echo Sad ;;
	esac

The obvious one is unfortunately not very portable:

	if test 070801 \< `curl-config --vernum`
        then
        	echo "Happy"
	else
        	echo "Sad"
	fi

This would work if your test is bash/dash-builtin. The following do not seem to know about '<' '>' string comparison:

GNU /usr/bin/test from coreutils (version 5.2.1) OpenBSD shell builtin
Solaris /usr/bin/test

#9 lore raw

Hi,

Quoted 10 lines · Junio C Hamano
Quoted 2 lines · Nick Hengeveld

Assuming --vernum does work, is there a reasonable/portable way to compare two hex values like 070801?

I would assume that it is always 6 lowercase hexdigits %06x when supported, or showing nothing to stdout for ancient ones.

A horrible but probably portable way would be:

Quoted 7 lines
	case `(echo 070801; curl-config --vernum) 2>/dev/null |
        	sort -r | sed -ne 2p` in
	070801)
        	echo Happy ;;
        *)
        	echo Sad ;;
	esac

Horrible to read, but actually portable (and can be produced by a small script):

case "$NUMBER" in
07080[1-9] | \
0708[1-9]? | \
0709?? | \
07[1-9]??? | \
0[8-9]???? | \
[1-9]?????) echo "Yes";;
*) echo "No";;
esac

Ciao,
Dscho

#10 lore raw
In reply to Andrew Wozniak
Quoted 8 lines · Andrew Wozniak

Yes, that suggestion worked - it is similar to other code fragments and ifdefs within the same file.

Unfortunately, now there are other failures:

gcc -o http-push.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>' http-push.c http-push.c: In function `start_mkcol':
http-push.c:479: `CURLOPT_HTTPGET' undeclared (first use in this function)

....

Quoted 2 lines

I grep'd for these defines and they are nowhere to be found! Is some other package needed to resolve these undefines on my RH7.2 build host?

curl and curl-devel. Or you can build with

make NO_CURL=YesPlease

which just means you won't have http and https transports available. This shouldn't be much of a problem on a server though.

Quoted 2 lines

I'm really surprised that the unmodified tarball source fails to build. Just curious, is the git project rebuilt on a "nightly" basis to verify recent patches?

I have no idea, but since it's a developer tool in pre-1.0 I think the general consensus is that user-friendliness in the build-process comes somewhere between "not so important" and "what? users? oh, those living in the *other* land!"

Perhaps you should try the RPM's at http://www.kernel.org/pub/software/scm/git-core/ ?

If nothing else it will tell you what other packages you need.

Signature · 3 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
#11 lore raw
In reply to Andrew Wozniak
Quoted 4 lines · Andrew Wozniak

Unfortunately, now there are other failures:
...
I grep'd for these defines and they are nowhere to be found! Is some other package needed to resolve these undefines on my RH7.2 build host?

Probably. Maybe you can look at INSTALL and report missing dependencies? Also the top of the Makefile (huge ugly comment section).

#12 lore raw
In reply to Andrew Wozniak

Hi,

Quoted 2 lines · Andrew Wozniak

It appears that a recent patch "Fix for multiple alternates requests in http" references curlm without the necessary #ifdef USE_CURL_MULTI

Note that I had no success making http-fetch work without USE_CURL_MULTI. So maybe you can compile it, but maybe you experience the same problems as I had.

Hth,
Dscho

#13 lore raw
Quoted 3 lines · Johannes Schindelin

Note that I had no success making http-fetch work without USE_CURL_MULTI. So maybe you can compile it, but maybe you experience the same problems as I had.

http-fetch or http-push?

Signature · 2 lines
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
#14 lore raw

Hi,

Quoted 7 lines · Nick Hengeveld
Quoted 3 lines · Johannes Schindelin

Note that I had no success making http-fetch work without USE_CURL_MULTI. So maybe you can compile it, but maybe you experience the same problems as I had.

http-fetch or http-push?

Oops. IIRC it was when I was playing with http-push.

Sorry,
Dscho