Forum > Designer

"TestAll" project issues

(1/6) > >>

JuhaManninen:
This Aruna's quote is copied from the "Bugs in Example Projects window" thread.


--- Quote from: Aruna on December 09, 2022, 12:53:41 am ---I ran git blame examples/testall.lpi and below is what is of interest to us.

--- Code: Text  [+][-]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";}};} ---87791326d0d (bart     2016-03-04 15:05:52 +0000  87)     <SearchPaths>87791326d0d (bart     2016-03-04 15:05:52 +0000  88)       <IncludeFiles Value="$(ProjOutDir)"/>5328b9a852b (juha     2019-05-06 11:32:58 +0000  89)       <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>87791326d0d (bart     2016-03-04 15:05:52 +0000  90)     </SearchPaths> 
In 2019 Juha added  <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> this works for windows but does not work for Linux
as seen by the error message below.

--- End quote ---
git blame shows who touched a certain line last. It does not show further history nor the diff of the commits mentioned. For that you need another tool like gitk.
Commit 5328b9a852b is from 2019-05-06. Here is the diff :

--- Code: --- <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="10"/>
+    <Version Value="12"/>
     <General>
+      <Flags>
+        <CompatibilityMode Value="True"/>
+      </Flags>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="testall"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
@@ -47,9 +49,10 @@
       <Version Value="2"/>
     </PublishOptions>
     <RunParams>
-      <local>
-        <FormatVersion Value="1"/>
-      </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default"/>
+      </Modes>
     </RunParams>
     <RequiredPackages Count="1">
       <Item1>
@@ -83,7 +86,7 @@
     </Target>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>
-      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     <CodeGeneration>
       <Checks>
--- End code ---

There is a related commit 337b198136 from 2020-12-11. Its diff :

--- Code: ---@@ -21,7 +21,7 @@
           </Target>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir)"/>
-            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           <CodeGeneration>
             <Optimizations>
--- End code ---

As you can see I fixed the path delimiters so that they work also on Linux and Unix systems.


--- Quote ---
--- Code: Text  [+][-]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";}};} ---Unable to write state file for project ProjectError: Unable to create file "/home/aruna/lazarus/examples/lib\x86_64-linux/testall.compiled": No such file or directory The path is all that needs to be fixed so I changed the '\' backslash after /home/aruna/lazarus/examples/lib\ to a forward slash and now it works on linux. My question to you all is the testall.lpi file contents are in XML format so how do I do something like {$ifdef linux} in a XML file for christ sake  ::) OR as is usual in my case I am missing something  obvious?

--- End quote ---
'/' in path settings works also on Windows. The IDE at some point converts it to '\' for Windows. No need for {$ifdef linux} in XML.
Why you have '\' there? I don't know.
Maybe you checked out (git checkout) a revision earlier than commit 337b198136.
Maybe you have local changes after you played with the commit history. Then do "git reset --hard" but be careful with it. You may lose changes you wanted to keep.
I assume you have the "main" branch active.

Aruna:

--- Quote from: JuhaManninen on December 10, 2022, 08:21:40 pm ---As you can see I fixed the path delimiters so that they work also on Linux and Unix systems.

--- End quote ---
Yes I saw that after I had sent out my email.


--- Quote from: JuhaManninen on December 10, 2022, 08:21:40 pm ---'/' in path settings works also on Windows. The IDE at some point converts it to '\' for Windows. No need for {$ifdef linux} in XML.

--- End quote ---
[EDIT] No wonder... I want to see how and where the IDE is converting this I was quite perplexed when it did work fine on both windows and my linux. Now I know the reason haha  :)


--- Quote from: JuhaManninen on December 10, 2022, 08:21:40 pm ---Why you have '\' there? I don't know.

--- End quote ---
Initially because I had checked out a branch which did not have your fix and now because 'I' went and changed it to trigger the error. It is all good now. Thank you. Sorry for causing any confusion.


--- Quote from: JuhaManninen on December 10, 2022, 08:21:40 pm ---Maybe you checked out (git checkout) a revision earlier than commit 337b198136.

