View Issue Details

IDProjectCategoryView StatusLast Update
0037509LazarusDocumentationpublic2020-08-29 15:26
ReporterTambet Vaeli Assigned To 
Status newResolutionopen 
Product Version2.0 
Summary0037509: Userrights issues for running examples

I'm using Linux Mint and Cinnamon. I got similar issues for both Package Manager and manual installation.

Steps To ReproduceInstall Lazarus to more or less default installation of mentioned Linux and try to run any example. It says something like "Unable to create directory "/usr/lib/lazarus/2.0.0/components/codetools/examples/backup"." or "Unable to write to file "/usr/lib/lazarus/2.0.0/components/codetools/examples/addclass.lpi"." I think it's fairly easy to reproduce, so I'm not trying to find more of them.

I have to say I haven't really tried - I guess it could all work if I simply hack it so far that Lazarus doesn't have *any* issues with rights and users. I went somewhere into the middle way, and decided, that first my programs would then be without any user right support (as it has to be somewhere in the philosophy) and second, it started to feel I simply break my linux - it should have something it knows about user rights, inside. I have Programmeth a bunch of things there meanwhile, (enough to miss background transparency features for objects).
Additional InformationThe very useful thing about Turbo Pascal and Borland Pascal - they got examples with them, directly runnable. This is basically what I remembered from those old days - somehow, many languages feel that you have to do a lot's of setup to get any of them to work - Turbo Pascal, Like Basic (and I lately found, Turtle) simply covered itself overly with one-click-runnable examples. Lazarus seems to follow the same school, but I really haven't got to enjoy it. The main thing about them - you didn't have to do anything for them to run ..I cannot say the inherit quality I mean by this - every language has it's examples -; but I can mention I compare it with languages, where you either have to hack everything to get a simple example around the fact that it only supports a certain school video cards, or languages, which are not really sure, which ones are their most important features and benefits to show - for Turbo Pascal, examples were definitely programs, and definitely not too far from their point.

For me, example means a lot:
- A glimpse to a standard programming style, maybe up to things, which don't have to be written.
- Something very nice a program can do when you reach it. Even one or three good examples can make it feel very different when you first start a language.
- And last but not least - it somehow suggests that creator of a program has actually considered, how it behaves in reality. I mean, if it works in my computer, it's a quality product - for some programming languages, where for example mouse or video card example simply fails, it cannot be very encouraging to me to imagine a language creator, who simply could not figure out, how to write 200 lines of mouse code in their language in such a way that it perfectly works in any computer - well, I can imagine that a programmer has to work, to make real use of some very special mouses, or completely customized computer, but switching a video mode should not be a very special thing a manual really cannot explain you clearly.
TagsNo tags attached.
Fixed in Revision
Attached Files


related to 0027590 assignedJuha Manninen Example "SingleThreadingExample1" does not compile when Lazarus is installed globally/rpm/deb 
related to 0035446 assignedJuha Manninen IDE dialog "Example projects" layout 


Bart Broersma

2020-08-08 10:30

developer   ~0124653

And what exacty doe you propose to do now?
Install examples in a different (accessible to all user by default) folder? Does *nix have such a folder (Windows has: \Public\*)
Do a chmod 777 on the Lazarus folder?

We try to keep things (also for us) as simple as possible.
If you know how to program, we suppose you also have enough knowledge about you OS that you can solve this by simply copying the example's folder to a destination where you have write access.

IMO: resolve as "won' fix" or "no change required".

Juha Manninen

2020-08-09 10:42

developer   ~0124685

Last edited: 2020-08-09 10:42

View 2 revisions

The Tools -> "Example projects ..." window could offer a choice to copy a selected example project into a temporary writable directory.
The same window would need a revamp in any case. I don't have time to work on it right now but I can check and apply patches if somebody wants to do it.

Tambet Vaeli

2020-08-09 17:30

reporter   ~0124698


Directories: I think Linux has "/var" and "/tmp" folders - variables, temporaries -, where programs keep their more or less temporary data. I also don't know, what "/usr" is for - I think sometimes it suggests to put there manually installed binaries.
777: It's not the first time I installed FPC - first I installed it with downloaded installers (now it is Synaptic, common install). I reached the same thing every time - problems with rights. For me, anyway - my first install was all 777, but finally I had to run it as root; I don't remember, how, but there managed to be the same problems with examples.
For me, I don't also want to mess with unaligned rights too much - after having many tools and files set up like this, I have very strong need to turn to standard rights, so there have to be some.

