Skip to content

Commit

Permalink
Update to CRoaring 0.9.3
Browse files Browse the repository at this point in the history
Also, just download the pre-built amalgamation, and autmatically re-run
bindgen afterward in the justfile so I stop forgetting.
  • Loading branch information
Dr-Emann committed Feb 5, 2023
1 parent 68f13e0 commit 8506d57
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 23 deletions.
4 changes: 2 additions & 2 deletions croaring-sys/CRoaring/bindgen_bundled_version.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* automatically generated by rust-bindgen 0.63.0 */

pub const ROARING_VERSION: &[u8; 6usize] = b"0.9.2\0";
pub const ROARING_VERSION: &[u8; 6usize] = b"0.9.3\0";
pub const ROARING_VERSION_MAJOR: _bindgen_ty_1 = 0;
pub const ROARING_VERSION_MINOR: _bindgen_ty_1 = 9;
pub const ROARING_VERSION_REVISION: _bindgen_ty_1 = 2;
pub const ROARING_VERSION_REVISION: _bindgen_ty_1 = 3;
pub type _bindgen_ty_1 = ::std::os::raw::c_uint;
#[doc = " Roaring arrays are array-based key-value pairs having containers as values\n and 16-bit integer keys. A roaring bitmap might be implemented as such."]
#[repr(C)]
Expand Down
4 changes: 2 additions & 2 deletions croaring-sys/CRoaring/roaring.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!!
// Created by amalgamation.sh on 2023-02-03T04:20:39Z
// Created by amalgamation.sh on 2023-02-03T23:41:28Z

/*
* The CRoaring project is under a dual license (Apache/MIT).
Expand Down Expand Up @@ -5425,7 +5425,7 @@ static inline container_t *container_lazy_or(
CAST_run(result));
*result_type = RUN_CONTAINER_TYPE;
// we are being lazy
result = convert_run_to_efficient_container(
result = convert_run_to_efficient_container_and_free(
CAST_run(result), result_type);
return result;

Expand Down
6 changes: 3 additions & 3 deletions croaring-sys/CRoaring/roaring.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!!
// Created by amalgamation.sh on 2023-02-03T04:20:39Z
// Created by amalgamation.sh on 2023-02-03T23:41:28Z

/*
* The CRoaring project is under a dual license (Apache/MIT).
Expand Down Expand Up @@ -58,11 +58,11 @@
// /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand
#ifndef ROARING_INCLUDE_ROARING_VERSION
#define ROARING_INCLUDE_ROARING_VERSION
#define ROARING_VERSION "0.9.2"
#define ROARING_VERSION "0.9.3"
enum {
ROARING_VERSION_MAJOR = 0,
ROARING_VERSION_MINOR = 9,
ROARING_VERSION_REVISION = 2
ROARING_VERSION_REVISION = 3
};
#endif // ROARING_INCLUDE_ROARING_VERSION
/* end file include/roaring/roaring_version.h */
Expand Down
2 changes: 1 addition & 1 deletion croaring-sys/CRoaring/roaring.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!!
// Created by amalgamation.sh on 2023-02-03T04:20:39Z
// Created by amalgamation.sh on 2023-02-03T23:41:28Z

/*
* The CRoaring project is under a dual license (Apache/MIT).
Expand Down
2 changes: 1 addition & 1 deletion croaring/src/bitmap/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Bitmap {
const _: () = assert!(
ffi::ROARING_VERSION_MAJOR == 0
&& ffi::ROARING_VERSION_MINOR == 9
&& ffi::ROARING_VERSION_REVISION == 2
&& ffi::ROARING_VERSION_REVISION == 3
);
ffi::roaring_free(p as *mut _);
result
Expand Down
2 changes: 1 addition & 1 deletion croaring/src/bitmap/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Drop for Bitmap {
const _: () = assert!(
ffi::ROARING_VERSION_MAJOR == 0
&& ffi::ROARING_VERSION_MINOR == 9
&& ffi::ROARING_VERSION_REVISION == 2
&& ffi::ROARING_VERSION_REVISION == 3
);

// Per /~https://github.com/RoaringBitmap/CRoaring/blob/4f8dbdb0cc884626b20ef0cc9e891f701fe157cf/cpp/roaring.hh#L182
Expand Down
2 changes: 1 addition & 1 deletion croaring/src/bitmap/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<'a> BitmapView<'a> {
const _: () = assert!(
ffi::ROARING_VERSION_MAJOR == 0
&& ffi::ROARING_VERSION_MINOR == 9
&& ffi::ROARING_VERSION_REVISION == 2
&& ffi::ROARING_VERSION_REVISION == 3
);

assert!(!p.is_null());
Expand Down
21 changes: 9 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ lint:
test:
cargo test

# Fetch the tagged version from CRoaring, and update the c source amalgamation
update_croaring version:
#!/usr/bin/env bash
set -euxo pipefail

tmpdir=$(mktemp -d)
trap "rm -rf '$tmpdir'" EXIT
cd $tmpdir || exit 1

git clone --depth=1 --branch 'v{{version}}' "/~https://github.com/RoaringBitmap/CRoaring.git" .
./amalgamation.sh
cp roaring.{h,hh,c} '{{croaring_source}}'
croaring_release_url_base := "/~https://github.com/RoaringBitmap/CRoaring/releases/download"

# Fetch the c source amalgamation from a tagged CRoaring release (like `just update_croaring 0.9.3`)
update_croaring version: && bindgen
rm -f '{{croaring_source}}/roaring.c' '{{croaring_source}}/roaring.h' '{{croaring_source}}/roaring.hh'
wget -P '{{croaring_source}}' \
'{{croaring_release_url_base}}/v{{version}}/roaring.c' \
'{{croaring_release_url_base}}/v{{version}}/roaring.h' \
'{{croaring_release_url_base}}/v{{version}}/roaring.hh'

# Regenerate bindgen bindings
bindgen:
Expand All @@ -39,4 +36,4 @@ bindgen:
test_serialization_files:
cd croaring/tests/data/ && \
cc create_serialization.c {{croaring_source / 'roaring.c'}} -I {{croaring_source}} -Wall -o create_serialization && \
./create_serialization
./create_serialization

0 comments on commit 8506d57

Please sign in to comment.