--- End quote ---
Yes that was why.


--- Quote from: JuhaManninen on December 10, 2022, 08:21:40 pm ---Maybe you have local changes after you played with the commit history. Then do "git reset --hard" but be careful with it. You may lose changes you wanted to keep.
I assume you have the "main" branch active.

--- End quote ---
The main branch I check out when I need to but I am mostly on fixes_2_2 because that is the branch that has the other examples that need work.

JuhaManninen:

--- Quote ---The main branch I check out when I need to but I am mostly on fixes_2_2 because that is the branch that has the other examples that need work.

--- End quote ---
You mean the examples that were deleted from "main"? The examples that were not deleted, were moved to another directory and can still be found in "main".
The ones that were deleted, may have been changed in "main" before the deletion. "fixes_2_2" branch does not have those changes.
At least "TestAll" was changed in "main".
Instead of working with "fixes_2_2" you should go to a "main" revision just before the deletion, then copy the examples you need somewhere and then return to "main" HEAD.
Later create a local feature branch for your own changes. That branch can be rebased against "main" from time to time.

The deletion happened in revision 31328882fb8d3acace
Date: 05/03/2022
Message: Example projects tested, categorised, metadata added, restructured by David Bannon.

The revision before that is 4030fcc52c936a, dealing with Codetools.
Do "git checkout 4030fcc52c936a", then copy the files.

JuhaManninen:

--- Quote from: Aruna on December 11, 2022, 04:49:17 am ---I want to see how and where the IDE is converting this I was quite perplexed when it did work fine on both windows and my linux. Now I know the reason haha  :)

--- End quote ---
Unit LazFileUtils has function SwitchPathDelims(). Search for it in all Lazarus sources, whole words only. You should get 52 matches. Study the code that calls it.
'\' path delimiter is processed also in some other functions.

JuhaManninen:
This Aruna's question was in "Bugs in Example Projects window" thread. I reply it here.


--- Quote from: Aruna on December 21, 2022, 02:13:02 am ---I just moved all 'testall' files to lcl/tests in branch fixes_2_2 on my local repository and pushed to my remote everything went well. Now when I try to create a merge request gitlab starts complaining please see attached screenshot.

--- End quote ---
Don't use fixes_2_2 branch when you participate in the development process. You must use the "main" branch.
Some bug fix commits are then backported to fixes_2_2 but everything goes to "main" first.

The Lazarus development version is very usable most of the time. You should consider using it exclusively unless you maintain some customer application which requires max stability.
For example I play only with the "main" development version because I don't have such projects to maintain now.


--- Quote from: Aruna on December 22, 2022, 12:40:11 am ---So I have to
- fork the Lazarus Repo, then..
- clone the fork to my local system, then..
- somehow get the local repo to fetch/pull from the original Lazarus main/trunk.

--- End quote ---
You can skip the GitLab merge request process if you don't like it. Patches are still supported.
Work with your changes in a local feature branch ("git switch -c myfeature") and "git rebase main" it sometimes.
Create patch(es) with "git format-patch main" while your feature branch is active. The rebasing guarantees there will be no merge conflicts when it is applied. Upload the patch to an issue report or somewhere.

For the TestAll project you don't need to create a patch. For the revision control those files are new, thus the diff format is not needed.
Just upload the files here in forum post or in mailing list post or in issue tracker as a .zip or .tgz package or similar. First make sure it compiles and works with latest "main".

I don't know well the GitHub and GitLab processes either. I used Git locally for Lazarus development already when it was in a SVN server, by using a git-svn link. It worked very well and I had a real Git repository locally with all its goodies.
Now I mostly synchronize with the server with "git pull" and "git push" using the default "main" branch. Super easy. I guess I should learn to work with remote branches better.

P.S.

--- Quote ---Since I started working again time has become a very limited commodity for my personal projects.

--- End quote ---
Do you also work with carrots? Or some other vegetables maybe?  ;)

Navigation

[0] Message Index

[#] Next page

Go to full version