-
Notifications
You must be signed in to change notification settings - Fork 299
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
Cannot load library in OMEdit from a directory with accented letters #8777
Comments
Short directory names seem to be used now, since the error I get with 1.19.0-beta.1 uses them. However, the issue is not yet fixed. Please unzip the TestAccentedLetterDir.zip. If you attempt to load TestLibrary/package.mo from OMEdit under Windows, you get
while if you run omc test.mos, you get
@adrpo, as I understand the class loader for Windows must also be fixed, otherwise it would be impossible to load libraries from accented directories at all. |
I changed @adeas31 Should we check wat OMEdit is using and if |
The library loading error is from compiler so if you have changed the compiler to use |
@AnHeuermann, @adeas31 please agree on who can take care of this and please make sure it is also cherry-picked to maintenance/v1.19, so it will go into 1.19.0 as well. Thanks! |
I'll give it a go today. |
First issue is, that function
But the root problem is, that the string for the directory path changes from On Ubuntu By the way, is the typo in Media.mo relevant? with TestPackage; <---- within?
package Media
end Media; |
Okay, the issue goes way deeper than what I could change quickly. When creating a mos script test.mos
in Windows I get
I can add the error message #8985 to the master. But I don't think we can solve this issue fast. |
You can recreate the problem with Lib äää on your German keyboard.
Of course it should be within, sorry. Anyway, we are not even getting to the point where that file is read from the file system. |
Is this just a problem of graphical rendering of the output on the Windows terminal? In that case, I wouldn't bother.
OK. Can be helpful for debugging.
I don't think getting an Internal Error on getProgramFromStrategy (BTW, what the hell does that function name mean?) helps end-user much.
I'm still not convinced that this is the issue. Getting a bad rendering of pathnames with accented letters in error messages on a Windows cmd console is slightly annoying, but no big deal. Not being able to load libraries from directories with accented letters can completely break the package manager, if the username contains accented letters (or Russian characters, as it happened once with one of my students). That is a much bigger deal, particularly in corporate environments, where you cannot install stuff where you want in the file system, but you must stick to your home directory. |
I mean, the package manager and the linker work fine in that case. We just need to use the same mechanism for the package loader. |
It loads a file (as an |
I wonder if ANTLR internally loads things fine. Does loadFile work with accents in paths? OpenModelica/OMCompiler/Parser/parse.c Line 457 in 934e149
It might also exist other functions that do not support this as Windows is a mess. |
What is the difference in running the original problem? We do stuff differently for files named But I can't debug this without #8986 being fixed because my prints won't show the right stuff and I don't have Eclipse with MDT set up on my Windows system. |
@mahge and myself tracked it down to |
I'll create the cherry pick for maintenance/v1. 19 on Monday. |
I'd keep this open until we've actually tested it on 1.19.0-dev.beta5 😅 |
- Implement wide character handling for `SystemImpl__directoryExists` and `System_subDirectories`. - Remove the macros for conversion to/from wide character string, e.g, `MULTIBYTE_TO_WIDECHAR_LENGTH`, `MULTIBYTE_TO_WIDECHAR_VAR` ... and replace them with corresponding functions. - Added functions `omc_multibyte_to_wchar_str` and `omc_wchar_to_multibyte_str` to handle the conversions. Note: the caller has to deallocated the memory for the strings returned from these functions. - define `omc_stat_t` to be `stat` or `_stat` depending on platform and use it instead. We might need to change this to wstat on Windows later. - A few more minor cleanups and restructures. - Fixes OpenModelica#8777.
- Implement wide character handling for `SystemImpl__directoryExists` and `System_subDirectories`. - Remove the macros for conversion to/from wide character string, e.g, `MULTIBYTE_TO_WIDECHAR_LENGTH`, `MULTIBYTE_TO_WIDECHAR_VAR` ... and replace them with corresponding functions. - Added functions `omc_multibyte_to_wchar_str` and `omc_wchar_to_multibyte_str` to handle the conversions. Note: the caller has to deallocated the memory for the strings returned from these functions. - define `omc_stat_t` to be `stat` or `_stat` depending on platform and use it instead. We might need to change this to wstat on Windows later. - A few more minor cleanups and restructures. - Fixes OpenModelica#8777.
- Implement wide character handling for `SystemImpl__directoryExists` and `System_subDirectories`. - Remove the macros for conversion to/from wide character string, e.g, `MULTIBYTE_TO_WIDECHAR_LENGTH`, `MULTIBYTE_TO_WIDECHAR_VAR` ... and replace them with corresponding functions. - Added functions `omc_multibyte_to_wchar_str` and `omc_wchar_to_multibyte_str` to handle the conversions. Note: the caller has to deallocated the memory for the strings returned from these functions. - define `omc_stat_t` to be `stat` or `_stat` depending on platform and use it instead. We might need to change this to wstat on Windows later. - A few more minor cleanups and restructures. - Fixes OpenModelica#8777.
- Implement wide character handling for `SystemImpl__directoryExists` and `System_subDirectories`. - Remove the macros for conversion to/from wide character string, e.g, `MULTIBYTE_TO_WIDECHAR_LENGTH`, `MULTIBYTE_TO_WIDECHAR_VAR` ... and replace them with corresponding functions. - Added functions `omc_multibyte_to_wchar_str` and `omc_wchar_to_multibyte_str` to handle the conversions. Note: the caller has to deallocated the memory for the strings returned from these functions. - define `omc_stat_t` to be `stat` or `_stat` depending on platform and use it instead. We might need to change this to wstat on Windows later. - A few more minor cleanups and restructures. - Fixes OpenModelica#8777.
- Implement wide character handling for `SystemImpl__directoryExists` and `System_subDirectories`. - Remove the macros for conversion to/from wide character string, e.g, `MULTIBYTE_TO_WIDECHAR_LENGTH`, `MULTIBYTE_TO_WIDECHAR_VAR` ... and replace them with corresponding functions. - Added functions `omc_multibyte_to_wchar_str` and `omc_wchar_to_multibyte_str` to handle the conversions. Note: the caller has to deallocated the memory for the strings returned from these functions. - define `omc_stat_t` to be `stat` or `_stat` depending on platform and use it instead. We might need to change this to wstat on Windows later. - A few more minor cleanups and restructures. - Fixes #8777.
I'll test it tomorrow with the nightly build and re-close if it is fine. If it works for me, then it would be nice to backport the fix to maintenance/v1.19, so we get it in 1.19.1. Thanks! |
- Implement wide character handling for `SystemImpl__directoryExists` and `System_subDirectories`. - Remove the macros for conversion to/from wide character string, e.g, `MULTIBYTE_TO_WIDECHAR_LENGTH`, `MULTIBYTE_TO_WIDECHAR_VAR` ... and replace them with corresponding functions. - Added functions `omc_multibyte_to_wchar_str` and `omc_wchar_to_multibyte_str` to handle the conversions. Note: the caller has to deallocated the memory for the strings returned from these functions. - define `omc_stat_t` to be `stat` or `_stat` depending on platform and use it instead. We might need to change this to wstat on Windows later. - A few more minor cleanups and restructures. - Fixes OpenModelica#8777.
- Implement wide character handling for `SystemImpl__directoryExists` and `System_subDirectories`. - Remove the macros for conversion to/from wide character string, e.g, `MULTIBYTE_TO_WIDECHAR_LENGTH`, `MULTIBYTE_TO_WIDECHAR_VAR` ... and replace them with corresponding functions. - Added functions `omc_multibyte_to_wchar_str` and `omc_wchar_to_multibyte_str` to handle the conversions. Note: the caller has to deallocated the memory for the strings returned from these functions. - define `omc_stat_t` to be `stat` or `_stat` depending on platform and use it instead. We might need to change this to wstat on Windows later. - A few more minor cleanups and restructures. - Fixes #8777.
I prefer to keep this open until I've actually checked in on the built version, just in case. I'll take care of that. |
Works fine in 1.19.2-dev.beta2. |
Unpack the attached zip file, that contains two libararies in an accented letter directory.
When trying to open TestPackage/package.mo, I get:
When I try to open ExternalMedia 3.3.0/package.mo instead, I get
and an empty ExternalMedia package is shown in the Libraries Browser.
The text was updated successfully, but these errors were encountered: