Commit Graph

174 Commits

Author SHA1 Message Date
riastradh 40ca0b4614 lib: Handle various external lib directories with build_install.
This way, update builds track shlib major bumps correctly.

For example, suppose you had built Heimdal's libkrb5.so.27 and
libgssapi.so.11 linked against it, and then you updated past the recent
shlib major bump raising them to libkrb5.so.28 and libgssapi.so.12.

Without this change, the build will make the following sequence of
targets (interleaved with some others):

1. make dependall in libkrb5
2. make dependall in libgssapi
3. make install in libkrb5
4. make install in libgssapi

The existing .WAIT tags in SUBDIR ensure that (1) happens before (2)
and (3) happens before (4).  Unfortunately, this sequence is wrong,
because it will produce the following effect:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.27
3. make install in libkrb5 installs libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Why the out-of-date libkrb5.so.27 in step (2)?  Because we just pass
-L${DESTDIR}/usr/lib -lkrb5 to the linker (or the equivalent with
--sysroot and implied -L/usr/lib), and ${DESTDIR}/usr/lib still has
only libkrb5.so.27 by the time of step (2), not libkrb5.so.28.

Now any applications that link against libkrb5.so _and_ libgssapi.so
will get libkrb5.so.28 and libgssapi.so.12 -- but transitively, via
libgssapi.so.12, they will also get libkrb5.so.27, which is a recipe
for disaster.

Splicing the Heimdal library subdirectories into lib/Makefile, as
this does, ensures that we run make dependall _and_ make install in
libkrb5 _before_ make dependall in libgssapi, giving the following
correct sequence:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make install in libkrb5 installs libkrb5.so.28
3. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Note that LIBDPLIBS isn't enough here, as implemented.  LIBDPLIBS
ensures that the incremental build will remake libgssapi.so.  But it
doesn't ensure that the new libkrb5.so.28 is available before then,
so it doesn't prevent this problem.

We use the same mechanism for crypto/external/bsd/openssl/lib
already; this just extends it to other external library collections.

As an alternative, in principle perhaps we could teach LIBDPLIBS to
ensure that libkrb5.so comes out of the libkrb5 objdir, and not out
of ${DESTDIR}/usr/lib.  But that requires some work to make happen,
and make it reliable, whereas this approach we've already confirmed
works without other adverse consequences (besides leaving
grody-looking mechanism lying around) for the libcrypto major bump
already.  We need to get this pulled up to the branch so all the
other major bumps it required are handled correctly by update builds.

XXX pullup-10
2023-09-06 23:44:42 +00:00
riastradh 4604ab506a */shlib_version: Ensure a boring line between RCS id and all else.
This makes cherry-picks easier by avoiding conflicts between the RCS
id and the interesting changes.
2023-09-06 12:48:15 +00:00
gutteridge 227e5be65f atf-test-case.4: better explain custom metadata properties
Apply upstream change
e8021f3b37

(Only differences to upstream are "meta-data" is spelled consistently
with the rest of the project documentation and the date.)
2023-08-27 19:27:23 +00:00
lukem 58beaa2b43 adapt to ${CC_WNO_MAYBE_UNINITIALIZED}
Use ${CC_WNO_MAYBE_UNINITIALIZED} instead of
the older style more complex expressions.

