Jump to content
David Schwartz

where are search paths stored?

Recommended Posts

Where are search paths stored?

 

There are the global search paths in Tools | Options (set when you install components), and the local ones that can be added for individual projects.

 

I'm running into an issue where I pulled a project out of git into its own isolated folder tree and tried to build it. I'm getting compiler errors because there are hits on previously unknown conflicts in component libs I have in my system. Clearly there are some ordering differences in search paths.

 

I compared .dproj files and didn't find any search paths that contained the offending folders (either implicitly or explicitly).

 

Maybe a better question is ... how do you go about setting up projects so everybody can extract the source code from git and build each project, and they result in substantially equivalent EXEs? Right now I can't get this one project to even compile due to component library conflicts even though we supposedly have the same component libraries installed.

 

(In this particular instance, we've got an old library from D7 era that was brought forward into DX10.2 and cleaned up so it doesn't produce the tons of hints and warnings it used to. In attempting this build, I discovered that a 3rd-party component vendor has incorporated this exact same library into their own source tree, and the compiler is finding this copy rather than the older one that's isolated and installed as a component. This newly discovered code is the older version with all of the hints and warnings from D7 days -- it was never cleaned up for newer Delphi versions. It also has some errors that stop the build. I'm trying to figure out how this folder is even being included in the library search path, as it's not in MY global search paths that Delphi loads up.)

Share this post


Link to post

HKLM\Software\WOW6432Node\Embarcadero\BDS\<version>\Library\*

and a copy for each user under

HKCU\Software\Embarcadero\BDS\<version>\Library\*

 

The latter is the one edited in the Tools -> Options dialog.

  • Like 1

Share this post


Link to post

Somewhat off topic, but related.
Ctr+-F12 gives you a list of units to open, and I assumed it was from the search paths and project paths, 

Turns out that it also will look at the .dpr uses statement.

 

Ideally, the paths should be relative...

uses

  SomeUnit in '..\RelativeFolder\SomeUnit.pas'

 

But, I had a stale test project in my project group where the uses path used an explicit path

uses

  SomeUnit in 'c:\Obsolete.Path\to\RelativeFolder\SomeUnit.pas'

 

So, pressing Ctrl+F12 gave me both of these - even if Obsolete.Path didn't exist.

  • Like 1

Share this post


Link to post

So they're not stored anywhere that would be captured by a source code control system like git, eh? hmmmm.....

 

How in the world would this particular path be "unmasked" from another project if the lib search paths are not affected?

 

(And if it's not from a uses clause containing an absolute path to it somewhere...)

Share this post


Link to post
5 minutes ago, David Schwartz said:

So they're not stored anywhere that would be captured by a source code control system like git, eh? hmmmm.....

That's why I restrict those paths to the Delphi ones. For any library used in a project there will be a search path entry in the project file.

 

Unfortunately some library vendors or maintainers sacrifice the minimalism of these global search paths for the simplicity of their setup experience.

  • Like 2

Share this post


Link to post

Ref. paths and VCS systems...


We use standard paths 

  C:\SomeFolder\Projects

   Common

      ThisCollection

      ThatCollection
   External

      Lib1

      Lib2
   Proj1
   Proj2

 

We also use a $BIN environment var to direct the project outputs.  Allows the team members great freedom for where to put their source, and where to direct the output.

 

and try to ensure that all project search or include paths are on this form ..\Common\ThisCollection
Those are stored in the .dproj which can be committed to the VCS.

 

That also allows me to check out various versions

   Projects        <- my typical working branch switched between trunk/pilot/live

   Projects.Rio  <- while still on Tokyo, but testing Rio

   Projects.Trunk 

   Projects.Pilot

   Projects.Live

  

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×