From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14893 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Cross-compiling test flow for libc-test Date: Thu, 31 Oct 2019 09:19:26 -0400 Message-ID: <20191031131926.GL16318@brightrain.aerifal.cx> References: <20191031060405.GA22068@APC301.andestech.com> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="153606"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: musl@lists.openwall.com, alankao@andestech.com To: Ruinland ChuanTzu Tsai Original-X-From: musl-return-14909-gllmg-musl=m.gmane.org@lists.openwall.com Thu Oct 31 14:19:52 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iQAMi-000dqf-JV for gllmg-musl@m.gmane.org; Thu, 31 Oct 2019 14:19:52 +0100 Original-Received: (qmail 24070 invoked by uid 550); 31 Oct 2019 13:19:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 24052 invoked from network); 31 Oct 2019 13:19:49 -0000 Content-Disposition: inline In-Reply-To: <20191031060405.GA22068@APC301.andestech.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14893 Archived-At: On Thu, Oct 31, 2019 at 02:04:06PM +0800, Ruinland ChuanTzu Tsai wrote: > Hi, > sorry for sending this email out of the blue. > > I'm wondering whether there are any (official) guides about how to do > cross-compiling tests for libc-test ? > > If I understand the Makefile of libc-test correctly, it will compile > test units and then execute those tests on _host_ platform right away. > > Somehow, whilst I was cross-testing glibc, there's a script, > cross-test-ssh.sh, which could be used with `test-wrapper` hook to ex- > ecute those freshly compiled test units on a hetero-architecture platf- > orm via ssh connections. > > If there's no such mechanism for libc-test at this time being, then I'm > willing to develope one. > > That being said, I'm curious about how's the attitude which maintainers > take toward this kind of testing flow. I don't have any sort of automated CI setup I use at present. Generally I run or ask others for results from running tests on archs when changes potentially affecting them have been made, and I do this myself on x86 and sometimes a few other archs, especially before releases where any invasive change has been made. Ability to auto-deploy and run tests across a number of archs would be nice. I don't think anyone has a sufficient set of physical machines setup for this, and that's a big barrier to entry, so what might be a better setup is launching the tests via qemu system-level emulation, setting up a virtfs root to pass into each guest and from which to read the output. Note: qemu user-level emulation will necessarily fail lots of the tests due to problems with how qemu emulates (or rather doesn't; it just passes them thru) signals and how that interacts with thread cancellation. But system-level should be good, and could even let you test different setups that will exercise different code paths in musl like enabling/disabling vdso, or old kernels lacking new syscalls. One thing I would encourage for any automated/CI type testing is layering. Rather than trying to make libc-test into an infrastructure-dependent framework itself, use it as a tool that gets pulled and used. > Aside from cross-testing, I also wonder the status of testing reports > for releases on currently supported CPU architectures. > As I was running libc-test on x86_64, some of functional and regression > tests fail. Here's a list of what I expect to fail. It should probably be turned into a page on the wiki or documented somewhere more visible than this mailing list post: api/main fails due to some confstr and pathconf item macros we don't yet define (we were waiting on glibc to assign numbers so we could align them). functional/strptime fails due to unimplemented functionality. functional/utime may fail due to time_t being 32-bit or kernel lacking time64 support. math/* may fail due to very minor status flag or precision issues. musl/pleval fails in the dynamic-linked version only because it references an internal-use symbol which is hidden in modern musl; the static version successfully gets the symbol. regression/malloc-brk-fail fails conditionally on kernel behavior; the failure is not a problem in musl or the kernel but rather in the test code's ability to setup the right VM space state needed to perform the actual test, which is hard to do. Otherwise, any failures are unexpected, I think. > Is there a validating rule (e.g. funcional/xxx and regression/yyy must > pass) for code checking-in which I can enforce locally before > submitting patches here ? You could turn the above into a rule, but for most things the coverage is not sufficient to tell you that a change is likely-valid. Since musl source is not highly coupled, generally you'll at bet get indication of problem from test files that are testing the specific component you modified, or where the test setup itself depends on functionality you modified. At present I think the tests are most valuable for: 1. preparing ports to new archs, where errors in bits headers or other arch-specific files are often caught by something not working. 2. documenting conformance subtleties and ways to detect them, to avoid regressions if the relevant component is modified and to expose related bugs in other libc implementations and get them fixed. But if you're working on (modifying, or just reading) a component that doesn't seem to have test coverage, writing and submitting tests would be very helpful. Rich