Remove workarounds if they were for a specific
version of gcc < 10.
2023-06-03 21:31:45 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
gutteridge e7e70c198d atf-check.1 & atf-sh.1: remove references to -h option
These had their -h option removed in the ATF 0.19 release, but these
references in the man pages weren't (mostly) removed upstream until
a later commit (that hasn't been released).
2023-05-10 22:14:54 +00:00
gutteridge bc0862c3a1 atf-run_test.sh: fix spelling of "through"
Reported by Jim Spath in PR misc/57318.
2023-04-03 16:26:50 +00:00
gutteridge d5ef91429e atf-c-api.3: correct ATF_TP_ADD_TC() examples to use "tp" 2023-03-14 00:55:31 +00:00
gson 0033969404 When running an individual test case under isolation, make the test
case count on the tp-start line of the output match the number of test
cases actually executed (one) so that the atf-run output is valid
input to atf-report.
2021-07-08 18:10:52 +00:00
gson e4942545cb Add support for running individual test cases under isolation. 2021-04-10 10:32:57 +00:00
christos 6d3e616a93 If we are running the test as an unprivileged user, hand ownership of the
test directory to that user.
2021-03-28 16:35:37 +00:00
kre c2105d446d Replace a pipe into tr to normalise a var name (convert '.' or '-'
into '_' to meet sh variable name rules) into a shell string processing
loop.

On my test system, this reduces the total elapsed time for the bin/sh ATF
tests from about 109 secs to about 102 (user cpu from 24.5 to 21, sys cpu
from 34 to 30) and the usr.bin/make tests elapsed time from 42.5 to 40
secs (user from a bit over 15 to a bit over 13, and sys from 16+ to 13+).
(Recorded on an AMD64 domU).

These probably exaggerate the effect, as there are a bunch of quite small
tests, which means the ATF overhead (which this change affects) is a greater
proportion of the total test time than for some other tests where most of
the time is spent actually testing.

But I am fairly confident that there will be at least some improvement.

This could be further improved by removing the cmdsub invocation method,
and instead passing the name of a variable containing the string to
normalise (with the result returned in that same var) - but that would
mean altering all the callers as well.   Some other time maybe.
2020-09-10 22:51:10 +00:00
pgoyette 1aba634484 Consistent use of comma in lists. 2020-07-03 19:22:38 +00:00
lukem 894e537a2e fix build of atf .cpp files 2020-06-21 13:59:56 +00:00
fox 9674cee3b8 external/bsd/atf: Suppress -Werror=stringop-truncation error
This logic correctly uses strncpy(3) to fully initialize a fixed-width field, and also ensures
NUL-termination on the next line as other users of the field expect.

Add -Werror=stringop-truncation to prevent build failure, when run with MKSANITIZER=yes.

Error was reported when build.sh was run with MKSANITIZER=yes flag.

Reviewed by: kamil@
2020-06-07 23:09:34 +00:00
christos 8dd45d8c41 Add the system binary paths too since tests use them. 2020-04-23 16:05:15 +00:00
christos 677813249d Allow env - atf-run to work by setting a default minimal path. 2020-03-31 01:02:18 +00:00
christos ee43138c68 remove -std=gnu++98 2020-03-09 20:34:52 +00:00
christos b5a341d9b0 Hack for clang. 2020-01-29 22:40:44 +00:00
christos 7ea1cb15c2 the cast police is looking for me. 2019-10-09 01:18:55 +00:00
mrg f59299f723 give a catch() a variable. gcc 8 is picky:
atf-check.cpp:221:23: error: catching polymorphic type 'class std::runtime_error' by value [-Werror=catch-value=]
2019-10-04 09:19:18 +00:00
mrg 21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
mrg 3bb4805c2b with GCC 7, apply -Wno-error=maybe-uninitialized to parser.cpp.
i don't really understand how to remove this warning, someone else
could though, so feel free to :-)

In file included from /usr/src/external/bsd/atf/dist/tools/parser.cpp:33:0:
/usr/src/external/bsd/atf/dist/tools/parser.hpp: In member function 'tools::parser::token tools::parser::tokenizer<IS>::next() [with IS = std::basic_istream<char>]':
/usr/src/external/bsd/atf/dist/tools/parser.hpp:98:8: warning: '<anonymous>.tools::parser::token::m_line' may be used uninitialized in this function [-Wmaybe-uninitialized]
 struct token {
	^~~~~
2019-02-04 09:40:54 +00:00
mrg d3af2a8373 ATF needs C++98 for now, and GCC 6.4 defaults to C++11.
fix a problem -Werror=misleading-indentation found but has zero
effect on the running code.
2018-02-04 01:41:05 +00:00
maya 0bb4b5384f don't use auto_ptr with memory allocated by C code
silences alloc-dealloc-mismatch warnings from asan

from joerg
2017-11-11 14:16:06 +00:00
christos cd7ac3d44d bump because libstdc++ 2017-10-06 19:19:36 +00:00
kre 7f0357d3ca Add some information learned from experience with using (and abusing)
this API...

While here do some markup improvements (it is amazing what one can
learn from observing a wizard at work!) (which still probably need more work.)
In particular, sh functions are not functions in the mdoc .Fn sense!
(Many places where explicit double quotes were not doing what was intended.)
2017-05-15 04:54:09 +00:00
christos 6833b0c7c2 Print symbolically why the process exited. 2015-12-30 22:23:38 +00:00
christos d182ef4fb3 Work around ksh bug 2015-12-30 22:23:02 +00:00
christos 4a6623896f fix the open error messages to include the right file and strerror 2015-12-04 01:43:58 +00:00
martin fd70cddd86 Wait 10 seconds instead of 1 before killing the helper - otherwise on slow
machines it might not have gotten around to execute the first command at
all (and since it next waits for 42 seconds, 10 seconds is safe).
2015-02-23 08:48:18 +00:00
gson 32627f22be Mark atf/atf-c/macros_test/detect_unused_tests and
atf/atf-c++/macros_test/detect_unused_tests as expected failures
when using versions of GCC where they are known to fail, with a
reference to PR toolchain/49187.
2015-01-22 12:33:35 +00:00
dholland b7b7574d3b Reorg docs, part 1:
Move all the reference manuals to subdirs of /usr/share/doc/reference.
We have subdirs ref1-ref9, corresponding to man page sections 1-9.

Everything that's the reference manual for a program (sections 1, 6,
8), C interface (sections 2, 3), driver or file system (section 4),
format or configuration (section 5), or kernel internal interface
(section 9) belongs in here.

Section 7 is a little less clear: some things that might go in section
7 if they were a man page aren't really reference manuals. So I'm only
putting things in reference section 7 that are (to me) clearly
reference material, rather than e.g. tutorials, guides, FAQs, etc.
This obviously leaves some room for debate, especially without first
editing the docs with this distinction in mind, but if people hate
what I've done things can always be moved again.

