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 -Dpython.console.encoding=UTF-8 by default #57

Merged
merged 1 commit into from Sep 25, 2018

Conversation

Projects
None yet
3 participants
@stelfrich
Copy link
Member

stelfrich commented Sep 24, 2018

Fixes #56.

@stelfrich

This comment has been minimized.

Copy link
Member Author

stelfrich commented Sep 25, 2018

@imagejan Do you have a Windows 7 machine that you could build/test this PR on? I only have a 32bit Windows 10 that I could use to compile the launcher, but not a Windows 7 one to properly test it...

@imagejan

This comment has been minimized.

Copy link
Member

imagejan commented Sep 25, 2018

I wanted to take the opportunity to set up a running gcc on my Windows system, but when running mvn, I get:

these Maven log messages
Starting Core 9 with 1 source files...
[ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/config.h:34,
[ERROR]                  from c/config.c:32:
[WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined
[ERROR]  extern inline int is_digit(char c);
[ERROR]                    ^~~~~~~~
[ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/platform.h:36,
[ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/file-funcs.h:34,
[ERROR] c/ImageJ.c: In function 'adjust_java_home_if_necessary':
[ERROR]                  from c/java.c:33:
[ERROR]                  from c/platform.c:33:
[WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined
[WARNING] c/ImageJ.c:2313:20: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[ERROR]  extern inline int is_digit(char c);
[WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined
[ERROR]                    ^~~~~~~~
[ERROR]   char* debugPath = get_library_path();
[ERROR]  extern inline int is_digit(char c);
[ERROR]                     ^~~~~~~~~~~~~~~~
[ERROR]                    ^~~~~~~~
[ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/config.h:34,
[ERROR]                  from c/ImageJ.c:71:
[ERROR] c/ImageJ.c: At top level:
[WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined
[ERROR]  extern inline int is_digit(char c);
[ERROR]                    ^~~~~~~~
[ERROR] c/exe-ico.c: In function 'set_exe_icon':
[ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/file-funcs.h:34,
[ERROR] In file included from c/file-funcs.c:33:
[ERROR]                  from c/splash.c:33:
[WARNING] c/exe-ico.c:141:7: warning: implicit declaration of function 'file_exists'; did you mean 'filelength'? [-Wimplicit-function-declaration]
[WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined
[ERROR] c/file-funcs.c: In function 'mkdir_recursively':
[ERROR]  extern inline int is_digit(char c);
[ERROR]   if (!file_exists(exe_path)) {
[ERROR]                    ^~~~~~~~
[WARNING] E:\code\imagej\imagej-launcher\src\main\include/platform.h:114:15: warning: implicit declaration of function 'fake_posix_mkdir' [-Wimplicit-function-declaration]
[ERROR]        ^~~~~~~~~~~
[ERROR]  #define mkdir fake_posix_mkdir
[ERROR]        filelength
[ERROR]                ^~~~~~~~~~~~~~~~
[ERROR] E:\code\imagej\imagej-launcher\src\main\include/platform.h:114:15: note: in definition of macro 'mkdir'
[ERROR]  #define mkdir fake_posix_mkdir
[ERROR]                ^~~~~~~~~~~~~~~~
[ERROR] c/file-funcs.c: In function 'find_newest':
[WARNING] c/file-funcs.c:509:13: warning: implicit declaration of function 'file_is_newer' [-Wimplicit-function-declaration]
[ERROR]     else if (file_is_newer(path->buffer, result->buffer)) {
[ERROR]              ^~~~~~~~~~~~~
[ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/file-funcs.h:34,
[ERROR]                  from c/file-funcs.c:32:
[ERROR] c/file-funcs.c: At top level:
[WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined
[ERROR]  extern inline int is_digit(char c);
[ERROR]                    ^~~~~~~~
[INFO] 10 files were compiled.

and in the target folder, I end up with imagej-launcher-5.0.1-SNAPSHOT-amd64-Windows-gcc-executable.nar which apparently isn't the right thing for my platform, is it?


@stelfrich if you can provide me with a compiled launcher executable, I'm happy to test it on a Windows 7 system.

@ctrueden

This comment has been minimized.

Copy link
Member

ctrueden commented Sep 25, 2018

Maybe the easiest thing would be to merge this, wait for the AppVeyor build and use that? And then revert if there is any regression noticed?

@stelfrich

This comment has been minimized.

Copy link
Member Author

stelfrich commented Sep 25, 2018

Maybe the easiest thing would be to merge this, wait for the AppVeyor build and use that? And then revert if there is any regression noticed?

Let's do this. Shouldn't break anything...

@stelfrich stelfrich merged commit 5d5aa1b into master Sep 25, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@imagejan

This comment has been minimized.

Copy link
Member

imagejan commented Sep 25, 2018

I downloaded imagej-launcher-5.0.1-20180821.152133-36-win64.exe and put it into my existing Fiji installation on Windows 7.

This is what I noticed:

  • the new launcher doesn't seem to pick up my system Java: when trying to launch, it complains:

    The program can't start because jvm.dll is missing from your computer.
    

    But after a short while (without splash screen), the ImageJ window comes up, reporting Java 10.0.1

    (Note that the previous launcher imagej-launcher-5.0.0-20171212.062926-36-win64.exe in the same Fiji installation runs fine with Java 1.8.0_172 and displaying a Fiji splash screen.)

  • when renaming the java-old directory in my installation back to java, both launchers start up with splash screen and Java 1.8.0_66

  • when I do File > New > Script..., then Language > Python, then Run, I still get:

    console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
    

    in all situations tested... 😢

@stelfrich

This comment has been minimized.

Copy link
Member Author

stelfrich commented Sep 26, 2018

I downloaded imagej-launcher-5.0.1-20180821.152133-36-win64.exe and put it into my existing Fiji installation on Windows 7.

That version that you mention here, @imagejan, is one that does not have the PR included yet (according to its timestamp at least). Would you mind checking again with imagej-launcher-5.0.1-20180925.115628-44-win64.exe?

the new launcher doesn't seem to pick up my system Java: when trying to launch, it complains

Let's try (although it might not be possible because property handling might have issues when falling back to the system java executable for launching) to focus on the Python issue. If this persists, let's open another issue to investigate this.

@imagejan

This comment has been minimized.

Copy link
Member

imagejan commented Sep 26, 2018

does not have the PR included yet (according to its timestamp at least)

sorry for that: I was getting the SNAPSHOT from maven.imagej.net, but didn't double-check the timestamp...

Would you mind checking again with imagej-launcher-5.0.1-20180925.115628-44-win64.exe?

Yup, with this one I don't get the error message any more. I tried with Java 10.0.1 (after that spurious jvm.dll error dialog mentioned above) and with the bundled Java 1.8.0_66, it's fine in both cases.

Thanks again, @stelfrich!

@imagejan imagejan deleted the fix-unsupported-charset-exception branch Sep 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.