Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to zig0.11.0 #41

Merged
merged 17 commits into from
May 11, 2024
Merged

update to zig0.11.0 #41

merged 17 commits into from
May 11, 2024

Conversation

ryoppippi
Copy link
Owner

@ryoppippi ryoppippi commented May 11, 2024

fixes: #33
fixes: #32

  • Compatible with zig 0.11.0
  • Works on macOS + devbox
  • Compatible with opencv 4.6.0

This commit updates the build.zig and libs.zig files to be compatible
with Zig 0.1.0. The changes include updating the method signatures and
parameters to match the new Zig build system API. The changes also
include replacing deprecated methods with their new counterparts.
This commit replaces all instances of @enumToInt with @intFromEnum in
the Zig codebase. This change is necessary due to the deprecation of
@enumToInt in the latest version of Zig. The replacement function,
@intFromEnum, provides the same functionality but with a more
descriptive name.
The alignment cast in the dataPtr function was previously using
@Alignof(T), which was incorrect. This commit changes it to use
the correct alignment, which is derived from p.data. This should
fix any alignment issues when using the dataPtr function.
The type casting in the mat_test file was incorrect, causing potential
issues with the test results. This commit fixes the type casting to
ensure accurate test results.
This commit refactors the build and link functions in build.zig and
libs.zig. The changes include:

- Use LazyPath for paths.
- Move test filter option to test creation.
- Refactor link functions to use Builder and LazyPath.
- Refactor addCSourceFiles to use Builder and LazyPath.
- Remove getThisDir function.
This commit replaces the manual switch case statements for converting
backend and target strings to their respective enum types with the
built-in std.meta.stringToEnum function. This simplifies the code and
makes it more maintainable.
This commit replaces all instances of @bitcast with @as for type casting
in the codebase. The @bitcast built-in function is not suitable for type
casting as it does not perform any runtime checks. This change improves
the safety and correctness of the code.

BREAKING CHANGE: All @bitcast instances replaced with @as
This commit updates the names of several tests in the imgproc, objdetect,
photo, and video modules. The new names provide more clarity about the
specific functionality being tested. This change will make it easier for
developers to understand the purpose of each test.
The address-of operator (&) is used in the for loop to initialize and
deinitialize the Mat objects. This change ensures that the correct
memory address is used when initializing and deinitializing the Mat
objects in the tests.
This commit refactors the tests for the fastNlMeansDenoisingColored
function. The function is now tested with multiple parameters and the
test names have been updated to reflect this change. The tests now
also check the dimensions of the output matrix against the first
matrix in the input array, instead of the array itself.
This commit changes the return type of the function in the VideoCapture
struct from a span to a pointer. This change is necessary to ensure
correct handling of the FourCC bytes.
The type conversion methods in the dnndetection example have been
updated. The previous methods, `@intToFloat` and `@floatToInt`, have
been replaced with `@floatFromInt` and `@intFromFloat` respectively.
This change improves the readability and consistency of the code.
The test setup in build.zig has been refactored. The 'exe_tests' has been
renamed to 'unit_tests' for better clarity. Additionally, a new step to run
unit tests, 'run_unit_tests', has been added. This step is now a dependency
for the 'test' step.
This commit adds debug print statements in the test cases for
imgcodecs and videoio. These print statements display the expected
errors, providing more context when tests fail. This will help in
debugging and understanding the test cases better.
The URLs for the caffe_prototext and onnx_model have been updated to
point to specific commits. This ensures that the models being used are
consistent and not subject to changes in the master branch.
This commit simplifies the CI by removing the Docker-based build and
test process. Instead, it introduces devbox, a tool that provides a
consistent development environment across different machines.

The CI now uses actions/checkout@v4 and devbox for setting up the
environment. The build and test commands are run using devbox.

The Dockerfile has been removed as it's no longer needed. The devbox
configuration is provided in devbox.json and devbox.lock.

The deployment to GitHub Pages has been commented out for now.
This commit introduces a new step in the CI pipeline that downloads
necessary models for testing. A new script `download_models.ts` is added
which uses Deno to download the models. The CI workflow is updated to
run this script before building and testing. Deno is added as a
dependency in `devbox.json` and `devbox.lock`.
@ryoppippi ryoppippi changed the title Feature/34 update to zig0.10.0 May 11, 2024
@ryoppippi ryoppippi changed the title update to zig0.10.0 update to zig0.11.0 May 11, 2024
@ryoppippi ryoppippi merged commit ab7466b into main May 11, 2024
2 checks passed
@ryoppippi ryoppippi deleted the feature/34 branch May 11, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update to 0.11.0 remove docker & use nix-flake or devbox
1 participant