TheThirdOne / rars

RARS -- RISC-V Assembler and Runtime Simulator
Other
1.18k stars 217 forks source link

Linux/Manjaro problems saving files #176

Open rsmith-ft opened 1 year ago

rsmith-ft commented 1 year ago

When opening of saving a file the pop-up window only show the Desktop and Document directories and doesn't show any other directory in my root file tree. When saving a file, the pop-up window says it saves the file to the root directory, but it doesn't. Its lying to me! Manjaro 6.1.16-1 (64 bit) RARS 1.6

image

TheThirdOne commented 1 year ago

It seems unlikely this is a RARS bug rather than a swing issue. If this issue persists beyond a restart of RARS, I would be 95% confident it is a swing issue.

If a RARS restart changes the behavior: the relevant code is https://github.com/TheThirdOne/rars/blob/7acf3254e84ab75fa612402b22fe915a2e00bdab/src/rars/venus/EditTabbedPane.java#L671-L730

TheThirdOne commented 1 year ago

I cannot reproduce this on my Linux/Arch system so you will need to provide a little more information if you want me to debug it for you.

rsmith-ft commented 1 year ago

I would like to preface my remarks about the RARS installation. The version of RARS is 1.6 and was installed from Flatpacks. I have uninstalled the Flatapacks version and re-installed and the new installation the same problem.

Also, I attempted to install RARS from following the Github instructions and it was problematic. I discovered that my java links in /usr/bin/ pointed to /usr/lib/jvm/default instead of /usr/lib/jvm/java-19-open/… I reinstalled java, however the links did not change so I edit the /usr/bin links to point to the java-19-open directory.

After changing the links, the Github version of RARS did install on my system, but did not run, so I went back to the Flatpak version of RARS.

The fundemental RARS problem is a disconnect between the RARS application and the Manjaro operating system.

What does work: Using Dolphin, if I double click on a .asm file, RARS opens the proper file and it will run all tasks. Saving the .asm file is a different story. Fig 1 shows that RARS will save the file in the /run/flatpak/do/af6310e0 directory. However, as the Dophin window shows in Fig 1, the operating system doesn’t have a /ru/flatpak directory. Further a search for an i-node named 146310e0 comes up empty.

Rars_1_NoFlatpackDir

Figure 1

Figure 2 show RARS shows “testuser” contains only two directories. The Dophon window shows there are 9 directories in the home file system.

Rars_1_HomeDirDifference

  Figure 2

So, generally speaking the is a disconnect between the RARS application and the OS file system. I have no idea where to begin to trouble shoof from here.

TheThirdOne commented 1 year ago

So, generally speaking the is a disconnect between the RARS application and the OS file system. I have no idea where to begin to trouble shoot from here.

The key is to notice the file path /run/flatpak/do/af6310e0. You would not expect "flatpak" to show up unless flatpak is somehow interacting with the file paths. Based on that, you would expect this issue to not be about RARS per se, but instead about the flatpak packaging of RARS or flatpak itself.

You might google "flatpak cannot save file" and find a similar issue on Signal with a solution:

flatpak override --filesystem=home org.signal.Signal

Translating that to relevant to RARS would get you to

flatpak override --filesystem=home io.github.TheThirdOne.rars

which you could test to see if it would solve the problem (which it should unless you are editing .asm file in the root or something).

Alternatively if you are aware for flatpak sandboxing, the issue is pretty obvious. It just comes down to how you want to solve it; the command above may not be the best solution for you.

After changing the links, the Github version of RARS did install on my system, but did not run, so I went back to the Flatpak version of RARS.

RARS does not have an installation step. It is distributed as a Java JAR file which is directly runnable either from a file browser like Dolphin or on the command line like java -jar rars1_6.jar. This of course depends on having Java installed, but any reasonably recent Java version should work.

This is the only issue left. I would like to solve any friction to using RARS without flatpak. It seems unlikely that it is an error in RARS, but removing thorns that prevent certain system configurations from working is worth it. If you could provide any error messages or info about how the Github version failed to run, that would be greatly appreciated.