The problem:
- Examples have to be read-only in their home; copies are good. That way it's a package. "/lib", generally, is ought to be more or less read-only for users.
- Builds, they cannot be read-only.
- By default, it is doing this in the same folders.

Debugging user rights:

Google does not give a generic solution for user rights for builds. I think comparing with "make" would be nice - that gave some. Or could it get a "make" alternative builder?

I was searching for debugger. It is hard to log user rights problems for building:
- It needs to get file list it wants to build, in advance. Is FPC/Lazarus strong-typed enough to know this?
- It needs to know the sources, which failed to make the files needed.
- It also needs to know, where it starts breaking rights from the other end - user right system not working, vulnearabilities and accidential saves.

(Collecting Information, Applying it)

Then, it can give a logfile to work with / include here..

Ability to change folder in between such debugging/logging/diagnostic would allow to create dialog to build into /tmp /var if lacking rights - Synaptic also uses /var for downloaded files, it can be cleaned, then. /var is not /tmp.

If it is able to list files it needs, files it planned to create, with folder and file rights, it is possible to debug/log.


I was thinking about this and finally reached, which would be standard mid-way solution a final release would not dismiss:
: source: Templates are working perfectly, "New project" works.
- "File -> New ..."
- "Examples -> Builtin example"
- With example list as templates.
I think that does not need much new deep features.

When installing Lazarus, it could ask "Do you want to build examples". As installer first sets up the directory, it has to have all the necessary rights. Then, "Run" without building would work, and "clean" would fail (as there are no rights).

Tambet Vaeli

2020-08-17 19:20

reporter   ~0124953

Well I found way better solution:

Dialog, which asks for userrights, has button to directly open given file or directory userrights properties. Where user is asked for master password on "unlock" button click - linux file managers has them built-in.

Tambet Vaeli

2020-08-17 19:31

reporter   ~0124954

Last edited: 2020-08-17 19:33

View 3 revisions

I mean, automatically open this dialog for linux any file, commands with a few differences in different linux environments - maybe nautilus would do for many?. Bash shell command would do for me. Make this command editable. with picture attached

some users would just add cmd-line option there?
PermissionTab.png (65,159 bytes)   
PermissionTab.png (65,159 bytes)   

Juha Manninen

2020-08-17 22:21

developer   ~0124956

@Tambet Vaeli, you are on a wrong track. Lazarus is not a type of application that needs elevated user rights. It means you would run example projects as root. No good!
Copying a selected project to somewhere under your home directory is the right solution.

I don't understand what your other long text is about. AFAIK all other building and debugging works.
Building the example projects is the only problem.

Tambet Vaeli

2020-08-28 13:52

reporter   ~0125172

I submitted an answer, but I lost it all, it said that my session is over or there is another problem. Next time I remember to copy my text.

I send my welcomes, but I will leave it for another day. Meanwhile I install FPC Text Mode from installer, into a custom folder, set up a few libraries and see whether I can run graphics in several modes from there. This is very possible I want to program my system's core in another language, and application functionality in FPC Pascal. This is very possible I am going to find information here, about how to bind them.
scr2.gif (34,483 bytes)   
scr2.gif (34,483 bytes)   

Juha Manninen

2020-08-29 15:26

developer   ~0125198

@Tambet Vaeli, please write here only comments relevant with the issue of running example projects. You can write other topics in forum or mailing list.

Issue History

Date Modified Username Field Change
2020-08-07 20:49 Tambet Vaeli New Issue
2020-08-08 10:30 Bart Broersma Note Added: 0124653
2020-08-09 10:35 Juha Manninen Relationship added related to 0027590
2020-08-09 10:36 Juha Manninen Relationship added related to 0035446
2020-08-09 10:42 Juha Manninen Note Added: 0124685
2020-08-09 10:42 Juha Manninen Note Edited: 0124685 View Revisions
2020-08-09 17:30 Tambet Vaeli Note Added: 0124698
2020-08-17 19:20 Tambet Vaeli Note Added: 0124953
2020-08-17 19:31 Tambet Vaeli Note Added: 0124954
2020-08-17 19:31 Tambet Vaeli File Added: PermissionTab.png
2020-08-17 19:32 Tambet Vaeli Note Edited: 0124954 View Revisions
2020-08-17 19:33 Tambet Vaeli Note Edited: 0124954 View Revisions
2020-08-17 22:21 Juha Manninen Note Added: 0124956
2020-08-28 13:52 Tambet Vaeli Note Added: 0125172
2020-08-28 13:52 Tambet Vaeli File Added: scr2.gif
2020-08-29 15:26 Juha Manninen Note Added: 0125198