Commit Graph

44 Commits

Author SHA1 Message Date
Lasse Collin 3faf4e8079 CI: Don't omit crc32 from the list with CMake anymore
XZ_CHECKS accepts it but works without too.
2024-06-24 18:15:58 +03:00
Lasse Collin 1bf83cded2 CI: Workaround buggy config.guess on Ubuntu 22.04LTS and 24.04LTS
Check for the wrong triplet from config.guess and override it with
the --build option on the configure command line. Then i386 assembly
autodetection will work.

These Ubuntu versions (and as of writing, also Debian unstable)
ship config.guess version 2022-01-09 which contains a bug that
was fixed in version 2022-05-08. It results in a wrong configure
triplet when using CC="gcc -m32" to build i386 binaries.

Upstream fix:
https://git.savannah.gnu.org/cgit/config.git/commit/?id=f56a7140386d08a531bcfd444d632b28c61a6329

More information:
https://mail.gnu.org/archive/html/config-patches/2022-05/msg00003.html
2024-06-24 18:15:58 +03:00
Lasse Collin 0c1e6d900b CI: Let CMake use the CC environment variable
CC from environment is used to initialize CMAKE_C_COMPILER so
setting CMAKE_C_COMPILER explicitly isn't needed.

The syntax in ci_build.bash was broken in case one wished to put
spaces in CC.
2024-06-24 18:15:58 +03:00
Lasse Collin 9ce0866b07 CI: Update to the new renamed options in CMakeLists.txt 2024-06-21 00:47:27 +03:00
Lasse Collin e7a42cda7c Fix version.sh compatiblity with Solaris
The ancient /bin/tr on Solaris doesn't support '\n'.
With /usr/xpg4/bin/tr it works but it might not be in PATH.

Another problem was that sed was given input that didn't have a newline
at the end. Text files must end with a newline to be portable.

Fix both problems:

  - Handle multiline input within sed itself to avoid one tr invocation.
    The default sed even on Solaris does understand \n.

  - Use octals in tr -d. \012 works for ASCII "line feed", it's even
    used as an example in the Solaris man page. But we must strip
    also ASCII "carriage return" \015 and EBCDIC "next line" \025.
    The EBCDIC case got handled with \n previously. Stripping \012
    and \015 on EBCDIC system won't matter as those control chars
    won't be present in the string in the first place.

An awk-based solution could be an alternative but it might need
special casing on Solaris to used nawk instead of awk. The changes
in this commit are smaller and should have a smaller risk for
regressions. It's also possible that version.sh will be dropped
entirely at some point.
2024-06-03 23:06:10 +03:00
Lasse Collin bb90e1f66d license-check.sh: Fix reporting of unclear license info
The main feature was broken because an old variable name hadn't
been updated to match the rest of the script.
2024-06-03 11:44:28 +03:00
Lasse Collin d28a4b2520 license-check.sh: Use '--' with slightly untrusted filenames
Names from git ls-files should be safe but if one runs it on
a tree without the .git dir and there are extra files, it's
safer to have the end of arguments marked with '--'.
2024-05-28 12:18:09 +03:00
Lasse Collin fda0ec862a license-check.sh: Use xargs -0 instead of -d
Neither are in POSIX but -0 is much more portable in practice.

Despite the old comment, the grep usage should be portable already.
2024-05-28 12:18:09 +03:00
Lasse Collin f3434ecfcb Add build-aux/license-check.sh
This helps in spotting files that lack SPDX license identifier
and which haven't been explicitly white listed either. The script
requires the .git directory to be present as only the files that
are in the Git repository are checked.

XZ Utils isn't FSFE REUSE compliant for now.
2024-05-22 15:21:53 +03:00
Ryan Carsten Schmidt 97f0ee0f1f
CI: Use only the active CPUs on macOS
hw.ncpu counts all CPUs including inactive ones. hw.activecpu counts
only the active CPUs.
2024-04-12 19:31:13 -05:00
Sam James 73f629e321 ci: rename ci_build.sh -> ci_build.bash
We discussed the name and it's less cognitive load to just call it '.bash'
so you don't have an immediate question about if bashisms are OK.
2024-04-11 00:15:35 +03:00
Sam James 8709407a9e ci: build in parallel by default 2024-04-11 00:15:35 +03:00
Sam James 65bf7e0a1c ci: default to -O2
We need this for when we're passing sanitizer flags or -gdwarf-4 for Clang
with Valgrind. Just always start with -O2 if CFLAGS isn't set in the
environment and append what was passed on the command line.
2024-04-11 00:15:35 +03:00
Sam James bc899f9e07 ci: make automake's test runner verbose on failures
This is a lot easier to work with than the save-logs thing the action
tries to do...
2024-04-11 00:15:35 +03:00
Sam James 6c095a98fb ci: test Valgrind
Using `--trace-children=yes` has a trade-off here, as it makes
`test_scripts.sh` pretty slow when calling various non-xz utilities.

But I also feel like it's not useless to have Valgrind used there and it's
not easy to exclude Valgrind just for that one test...

I did consider using AX_VALGRIND_CHECK [0][1] but I couldn't get it working
immediately with some conditionally-built tests and I wondered if it was
worth spending time on at least while we're debating xz's future build
system situation.

[0] https://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html
[1] https://tecnocode.co.uk/2014/12/23/automatically-valgrinding-code-with-ax_valgrind_check/
2024-04-11 00:15:35 +03:00
Lasse Collin 986865ea2f CI: Remove ifunc support. 2024-04-09 18:22:27 +03:00
Lasse Collin 22af94128b Add SPDX license identifier into 0BSD source code files. 2024-02-14 18:31:16 +02:00
Lasse Collin 689e0228ba Change most public domain parts to 0BSD.
Translations and doc/xz-file-format.txt and doc/lzma-file-format.txt
were not touched.

