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

Set wildcard classpath on Windows #202

Merged
merged 2 commits into from
May 24, 2023

Conversation

melissalinkert
Copy link
Member

Fixes #14.

This worked for me on Windows. Without this PR, built and unzipped bioformats2raw-0.7.0-SNAPSHOT.zip, then:

> mv bioformats2raw-0.7.0-SNAPSHOT C:\Users\melissa\data\long-path-name-test\
> cd C:\Users\melissa\data\long-path-name-test\bioformats2raw-0.7.0-SNAPSHOT
> .\bin\bioformats2raw.bat test.fake test.zarr --compression null
The input line is too long.
The syntax of the command is incorrect.

With this PR, the same test should successfully create test.zarr.

If we're happy with this approach, raw2ometiff can get the same fix.

/cc @jburel

@melissalinkert melissalinkert requested a review from sbesson May 15, 2023 16:08
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing this to the artifact built with this PR from the ones build from HEAD

(base) sbesson@Sebastiens-MacBook-Pro-2 Downloads % diff -ur bioformats2raw-0.7.0-SNAPSHOT bioformats2raw-0.7.0-SNAPSHOT\ 2
diff -ur bioformats2raw-0.7.0-SNAPSHOT/bin/bioformats2raw.bat bioformats2raw-0.7.0-SNAPSHOT 2/bin/bioformats2raw.bat
--- bioformats2raw-0.7.0-SNAPSHOT/bin/bioformats2raw.bat	2023-04-24 14:26:32
+++ bioformats2raw-0.7.0-SNAPSHOT 2/bin/bioformats2raw.bat	2023-05-15 16:09:58
@@ -67,7 +67,7 @@
 :execute
 @rem Setup the command line
 
