#5871 closed defect (fixed)
OMEdit changes extensions of package.mo files when top-level package is modified
Reported by: | Andrea Bartolini | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | blocker | Milestone: | 1.16.0 |
Component: | OMEdit | Version: | v1.16.0-dev |
Keywords: | Cc: | Francesco Casella, Adrian Pop |
Description (last modified by )
Hi Adeel, here the steps to reproduce the issue:
1) unzip and open in OMEdit the attached Test
example, files and directories structure on disk appears as shown in attached before.png file.
2) open the top-level package Test
and switch to the text view
3) add a comment below the // test
line
4) save the package:
- the top-level package.order file is empty
- the sub-packages pack2.mo and package.mo files are renamed in pack2.bak-mo and package.bak-mo (as shown in attached after.png file)
It seems (but I'm not sure) that the issue is related to the fact that both sub-package in a single file (pack2.mo) and sub-package in sub-directory (pack1) are present at the same time...
OMEdit - OpenModelica Connection Editor
Connected to OpenModelica 1.16.0~dev-208-gb567bd2
Sysop Linux Ubuntu 18.04
Kind regards,
Andrea
Attachments (4)
Change History (15)
by , 5 years ago
by , 5 years ago
Attachment: | before.png added |
---|
by , 5 years ago
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
comment:2 by , 5 years ago
Milestone: | 1.16.0 → 1.15.0 |
---|
by , 5 years ago
Attachment: | script.mos added |
---|
Unzip the Test.zip attachment and copy this script inside Test directory
comment:3 by , 5 years ago
The problem seems to be with loadString
API. It has the option to merge or replace the AST. In our case it is replacing the AST even though the merge flag is set.
I put up the small script to show the problem. Unzip the Test.zip
attachment, copy this script inside Test
directory and run it.
comment:4 by , 5 years ago
Hi Adeel,
in the following the results from the script:
Notebook:~/Desktop/Test$ omc script.mos true "" {Test} "" {pack1,pack2} "" "/home/andrea/Desktop/Test/package.mo" true "" {} "" {Test} "" Notebook:~/Desktop/Test$
comment:6 by , 5 years ago
Yes that is correct. Note that getClassNames(Test)
returns empty list that is why OMEdit thinks that Test.pack1
and Test.pack2
are deleted.
comment:7 by , 5 years ago
Cc: | added |
---|
comment:8 by , 5 years ago
Should be fixed with PR: https://github.com/OpenModelica/OpenModelica/pull/763.
Check and close ticket if it works fine.
comment:9 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Tested with:
OpenModelica 1.16.0~dev-227-g491c0c8
running on Ubuntu 18.04
it works fine.
Thanks :)
comment:11 by , 5 years ago
Milestone: | 1.15.0 → 1.16.0 |
---|
Release 1.15.0 was scrapped, because replaceable support eventually turned out to be more easily implemented in 1.16.0. Hence, all 1.15.0 tickets are rescheduled to 1.16.0
@adease31, @adrpo, I guess that's exactly what my other colleague Alberto Leva experienced. The bak files were not backups of deleted stuff, they were just the .mo files renamed. He even made a script to rename them back to .mo files and carry on.
If I am not mistaken, the log file only contains "getXXX" API function calls. It is really weird that such an effect on the file system is produced.
@adeas31, I think this should be fixed with top priority and back-ported to 1.15.0 as well.
Thanks!