Skip to content

Commit 38b9b3d

Browse files
authored
more cleanup/improvements (zshipko#154)
* add ocaml 5.2 to ci * update ndarray * disable fail-fast on ci for now * clippy * update setup-ocaml * ci * ci * ci * ci
1 parent 3b637f0 commit 38b9b3d

File tree

10 files changed

+31
-19
lines changed

10 files changed

+31
-19
lines changed

.github/workflows/ocaml.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ on:
99

1010

1111
jobs:
12-
build:
12+
build-ubuntu:
1313
strategy:
14-
fail-fast: true
14+
fail-fast: false
1515
matrix:
16-
os: [macos-latest, ubuntu-latest]
1716
ocaml-compiler:
1817
[
19-
"5.1.0",
18+
"5.2.0",
19+
"5.1.1",
2020
"5.0.0",
2121
"4.14.1",
2222
"4.13.1",
2323
"4.12.1",
24-
"4.11.0",
25-
"4.10.0",
24+
#"4.11.2",
25+
"4.10.2",
2626
]
27-
runs-on: ${{ matrix.os }}
27+
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout code
3030
uses: actions/checkout@v3
@@ -35,9 +35,13 @@ jobs:
3535
path: "~/.opam"
3636
key: ocaml-rs-opam-${{ matrix.ocaml-compiler }}-${{ matrix.os }}
3737
- name: Use OCaml ${{ matrix.ocaml-compiler }}
38-
uses: ocaml/setup-ocaml@v2
38+
uses: ocaml/setup-ocaml@v3
3939
with:
4040
ocaml-compiler: ${{ matrix.ocaml-compiler }}
41+
- if: matrix.os == 'macos-latest'
42+
run: brew install zstd
43+
- if: matrix.os == 'ubuntu-latest'
44+
run: sudo apt install libzstd-dev
4145
- run: opam install dune ppx_inline_test
4246
- name: Run OCaml tests
4347
run: opam exec -- dune runtest --root=./test

.github/workflows/rust.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ jobs:
1212
name: Build
1313
runs-on: ${{ matrix.os }}
1414
strategy:
15-
fail-fast: true
15+
fail-fast: false
1616
matrix:
1717
os: [macos-latest, ubuntu-latest]
1818
ocaml-compiler:
1919
[
20+
"5.2.0",
21+
"5.1.1",
2022
"5.0.0",
2123
"4.14.1",
2224
"4.13.1",
2325
"4.12.1",
24-
"4.11.0",
25-
"4.10.0",
26+
#"4.11.2",
27+
"4.10.2",
2628
]
2729

2830
steps:
@@ -37,10 +39,15 @@ jobs:
3739
key: ocaml-rs-opam-${{ matrix.ocaml-compiler }}-${{ matrix.os }}
3840

3941
- name: Use OCaml ${{ matrix.ocaml-compiler }}
40-
uses: ocaml/setup-ocaml@v2
42+
uses: ocaml/setup-ocaml@v3
4143
with:
4244
ocaml-compiler: ${{ matrix.ocaml-compiler }}
4345

46+
- if: matrix.os == 'macos-latest'
47+
run: brew install zstd
48+
- if: matrix.os == 'ubuntu-latest'
49+
run: sudo apt install libzstd-dev
50+
4451
- name: Install mdbook
4552
uses: baptiste0928/cargo-install@v2
4653
with:

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ocaml-sys = {path = "./sys", version = ">=0.23"}
1818
ocaml-boxroot-sys = {version = "0.3.1"}
1919
ocaml-derive = {path = "./derive", optional = true, version = "^1.0.0-beta.5"}
2020
cstr_core = {version = "0.2", optional = true}
21-
ndarray = {version = "^0.15.1", optional = true}
21+
ndarray = {version = "^0.16.1", optional = true}
2222

2323
[features]
2424
default = ["derive"]

derive/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub fn ocaml_sig(attribute: TokenStream, item: TokenStream) -> TokenStream {
142142
/// - Wraps the function body using `ocaml::body`
143143
/// - Automatic type conversion for arguments/return value (including Result types)
144144
/// - Defines a bytecode function automatically for functions that take more than 5 arguments. The
145-
/// bytecode function for `my_func` would be `my_func_bytecode`
145+
/// bytecode function for `my_func` would be `my_func_bytecode`
146146
/// - Allows for an optional ident argument specifying the name of the `gc` handle parameter
147147
#[proc_macro_attribute]
148148
pub fn ocaml_func(attribute: TokenStream, item: TokenStream) -> TokenStream {

src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ pub(crate) mod bigarray_ext {
656656
if unsafe { (*ba).is_fortran() } {
657657
shape.f()
658658
} else {
659-
shape.into_shape()
659+
shape.into_shape_with_order()
660660
}
661661
}
662662
}

src/value.rs

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ impl Value {
175175
let (used, max) = cfg.unwrap_or((0, 1));
176176
Value::new(sys::caml_alloc_final(
177177
core::mem::size_of::<T>(),
178+
#[allow(clippy::missing_transmute_annotations)]
178179
core::mem::transmute(finalizer),
179180
used,
180181
max,

sys/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn run() -> std::io::Result<()> {
145145
let minor = split[1].parse::<usize>().unwrap();
146146

147147
if major >= 5 || cfg!(feature = "ocaml5") {
148-
println!("cargo:rustc-cfg=ocaml5");
148+
println!("cargo:rustc-cfg=feature=\"ocaml5\"");
149149
}
150150

151151
#[cfg(feature = "link")]

sys/src/state.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub type backtrace_slot = *mut ::core::ffi::c_void;
2727

2828
#[repr(C)]
2929
#[derive(Debug)]
30-
#[cfg(not(ocaml5))]
30+
#[cfg(not(feature = "ocaml5"))]
3131
pub struct caml_domain_state {
3232
pub _young_ptr: *mut Value,
3333
pub _young_limit: *mut Value,
@@ -78,7 +78,7 @@ pub struct caml_domain_state {
7878

7979
#[repr(C)]
8080
#[derive(Debug)]
81-
#[cfg(ocaml5)]
81+
#[cfg(feature = "ocaml5")]
8282
pub struct caml_domain_state {
8383
pub _young_limit: core::sync::atomic::AtomicUsize,
8484
pub _young_ptr: *mut Value,
File renamed without changes.

test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["staticlib", "cdylib"]
99
[dependencies]
1010
ocaml-sys = { path = "../sys" }
1111
ocaml = { path = "..", features = ["bigarray-ext"] }
12-
ndarray = "^0.15.1"
12+
ndarray = "^0.16.1"
1313

1414
[build-dependencies]
1515
ocaml-build = { path = "../build" }

0 commit comments

Comments
 (0)