-set CLASSPATH=%APP_HOME%\lib\bioformats2raw-0.7.0-SNAPSHOT.jar;%APP_HOME%\lib\jzarr-0.3.5.jar;%APP_HOME%\lib\jblosc-1.0.1.jar;%APP_HOME%\lib\jna-5.10.0.jar;%APP_HOME%\lib\formats-gpl-6.12.0.jar;%APP_HOME%\lib\picocli-4.6.1.jar;%APP_HOME%\lib\univocity-parsers-2.8.4.jar;%APP_HOME%\lib\s3fs-2.2.3.jar;%APP_HOME%\lib\jaxb-api-2.3.0.jar;%APP_HOME%\lib\logback-classic-1.3.4.jar;%APP_HOME%\lib\logback-core-1.3.4.jar;%APP_HOME%\lib\opencv-3.4.2-1.jar;%APP_HOME%\lib\progressbar-0.9.0.jar;%APP_HOME%\lib\formats-bsd-6.12.0.jar;%APP_HOME%\lib\formats-api-6.12.0.jar;%APP_HOME%\lib\ome-xml-6.3.2.jar;%APP_HOME%\lib\metakit-5.3.5.jar;%APP_HOME%\lib\ome-poi-5.3.7.jar;%APP_HOME%\lib\ome-codecs-0.4.4.jar;%APP_HOME%\lib\ome-common-6.0.14.jar;%APP_HOME%\lib\ome-mdbtools-5.3.2.jar;%APP_HOME%\lib\cdm-core-5.3.3.jar;%APP_HOME%\lib\jcl-over-slf4j-1.7.5.jar;%APP_HOME%\lib\jxrlib-all-0.2.4.jar;%APP_HOME%\lib\native-lib-loader-2.1.4.jar;%APP_HOME%\lib\udunits-5.3.3.jar;%APP_HOME%\lib\httpservices-5.3.3.jar;%APP_HOME%\lib\slf4j-api-2.0.1.jar;%APP_HOME%\lib\JWlz-1.4.0.jar;%APP_HOME%\lib\minio-5.0.2.jar;%APP_HOME%\lib\aws-java-sdk-s3-1.11.232.jar;%APP_HOME%\lib\aws-java-sdk-kms-1.11.232.jar;%APP_HOME%\lib\aws-java-sdk-core-1.11.232.jar;%APP_HOME%\lib\joda-time-2.10.3.jar;%APP_HOME%\lib\kryo-4.0.2.jar;%APP_HOME%\lib\json-20090211.jar;%APP_HOME%\lib\sqlite-jdbc-3.28.0.jar;%APP_HOME%\lib\jmespath-java-1.11.232.jar;%APP_HOME%\lib\jackson-annotations-2.14.1.jar;%APP_HOME%\lib\jackson-dataformat-cbor-2.14.1.jar;%APP_HOME%\lib\jackson-core-2.14.1.jar;%APP_HOME%\lib\jackson-databind-2.14.1.jar;%APP_HOME%\lib\guava-29.0-jre.jar;%APP_HOME%\lib\tika-core-1.5.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\javax.mail-1.6.2.jar;%APP_HOME%\lib\jline-3.16.0.jar;%APP_HOME%\lib\xalan-2.7.2.jar;%APP_HOME%\lib\serializer-2.7.2.jar;%APP_HOME%\lib\specification-6.3.2.jar;%APP_HOME%\lib\turbojpeg-6.12.0.jar;%APP_HOME%\lib\jgoodies-forms-1.7.2.jar;%APP_HOME%\lib\commons-lang-2.6.jar;%APP_HOME%\lib\perf4j-0.9.16.jar;%APP_HOME%\lib\jhdf5-19.04.0.jar;%APP_HOME%\lib\metadata-extractor-2.18.0.jar;%APP_HOME%\lib\xercesImpl-2.12.2.jar;%APP_HOME%\lib\xml-apis-1.4.01.jar;%APP_HOME%\lib\snakeyaml-1.32.jar;%APP_HOME%\lib\httpmime-4.5.9.jar;%APP_HOME%\lib\google-http-client-xml-1.20.0.jar;%APP_HOME%\lib\google-http-client-1.20.0.jar;%APP_HOME%\lib\httpclient-4.5.9.jar;%APP_HOME%\lib\commons-logging-1.2.jar;%APP_HOME%\lib\jdom2-2.0.6.jar;%APP_HOME%\lib\protobuf-java-3.9.1.jar;%APP_HOME%\lib\jcommander-1.78.jar;%APP_HOME%\lib\httpcore-4.4.11.jar;%APP_HOME%\lib\re2j-1.3.jar;%APP_HOME%\lib\reflectasm-1.11.3.jar;%APP_HOME%\lib\minlog-1.3.0.jar;%APP_HOME%\lib\objenesis-2.5.1.jar;%APP_HOME%\lib\junit-4.12.jar;%APP_HOME%\lib\activation-1.1.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\checker-qual-2.11.1.jar;%APP_HOME%\lib\error_prone_annotations-2.3.4.jar;%APP_HOME%\lib\j2objc-annotations-1.3.jar;%APP_HOME%\lib\okhttp-3.7.0.jar;%APP_HOME%\lib\okio-1.12.0.jar;%APP_HOME%\lib\ome-jai-0.1.3.jar;%APP_HOME%\lib\aircompressor-0.21.jar;%APP_HOME%\lib\jgoodies-common-1.7.0.jar;%APP_HOME%\lib\base-18.09.0.jar;%APP_HOME%\lib\commons-io-2.7.jar;%APP_HOME%\lib\commons-lang3-3.10.jar;%APP_HOME%\lib\xmpcore-6.1.11.jar;%APP_HOME%\lib\asm-5.0.4.jar;%APP_HOME%\lib\hamcrest-core-1.3.jar;%APP_HOME%\lib\ion-java-1.0.2.jar;%APP_HOME%\lib\xpp3-1.1.4c.jar;%APP_HOME%\lib\commons-codec-1.11.jar;%APP_HOME%\lib\config
+set CLASSPATH=.;%APP_HOME%/lib/*
 
 
 @rem Execute bioformats2raw
Binary files bioformats2raw-0.7.0-SNAPSHOT/lib/bioformats2raw-0.7.0-SNAPSHOT.jar and bioformats2raw-0.7.0-SNAPSHOT 2/lib/bioformats2raw-0.7.0-SNAPSHOT.jar differ

This looks inline with the patch applied in https://github.com/ome/conda-bioformats2raw/blob/master/bioformats2raw/windows-bat-classpath-wildcard.patch. Only immediate question is whether using a forward slash rather than a backwards slash might cause problems under some Windows environments?

@melissalinkert
Copy link
Member Author

I'm fairly certain a forward-slash in this case wouldn't be a problem in any modern Windows environment, but 916a0e0 switches to backslashes for completeness.

@melissalinkert melissalinkert requested a review from muhanadz May 17, 2023 15:13
Copy link
Member

@muhanadz muhanadz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without PR:

PS C:\Users\Muhan\Documents\bioformats2raw> & "C:\Users\Muhan\Downloads\bioformats2raw-0.7.0-SNAPSHOT (1)\bioformats2raw-0.7.0-SNAPSHOT\bin\bioformats2raw.bat" "C:\Users\Muhan\Documents\bioformats2raw\realy_long_file_name_for_testing_purposes_only_and_for_fun\test.fake" test2.zarr --compression null
The input line is too long.
The syntax of the command is incorrect.

With PR:

PS C:\Users\Muhan\Documents\bioformats2raw> & "C:\Users\Muhan\Documents\bioformats2raw\realy_long_file_name_for_testing_purposes_only_and_for_fun\bioformats2raw-0.7.0-SNAPSHOT\bin\bioformats2raw.bat" "C:\Users\Muhan\Documents\bioformats2raw\realy_long_file_name_for_testing_purposes_only_and_for_fun\test.fake" test.zarr --compression null

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

The input line is too long. The syntax of the command is incorrect.
3 participants