Note also that while roff macro man pages traditionally go in section
7, I have put all the roff documentation (macros, tools, etc.) in one
place in reference/ref1/roff. This will make it easier to find and
also easier to edit it into some kind of coherent form.
2014-07-05 19:22:41 +00:00
jmmv ba38cec1e2 Avoid running a helper program for atf-sh as a test.
Should fix failures observed in PR bin/48624.
2014-03-03 19:56:32 +00:00
jmmv 285456ed54 Fix bundling of the atf version into pkgconfig files and atf-version.
Sigh; one more attempt.  This time I'm sure I've verified that the
.pc files contain the right number and that atf-version also outputs
the right stuff...  Both with a clean and non-clean obj directory.

Should fix part of the problems reported in PR bin/48624.
2014-03-02 22:50:13 +00:00
jmmv d9eee690ca Obviously, we want ATFFILE and KYUAFILE to be set to yes... 2014-02-15 22:32:26 +00:00
jmmv 5ecd3e3027 Prevent registering the helper programs as test programs.
Same trick as with atf/test-programs: provide hand-generated Atffile and
Kyuafile files so that the helpers that we build as test programs do not
end up in them.

Reported by gson@.
2014-02-15 19:33:54 +00:00
jmmv 752fe084c0 Fix the bundling of the version number in built files.
Yes, attempting yet another fix at this so that the version number that
gets recorded in the pkgconfig files and inside atf-version really matches
the latest imported version.  Should resolve issues where the built files
get stuck with an older version number during update builds.

This time, I'm trying the same approach I applied in the FreeBSD source
tree, which has been working fine so far across various release imports.
2014-02-15 04:19:46 +00:00
jmmv 70bbcb4b33 Prevent registering the helper programs as test programs.
They are not intended to be run neither by atf-run nor Kyua, and doing so
results in test failures.  The easiest way to do this for now is to just
ship custom Atffile and Kyuafile files.  (This broke because with atf-0.20
we started using the auto-generated versions of these, and due to the way
bsd.test.mk works, these registered the helpers as well.)

Problem reported by martin@.
2014-02-15 04:15:20 +00:00
jmmv 3e03992881 Fix path to libtools.a.
The build would break when we do not use MAKEOBJDIR* but do use OBJMACHINE.
Problem found by B Harder and fix based on patch from NONAKA Kimihiro as
posted on current-users.
2014-02-15 02:02:39 +00:00
jmmv a38e0b43c5 Homogenize reachover build file structure with that of kyua-cli:
- Move the majority of the common build definitions to the top-level
  Makefile.inc and ensure this gets included everywhere.
- Move the bconfig.h file to the top-level directory.
- Add a statically-generated defs.h file instead of creating one
  during the build.  Easier to understand and less chances for things
  to go wrong.
- Make sure all files using ATF_VERSION have the right dependency to
  trigger a rebuild when the value changes.
- Clean up stale -I flags.

This is all mostly for simplicity reasons and to reduce the cognitive
load required to understand the build of the atf and kyua-* packages.

I have tested this with both MKKYUA=no/yes and non-clean/clean builds
so hopefully I got the details right.  But if not, let me know please.
2014-02-12 04:08:31 +00:00
jmmv 5506dc87b2 Remove unused reachover Makefiles.
The content of these was subsumed into the sibling 'tools' subdirectory
during the import of atf-0.19.
2014-02-12 03:47:21 +00:00
jmmv 646fe152bb Remove portability-related guards from the atf tools.
Just assume we are building for NetBSD given that the tools code is now
owned by the NetBSD tree.
2014-02-11 18:13:45 +00:00
jmmv 892cb06d80 Remove revision.h and associated complexity from atf-version.
Arguably, this was never needed and only made the code and the build system
more complex for no real reason.
2014-02-11 18:07:30 +00:00
jmmv fd47ea3b40 Stop using bconfig.h in the tools code.
Just assume the code is being built for NetBSD for simplicity reasons.
2014-02-11 17:28:20 +00:00
jmmv ad23a81712 Remove defs.hpp.
Because we now own the 'tools' subdirectory in the tree, we can yank some
of the upstream autoconf-related complexity.  Start doing so by removing
defs.hpp and using the real compiler attributes where necessary.
2014-02-11 16:31:38 +00:00
jmmv 25347c603f Update reachover build files for atf-0.20. 2014-02-11 16:11:28 +00:00
jmmv 6b0aadc835 Merge atf-0.20.
The upstream Atffiles are gone so we will just rely on our automatic
generation of such files from bsd.test.mk.
2014-02-11 16:10:40 +00:00
jmmv 940a202b3a Import atf-0.20:
Experimental version released on February 7th, 2014.

This is the first release without the code for the deprecated tools.  If
you require such code, please fetch a copy of the 0.19 release and extract
the 'tools' directory for your own consumption.

* Removed the deprecated tools.  This includes atf-config, atf-report,
  atf-run and atf-version.
2014-02-11 16:07:06 +00:00
jmmv fd82d5173d Update for atf 0.19. 2014-02-09 14:02:39 +00:00