Mailing List Archive

autocrap de-cargo-culting
Does anybody know of any reason not to apply this patch ?


diff --git a/configure.ac b/configure.ac
index bfc0099..da8d2d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,12 +21,6 @@ AM_SILENT_RULES([yes])
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

-# Checks for programs.
-AC_GNU_SOURCE
-AC_PROG_CC
-AC_PROG_CC_STDC
-AC_PROG_CPP
-
AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])

LIBS="$PTHREAD_LIBS $LIBS"
@@ -88,13 +82,6 @@ fi

save_LIBS="${LIBS}"
LIBS=""
-AC_SEARCH_LIBS(pthread_create, [thr pthread c_r])
-PTHREAD_LIBS="${LIBS}"
-LIBS="${save_LIBS}"
-AC_SUBST(PTHREAD_LIBS)
-
-save_LIBS="${LIBS}"
-LIBS=""
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, getaddrinfo)
NET_LIBS="${LIBS}"
@@ -198,43 +185,18 @@ AC_CHECK_HEADERS([edit/readline/readline.h],
])

# Checks for header files.
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_HEADER_TIME
-AC_CHECK_HEADERS([sys/param.h])
-AC_CHECK_HEADERS([sys/types.h])
AC_CHECK_HEADERS([sys/endian.h])
AC_CHECK_HEADERS([sys/filio.h])
AC_CHECK_HEADERS([sys/mount.h], [], [], [#include <sys/param.h>])
-AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/statvfs.h])
AC_CHECK_HEADERS([sys/vfs.h])
AC_CHECK_HEADERS([endian.h])
AC_CHECK_HEADERS([execinfo.h])
-AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
-AC_CHECK_HEADERS([stddef.h])
-AC_CHECK_HEADERS([stdlib.h])
-AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([priv.h])

-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-])
-
# Checks for library functions.
-AC_TYPE_SIGNAL
-AC_TYPE_SIZE_T
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([strerror])
-AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([dladdr])
-AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([nanosleep])
AC_CHECK_FUNCS([setppriv])
AC_CHECK_FUNCS([fallocate])
@@ -244,8 +206,6 @@ save_LIBS="${LIBS}"
LIBS="${PTHREAD_LIBS}"
AC_CHECK_FUNCS([pthread_set_name_np])
AC_CHECK_FUNCS([pthread_setname_np])
-AC_CHECK_FUNCS([pthread_mutex_isowned_np])
-AC_CHECK_FUNCS([pthread_timedjoin_np])
LIBS="${save_LIBS}"

# Support for visibility attribute
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
Re: autocrap de-cargo-culting [ In reply to ]
On Fri, Nov 25, 2016 at 11:32 AM, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
> Does anybody know of any reason not to apply this patch ?

When I asked whether I could sweep through the build system, it was
partly to get rid of the accumulated cruft. But this being Varnish,
I'd take a more conservative approach :)

Short answer is, no, you can't safely apply this patch. It depends on
what you'd consider safe.

Dridi

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
Re: autocrap de-cargo-culting [ In reply to ]
--------
In message <CABoVN9AGyrU2hYbYS2J=1YrppCJZJtVReApqfLNjyRBQPpDybg@mail.gmail.com>
, Dridi Boukelmoune writes:

>> Does anybody know of any reason not to apply this patch ?

>Short answer is, no, you can't safely apply this patch. It depends on
>what you'd consider safe.

The above patch was arrived at by spotting things autocrap examined
where we subsequently totally ignore the result of the examination.

What's unsafe about that ?

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
Re: autocrap de-cargo-culting [ In reply to ]
On Fri, Nov 25, 2016 at 3:23 PM, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
> --------
> In message <CABoVN9AGyrU2hYbYS2J=1YrppCJZJtVReApqfLNjyRBQPpDybg@mail.gmail.com>
> , Dridi Boukelmoune writes:
>
>>> Does anybody know of any reason not to apply this patch ?
>
>>Short answer is, no, you can't safely apply this patch. It depends on
>>what you'd consider safe.
>
> The above patch was arrived at by spotting things autocrap examined
> where we subsequently totally ignore the result of the examination.
>
> What's unsafe about that ?

There's a reason why *_LIBS variables are created in such a convoluted
way, and it's first on my list of things to clean up so I'll pick this
de-cargo-culting bit myself if you don't mind.

If you don't save the libs, binaries linking to ${NET_LIBS} will also
link to all the previous libs.

Some commands like AC_PROG_CC will actually check that the compiler
works by compiling a file. It possibly does other things that I don't
remember of. If you are running out of autocrap patience I can move
that up in my todo list and do the same kind of cleaning that I did
for VMODs. That would be on the master branch so that maintainers can
yell at me soon enough if I break someone else's machine.

Dridi

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
Re: autocrap de-cargo-culting [ In reply to ]
--------
In message <CABoVN9Bc+DpbJn6FwhrM4qCp8UG9RYLUn--VjCqdfMQ-hykDGg@mail.gmail.com>
, Dridi Boukelmoune writes:

>Some commands like AC_PROG_CC will actually check that the compiler
>works by compiling a file. It possibly does other things that I don't
>remember of.

That's high on my list of things we don't need to worry about and
consequently doesn't have to test :-)

Feel free to de-cargo-cult as you see fit & when you see fit...

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
Re: autocrap de-cargo-culting [ In reply to ]
> That's high on my list of things we don't need to worry about and
> consequently doesn't have to test :-)
>
> Feel free to de-cargo-cult as you see fit & when you see fit...

I gave a quick try to libraries detection [1] and I was wondering why
we bother with platform detection. For instance, do we care what
platform have libumem or jemalloc today? If we don't care, then
detection will fail just fine today and start working [2] as soon as
the libraries hypothetically appear on other Varnish-supported
platforms.

Dridi

[1] https://github.com/varnishcache/varnish-cache/commit/d6216cc
[2] to some uncertain degree of working

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev