1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-27 00:16:03 +02:00
Commit Graph

45 Commits

Author SHA1 Message Date
Jack O'Connor 09546a677d include example.c 2020-10-20 12:51:30 -04:00
Jack O'Connor 3d212291b9 add cross_test.sh for the C bindings
This will let us add big endian testing to CI for our C code. (We were
already doing it for our Rust code.)

This is adapted from test_vectors/cross_test.sh. It works around the
limitation that the `cross` tool can't reach parent directories. It's an
unfortunate hack, but at least it's only for testing. It might've been
less hacky to use symlinks for this somehow, but I worry that would
break things on Windows, and I don't want to have to add workarounds for
my workarounds.
2020-09-29 16:48:18 -04:00
Jack O'Connor cc04130eaa cover the no_sse2 flags in CI testing 2020-09-02 12:23:49 -04:00
Jack O'Connor 5b22bf57c8 add i586-unknown-linux-musl as a test target
Samuel noticed that rustc seems to assume (incorrectly?) that all i686
targets support SSE2, but it doesn't make that assumption for i586.
2020-08-31 18:25:38 -04:00
Jack O'Connor a79fec7e39 fix a build break on x86 targets without guaranteed SSE2 support
This is quite hard to trigger, because SSE2 has been guaranteed for a
long time. But you could trigger it this way:

    rustup target add i686-unknown-linux-musl
    RUSTFLAGS="-C target-cpu=i386" cargo build --target i686-unknown-linux-musl

Note a relevant gotcha though: The `cross` tool will not forward
environment variables like RUSTFLAGS to the container by default, so if
you're testing with `cross` you'll need to use the `rustc` command to
explicitly pass the flag, as I've done here in ci.yml. (Or you could
create a `Cross.toml` file, but I don't want to commit one of those if I
can avoid it.)
2020-08-31 18:25:38 -04:00
Jack O'Connor e4703ac170 rename the C Makefile to Makefile.testing 2020-07-20 09:47:38 -04:00
Jack O'Connor dc2a79d266 add newline and backslash escaping to b3sum output
As proposed in
https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-623153164

This brings b3sum behavior close to md5sum. All occurrences of backslash
are replaced with "\\", and all occurrences of (Unix) newline are
replaced with "\n". In addition, any line containing these escapes has a
single "\" prepended to the front.

Filepaths were already being converted to UTF-8 with to_string_lossy(),
but this commit adds an extra warning when that conversion is in fact
lossy (because the path is not valid Unicode). This new warning is
printed to stdout, with the goal of deliberately breaking --check (which
is not yet implemented) in this case.
2020-05-05 00:59:31 -04:00
Jack O'Connor ba468fbb4f build b3sum binaries in CI for new tags
These configs and code are adapted from the CI workflow in
https://github.com/oconnor663/blake3-py, especially the
upload_github_release_asset.py script, which is copied verbatim.
2020-04-28 11:04:29 -04:00
Jack O'Connor 370ba3644a print the compiler version in CI, for help with debugging 2020-04-11 23:03:32 -04:00
Jack O'Connor e3069da68e only run CI on branches and PRs, not tags 2020-04-02 10:23:46 -04:00
Jack O'Connor b8cdcb1f84 automatically fall back to the pure Rust build
There are two scenarios where compiling AVX-512 C or assembly code might
not work:

1. There might not be a C compiler installed at all. Most commonly this
   is either in cross-compiling situations, or with the Windows GNU
   target.
2. The installed C compiler might not support e.g. -mavx512f, because
   it's too old.

In both of these cases, print a relevant warning, and then automatically
fall back to using the pure Rust intrinsics build.

Note that this only affects x86 targets. Other targets always use pure
Rust, unless the "neon" feature is enabled.
2020-04-01 19:13:15 -04:00
Jack O'Connor 2dff29cf0e turn all compiler warnings into errors in CI 2020-03-31 16:02:57 -04:00
Jack O'Connor 152740578e add testing-only flags to disable individual instruction sets
This lets CI test a wider range of possible SIMD support settings.
2020-03-29 23:12:47 -04:00
Jack O'Connor e06a0f255a refactor the Cargo feature set
The biggest change here is that assembly implementations are enabled by
default.

Added features:
- "pure" (Pure Rust, with no C or assembly implementations.)

Removed features:
- "c" (Now basically the default.)

Renamed features;
- "c_prefer_intrinsics" -> "prefer_intrinsics"
- "c_neon" -> "neon"

Unchanged:
- "rayon"
- "std" (Still the only feature on by default.)
2020-03-29 18:02:03 -04:00
Jack O'Connor 96c36d5df9 add more --release mode testing 2020-03-29 01:01:30 -04:00
Jack O'Connor be4e7babee print instruction set support quietly 2020-03-28 19:51:54 -04:00
Jack O'Connor f77c8ffd7c print out instruction set support in CI 2020-03-28 19:30:28 -04:00
Jack O'Connor eb50d82f16 add release assembly tests 2020-03-28 19:15:25 -04:00
Jack O'Connor 4feadee6bb disable fail-fast for cross tests too 2020-03-24 16:45:33 -04:00
Jack O'Connor fcc14c8c1b more file renaming, use underscores more consistently 2020-02-12 18:41:41 -05:00
Erik Johansson 0281f1ae16 Rename assembly files (blake3-* -> blake3_*)
This gives the assembly files the same prefix as the intrinsics files which
simplifies building when the build system should pick between the assembly and
the intrinsics files.
2020-02-12 23:08:44 +01:00
Jack O'Connor 1c4d7fdd8d add test_asm to the C Makefile 2020-02-12 13:12:05 -05:00
Jack O'Connor b8a1d2d982 integrate assembly implementations into blake3_c_rust_bindings 2020-02-12 10:23:17 -05:00
Jack O'Connor efbfa0463c integrate assembly implementations into the blake3 crate 2020-02-12 10:23:17 -05:00
Jack O'Connor ec34043b45 add cross testing on i686 to CI 2020-02-11 13:58:26 -05:00
Jack O'Connor c0a43e5fb8 add the Windows GNU toolchain to CI 2020-02-07 13:46:42 -05:00
Jack O'Connor ca62c4724d stop skipping all other builds when one CI build fails 2020-02-06 18:43:50 -05:00
Jack O'Connor 4a92e8eeb1 add the reference impl doc test to CI 2020-01-20 16:36:30 -05:00
Jack O'Connor 4021636022 test the BLAKE3_NO_* vars in CI 2020-01-20 16:19:16 -05:00
Jack O'Connor 84c26670bf add blake3_c_rust_bindings for testing and benchmarking 2020-01-16 16:09:42 -05:00
Jack O'Connor 9096249e09 enable CI on pull requests
As per instructions at:
https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows
2020-01-10 10:22:12 -05:00
Jack O'Connor a0d7b4f3f8 merge the C code's ci.yml into the top level one
CI is not currently working due to quota issues, so I'll need to check
that this is actually working later.
2020-01-09 09:48:52 -05:00
Jack O'Connor d963fe18f3 test release mode in CI
As part of this, get rid of the BLAKE3_FUZZ_ITERATIONS variable. I
wasn't using it anywhere, and it was leading to some compiler warnings
in --no-default-features mode.
2019-12-13 13:15:48 -05:00
Jack O'Connor 9bf1020213 make the "c_avx512" feature a no-op on non-x86
This lets us enable it by default in b3sum.
2019-12-12 15:13:04 -05:00
Jack O'Connor 7cf6b8f174 initial version of b3sum 2019-12-12 13:18:57 -05:00
Jack O'Connor 59752de9bd fix syntax errors in ci.yml 2019-12-11 23:21:25 -05:00
Jack O'Connor 6823655aed run the test vectors on cross tests (ARM, MIPS) on CI 2019-12-11 23:19:58 -05:00
Jack O'Connor a3be434d28 fix bench tests running in the wrong directory 2019-12-11 22:34:03 -05:00
Jack O'Connor dd3a72fb9f run test vectors and bench tests in the regular CI test matrix 2019-12-11 22:30:19 -05:00
Jack O'Connor c81d5c2522 test against test_vectors.json in CI 2019-12-11 10:50:18 -05:00
Jack O'Connor 4ca4c60694 add `cargo +nightly test --benches` to CI 2019-12-10 14:57:46 -05:00
Jack O'Connor cbaf350c05 typo in ci.yml 2019-12-09 22:13:48 -05:00
Jack O'Connor 8c4cd710c3 set ARMv7 NEON compiler flags automatically 2019-12-09 21:52:24 -05:00
Jack O'Connor 61b34f35b4 fix a syntax error in ci.yml 2019-12-09 21:25:36 -05:00
Jack O'Connor 98dd9cbbf1 add ci.yml 2019-12-09 21:20:04 -05:00