#6229 closed defect (invalid)
Package unloaded for unknown reasons
Reported by: | massimo ceraolo | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | low | Milestone: | 1.17.0 |
Component: | OMEdit | Version: | v1.17.0-dev |
Keywords: | Cc: |
Description
I've created the package Demo2P_modelica using Dymola.
OMEdit cannot load it "for unknown reasons"
Attachments (1)
Change History (13)
by , 4 years ago
Attachment: | Demo2P_modelica.zip added |
---|
comment:1 by , 4 years ago
comment:2 by , 4 years ago
@adrpo, technically speaking OMC behaves correctly according to the specification.
However, the Windows files system is (alas) not case-sensitive. Should OMC be more relaxed and accept the file name even if the caps are not the same? Note that in Windows it will anyway be impossible to have randomCar.mo
and RandomCar.mo
in the same directory.
comment:3 by , 4 years ago
Priority: | high → low |
---|
Ok, it is more a Dymola's than an omc issue.
I met a similar problem in the past, But in this case I did not check this.
At least the priority of this ticket must be lowered.
Feel free to close it if you prefer.
follow-up: 6 comment:4 by , 4 years ago
I would not change the behavior. Trying the same library in Linux or Mac will fail. Also if you use versioning systems is always a mess if you need to rename case of files.
comment:5 by , 4 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Also the warning was very clear: it is my fault not having read it better. I'm going to close this ticket.
follow-up: 9 comment:6 by , 4 years ago
Replying to adrpo:
I would not change the behavior. Trying the same library in Linux or Mac will fail.
That's right.
Also if you use versioning systems is always a mess if you need to rename case of files.
Yup.
Time to open a ticket at Dassault :)
comment:7 by , 4 years ago
However, the Windows files system is (alas) not case-sensitive. Should OMC be more relaxed and accept the file name even if the caps are not the same? Note that in Windows it will anyway be impossible to have randomCar.mo and RandomCar.mo in the same directory.
I thought this is what we do. It's only a warning, right? The current code as far as I remember gives an error if a filename is totally incorrect, but a warning if we find a file with the wrong case (and then loads that as if the case was correct).
It even says
Proceeding since only the case of the names are different.
comment:8 by , 4 years ago
Yes, but then it fails to load. The full log is this:
[3] 12:58:16 Grammar Warning [C:/Users/adrpo33/Downloads//Demo2P_modelica/StochasticFlows/Support/package.order: 0:0-0:0]: The package.order file does not list all .mo files and directories (containing package.mo) present in its directory. Missing names are: randomCar [4] 12:58:16 Scripting Warning [C:/Users/adrpo33/Downloads/Demo2P_modelica/StochasticFlows/Support/randomCar.mo: 2:1-79:14]: Expected the package to have name randomCar, but got RandomCar. Proceeding since only the case of the names are different. [5] 12:58:16 Translation Error [C:/home/adrpo33/dev/OpenModelica/OMCompiler/Compiler/FrontEnd/ClassLoader.mo: 302:9-302:128]: Internal error loadCompletePackageFromMp failed for unknown reason: mp=C:/Users/adrpo33/Downloads//Demo2P_modelica/StochasticFlows pack=Support [6] 12:58:16 Scripting Error Failed to load package Demo2P_modelica () using MODELICAPATH C:/Users/adrpo33/Downloads/.
follow-up: 10 comment:9 by , 4 years ago
Time to open a ticket at Dassault :)
We should, indeed.
During package evolution I found that randomCar was lowercase, while I prefer class names starting with uppercase letter. I renamed it, but Dymola "forgot" to rename the mo file as well
comment:10 by , 4 years ago
Replying to ceraolo:
During package evolution I found that randomCar was lowercase, while I prefer class names starting with uppercase letter. I renamed it, but Dymola "forgot" to rename the mo file as well
Blame Microsoft, not Dassault. Try to rename a file with something that is equivalent save for upper/lower case, Windows will ignore the rename command, because it is somewhat case-insensitive, due to backwards compatibility with the old days, when filenames were all caps. Like, in the '80s.
You should delete the file first, and then re-create it with the new, correct name.
comment:11 by , 4 years ago
That was the case in the past, now it seems to work fine. I tried on randomCar.mo in Windows 10 Explorer, press F2 to edit the file, change the case of the first char, works fine.
I get this:
If I rename
Demo2P_modelica/StochasticFlows/Support/randomCar.mo
toDemo2P_modelica/StochasticFlows/Support/RandomCar.mo
everything loads fine.