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

dicom-transfer-syntax-registry does not build on Windows by default #432

Closed
Enet4 opened this issue Nov 3, 2023 · 1 comment
Closed
Labels
C-transfer-syntax Crate: dicom-transfer-syntax-registry O-windows Operating System: Windows

Comments

@Enet4
Copy link
Owner

Enet4 commented Nov 3, 2023

It has come to my attention that the openjp2 crate is not Windows-ready, meaning that the openjp2 Cargo feature in dicom-transfer-syntax-registry should not have been selected by default, and that JPEG 2000 support on Windows currently requires linking with the reference OpenJPEG implementation.

The known mitigation for the time being is to disable default features and selectively add the other ones. To build all the project's binaries, for example:

cargo build --release --bins --no-default-features --features=cli,rle,jpeg,backtraces,rayon,simd

Or with OpenJPEG reference software:

cargo build --release --bins --no-default-features --features=cli,rle,jpeg,backtraces,openjpeg-sys,openjpeg-sys-threads,rayon,simd

(It is a bit more complicated when selecting a specific package via -p)

Moving forward:

  • There are no plans in sight for the openjp2 crate to support Windows, because the port is based on C2Rust, which only guarantees support for Linux and Mac OS.
  • It is not possible to change Cargo feature listings based on the target platform (Platform target-specific features rust-lang/cargo#1197). It would be possible to change the dependencies' features depending on the target operating system, but with the Cargo features already laid out, I don't see a way to resolve both situations, especially without introducing some complexity in the pixeldata crate.
  • Removing openjp2 as a feature depended by the default feature native would be cleaner, but if this is done in a patch release, it would break expectations of existing Linux users depending on this. On the other hand, a bump to version 0.7.0 would feel over the top, as it has so far been reserved for a bigger bundle of breaking changes.
  • I wonder if it is possible to monkey-patch the openjp2 crate based on the target platform. Then one would be able to replace it with a stub on Windows and feature-gate the rest. Alternatively, one may have to maintain separate openjp2 and jpeg2k packages just for DICOM-rs.
@Enet4 Enet4 added C-transfer-syntax Crate: dicom-transfer-syntax-registry O-windows Operating System: Windows labels Nov 3, 2023
@Enet4
Copy link
Owner Author

Enet4 commented Mar 15, 2024

Resolved with #449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-transfer-syntax Crate: dicom-transfer-syntax-registry O-windows Operating System: Windows
Projects
None yet
Development

No branches or pull requests

1 participant