COPYING.0BSD was added.
2024-02-14 18:31:12 +02:00
Jia Tan a2dd2dc8e5 CI: Use RISC-V filter when building with BCJ support. 2024-01-23 23:55:44 +08:00
Jia Tan db2b4aa068 CI: Allow ci_build.sh to set a different C compiler. 2023-11-30 20:09:46 +08:00
Jia Tan b1408987ea CI: Allow disabling the sandbox in ci_build.sh. 2023-10-24 00:15:39 +08:00
Lasse Collin e8c2203b2c build-aux/manconv.sh: Fix US-ASCII and UTF-8 output.
groff defaults to SGR escapes. Using -P-c passes -c to grotty
which restores the old behavior. Perhaps there is a better way to
get pure plain text output but this works for now.
2023-08-02 15:19:43 +03:00
Jia Tan a048f472cd CI: Update ci_build.sh CMake to always make Unix Makefiles.
The default for many of the MSYS2 environments is for CMake to create
Ninja build files. This would complicate the build script since we would
need a different command to run the tests. Its simpler to always use
Unix Makefiles so that "make test" is always a usable target for
testing.
2023-07-28 21:54:22 +08:00
Jia Tan 556536a352 CI: Add argument to ci_build.sh to pass flags to autogen.sh. 2023-07-22 18:13:43 +08:00
Jia Tan 45e250a9e9 CI: Add test with -fsanitize=address,undefined.
ci_build.sh was updated to accept disabling of __attribute__ ifunc
and CLMUL. This will allow -fsanitize=address to pass because ifunc
is incompatible with -fsanitize=address. The CLMUL implementation has
optimizations that potentially read past the buffer and mask out the
unwanted bytes.

This test will only run on Autotools Linux.
2023-06-28 23:59:47 +08:00
Jia Tan 16b81a057a CI: ci_build.sh allows configuring small build. 2023-04-25 20:05:26 +08:00
Jia Tan d0faa85df5 CI: Tests for disabling threading on CMake builds. 2023-03-29 23:46:43 +08:00
Jia Tan 8be5cc3b13 CI: Removes CMakeCache.txt between builds.
If the cache file is not removed, CMake will not reset configurations
back to their default values. In order to make the tests independent, it
is simplest to purge the cache. Unfortunatly, this will slow down the
tests a little and repeat some checks.
2023-03-29 23:46:43 +08:00
Jia Tan 4fabdb269f CI: ci_build.sh allows CMake features to be configured.
Also included various clean ups for style and helper functions for
repeated work.
2023-03-24 23:08:24 +08:00
Jia Tan cf3d1f130e CI: Change ci_build.sh to use bash instead of sh.
This script is only meant to be run as part of the CI build/test process
on machines that are known to have bash (Ubuntu and MacOS). If this
assumption changes in the future, then the bash specific commands will
need to be replaced with a more portable option. For now, it is
convenient to use bash commands.
2023-03-24 20:06:33 +08:00
Jia Tan 2c1341f4fa CI: Add quotes around variables in a few places. 2023-02-01 21:47:35 +08:00
Jia Tan 3a401b0e0c CI: Upload test logs as artifacts if a test fails. 2023-02-01 21:47:35 +08:00
Jia Tan dd1c113574 CI: Enable --config-cache in autotool builds.
If CFLAGS are set in a build, the cache must be cleared with
"make distclean", or by deleting the cache file.
2023-01-18 21:51:43 +08:00
Jia Tan 4110a998b8 CI: Allow disabling Native Language Support. 2023-01-12 23:09:03 +08:00
Jia Tan 0dec634e70 CI: Only run autogen.sh if it has not already run. 2023-01-12 23:02:20 +08:00
Jia Tan 32287dc8de CI: Allow disabling shared library in autotools builds. 2023-01-12 22:58:36 +08:00
Jia Tan 77d1ebcc99 CI: Improve Usage readability and add -h option. 2023-01-12 22:44:18 +08:00
Jia Tan 923eb689a4 CI/CD: Enables warnings as errors in autotool build.
This will help us catch warnings and potential bugs in builds that are
not often tested by us.
2023-01-11 00:51:01 +08:00
Jia Tan feae5528a3 CI/CD: Add -f argument to set CFLAGS in ci_build.sh.
For now, the suggested option is for -m32 only, but this can be updated
later if other flags are deemed useful.
2023-01-11 00:48:35 +08:00
Jia Tan 4de35fd6b5 CI/CD: Add new -p (PHASE) argument to ci_build.sh
The new PHASE argument can be build, test, or all. all is the default.
This way, the CI/CD script can differentiate between the build and test
phases to make it easier to track down errors when they happen.
2023-01-07 21:15:14 +08:00
Jia Tan 9f05c27a58 CI/CD: Create initial version of CI/CD workflow.
The CI/CD workflow will only execute on Ubuntu and MacOS latest version.
The workflow will attempt to build with autotools and CMake and execute
the tests. The workflow will run for all pull requests and pushes done
to the master branch.
2022-12-30 23:34:31 +08:00
Lasse Collin a24518971c Build: Fix a CR+LF problem when running autoreconf -fi on OS/2. 2015-02-26 20:46:14 +02:00
Lasse Collin 9166682dc6 Create the PDF versions of the man pages better. 2010-09-28 11:40:12 +03:00
Lasse Collin 17d3c61edd Move version.sh to build-aux. 2010-09-28 10:59:53 +03:00