Forum > General

Cannot clean and Build - errors

<< < (3/3)

Martin_fr:

--- Quote from: wp on July 03, 2022, 12:16:12 pm ---AFAIK, in Linux, you should start Lazarus with the "startlazarus" application rather than with the "lazarus" binary directly. This way the compiled files are written to your user space, and later you can select whether you want to use the originally installed version or the recompiled version.

--- End quote ---

For compiling the sources "startlazarus" makes no difference.

If anything then "lazbuild" will make the diff.
Afaik, "make" itself will work in the directory it was invoked. Afaik, a full build will build lazbuild, and then call lazbuild to build the IDE, which then in turn would take care of writing results to the user's home dir (or wherever the "pcp" /primary-config-path is).



--- Quote from: MarkMLl on July 03, 2022, 12:26:52 pm ---
Would that really make a difference? I thought startlazarus was there as a restart shim if the IDE etc. was rebuilt.

In my case I put local builds of the IDE into /usr/local/share and make them staff-writable. I've also got startup scripts which handle --pcp automatically to prevent grossly-different versions confusing each other.

--- End quote ---

"startlazarus" also checks for a shadow build.

If lazarus is installed in a directory not writeable to the current user, and the current user installs a package (or for other reasons does a rebuild), then the new lazarus executable can not be written in the install dir. So the exe is written in the home directory, under the "pcp".

If you run startlazarus (from the install dir), then it will first check for an updated lazarus in the pcp.

MarkMLl:

--- Quote from: Martin_fr on July 03, 2022, 02:52:58 pm ---Afaik, "make" itself will work in the directory it was invoked. Afaik, a full build will build lazbuild, and then call lazbuild to build the IDE, which then in turn would take care of writing results to the user's home dir (or wherever the "pcp" /primary-config-path is).

--- End quote ---

So that would presumably include the .compiled file. In my case I can confirm that my locally built versions do have .compiled files in the /usr/local/share tree, but I've very carefully set directories etc. to be accessible before building them as a non-root user.

Is there a possibility that a Mint maintainer has built as root, hence leaving stuff that FPC would like to overwrite but can't?


--- Quote ---"startlazarus" also checks for a shadow build.

If lazarus is installed in a directory not writeable to the current user, and the current user installs a package (or for other reasons does a rebuild), then the new lazarus executable can not be written in the install dir. So the exe is written in the home directory, under the "pcp".

If you run startlazarus (from the install dir), then it will first check for an updated lazarus in the pcp.

--- End quote ---

Thanks for that.

MarkMLl

Martin_fr:

--- Quote from: MarkMLl on July 03, 2022, 03:41:09 pm ---
--- Quote from: Martin_fr on July 03, 2022, 02:52:58 pm ---Afaik, "make" itself will work in the directory it was invoked. Afaik, a full build will build lazbuild, and then call lazbuild to build the IDE, which then in turn would take care of writing results to the user's home dir (or wherever the "pcp" /primary-config-path is).

--- End quote ---

So that would presumably include the .compiled file. In my case I can confirm that my locally built versions do have .compiled files in the /usr/local/share tree,

--- End quote ---

You have to be more specific than "/usr/local/share tree".

There is components/buildintf/BuildIntf.compiled and that is part of the install. (or when you "regenerate Makefiles", assuming write permission).

And there is components/buildintf/units/x86_64-linux/BuildIntf.compiled which is generated. It's written when the ppu are created. (It may be done as copy of the first / not sure). And "make clean" would try to remove it, as it removes the ppu.


I have to say, I am not 100% an expert on those Makefiles. IIRC lazbuild is build first. And then the IDE should be build via lazbuild (not sure if the Makefiles actually do anything for the IDE, except calling lazbuild). Because, afaik (but double check to be sure) otherwise the whole compiling into your home dir would not work. => Since there needs to be a whole shadow infrastructure for all the ppu => And since then the ppu in the write protected folder will never be touched. => So even "make clean" needs to somehow honour that. Then again, all that can only happen if at least lazbuild exists (and again/still not sure). So if it doesn't, or if you call make in a way forcing it to rebuild lazbuild => no idea what happens. But it may well be that then you need write access to the install location.
I don't really ever run into this, since all my builds are from source, and all sources are always in my home dir. I don't have an install from the installer (except on my Windows box, for testing newly build installers)

Martin_fr:
And on the original post I did reply with

--- Quote from: Martin_fr on July 02, 2022, 07:22:07 pm ---Well, who owns the  file, what are the access rights?

If that is the only issue, and if there is no hidden other issue => just delete the entire folder

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---rm -rf /usr/share/lazarus/2.2.2/components/buildintf/units
--- End quote ---

So, if of course he tries to compile as non-root, while the files belong to root => then that is another issue, and it wont help to delete those files.

Still deleting them should not hurt. He will just get another error, until the access right issue is gone.

Either he logs in as root, and compiles in place.
Or he has a setup, where he compiles into the shadow folders in his home dir, and if he does, the deleted files should be created there.

If you rebuild from the IDE (and the existing installation has a copy of lazbuild as it should) then the IDE will take care.

If you run make yourself, I don't know how to tell it to use the shadow folders.

But to conclude this:

   @QEnnay:
if this is a new build from scratch, and you somehow installed the sources only => build it as root.

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---su -And then once you have a working copy, rebuild from the IDE.

Besides that, I recommend: If you build from sources, download the sources (as zip or tar.gz, or with git clone) and save the sources in your home folder. Then build there.

If you didn't  download source only, then I don't know why you call make yourself (or did I misunderstand that?).
Anyway, maybe the issue is in the shadow files in your home.
It be highly unusual... Normally the IDE is really good at maintaining those.
Check under

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---ls -la ~/.lazarus/There is one folder that has lots of ppu / I am not sure of the name (I don't have it, due to reasons above) => move it out of the way, and retry.


dbannon:
Lets be clear here. The startlazarus is an incredibly clever way of building and using a local version of lazarus while the user sits there thinking they are using a /usr install. You cannot help but be impressed by what it does but there is always some chance it will not work on any one system. Distro designers and users them selves can very easily create problems because startlazarus has to make a whole lot of assumptions.

So, if you use it, you have to accept it might not work and be prepared to abandon the idea. Fiddling, altering permissions under /usr, manually removing files, building as root, all compound the problem, make a complicated system even more complicated, more fragile and will almost always lead to trouble eventually.

If you rely on startlazarus, you MUST always start with startlazarus.

If startlazarus does not work, build from source !  (or, expert mode,  fix the underlying problem startlazarus encountered). Don't hack the OS.

Davo

Navigation

[0] Message Index

[*] Previous page

Go to full version