Sorry <@U04H34VPCJZ>, it might be that I did not g...
# compose-desktop
s
Sorry @Alexander Maryanovsky, it might be that I did not get what to do next to see if we can figure out what the issue is.
a
Try to understand whether your app has permissions to access the db file.
It doesn’t seem to be an issue with Compose.
s
Is there any permission difference between gradle bsa-desktop:run --quiet command that works perfectly and the packageDmg task?
That must be the key, cause the code is the same and it works perfectly in local but just cannot access when packaged in a dmg file with your packageDmg task*,*
a
The app is running under different restrictions, I guess.
s
Right. What would you do if you were me? Like where would you post a message or what would you investigate? Cause I am completely clueless and I am just on the verge of distributing the application. Thanks a lot in advance @Alexander Maryanovsky
m
Your issue is the current working directory is different.
You can't just write files to the CWD in a desktop app. That'll work when run from your build system because the CWD is the root of your source tree, but when packaged there is no source tree and your app won't have permissions to write to the CWD.
Instead you should store the files in the appropriate place for each operating system.
s
Oh right, so you are saying that somehow I need to set up the cwd in the SqlDelight library for the database to be stored in Windows, Linux and Mac? Have you ever done it or know any resources that I can look at to do it myself? Thanks a lot in advance @mikehearn
m
You can't change the CWD on the JVM. What you can do is tell SqlDelight to store its data somewhere else (presumably... it's been a while since I used that library and I forgot the details).
By specifying an absolute path.
There are libraries that help you compute the right path for each host OS (e.g.
~/Library/Caches/<bundle-id>
on macOS
🚀 1
s
Great, thanks a lot for pointing me in the right direction.
Do you happen to know how are these libraries called ? The multiplatform libraries to get the right paths I mean.
m
Good question. Unfortunately I've forgotten and a few searches aren't showing it up
It's been raised in this channel before though. Maybe someone else knows.
s
No worries at all, I will check it out.
m
It's not hard to implement yourself though.
🙌 1
s
m
yeah that's the one