Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] What exactly is CDT core build?


> On 20 Aug 2020, at 22:29, Jonah Graham <jonah@xxxxxxxxxxxxxxxx> wrote:
> 
> A configuration is a set of definitions specific to the project. The file(s) used to store it must be portable, in other words it should not store absolute paths or other platform specific definitions, and generally should be valid on all platforms (Windows, macOS, GNU/Linux). Configuration files can be safely stored in repositories.
> 
> Preferences are definitions specific to a platform. They can include absolute paths and other information specific to the developer or the developer environment. Preferences should not be stored in repositories, since they generally collide with other team member preferences.
> 
> I think that is not the universal definitions in CDT for preferences vs configuration. It is complicated by the fact that Preferences is an API as well as a concept - more below.

I know it is complicated, and I had a lot of problems with projects that store configuration data as preferences.

But take a step back and think what (project) configuration is and how it differs from (user) preferences.

It is a pity that the documentation does not clearly make this distinction, and some plug-ins store configuration data in .settings, and then require those files to be saved in repositories.

> As an example, .project and .cproject are configuration files, and should be stored in the repository (assuming they include portable definitions), and the files in the .settings folder should generally not be saved in a repository.
> 
> I think this is an interesting point and I would appreciate some more insight on your views on this.

Sure, but I'm not sure I can explain it very well.

You should always imagine that a project is stored in a repository, and from there it is cloned by different users on different platforms (Windows, macOS, GNU/Linux).

Everything that is specific to the project (in other words the same for all users) should be considered project configuration and be stored in .cproject, and everything else that is specific for each user should be considered user preferences and be stored locally in .settings.

It is perfectly possible to add new sections in .cproject for this, but unfortunately many projects store this as preferences.

> I 100% agree that if there is an absolute path in a setting it should not (generally) be checked in, equally indexer settings related to performance and scalability. But most of what I generally see checked in .settings are things like formatter preferences, codan settings, language settings and other more minor stuff. 

I don't know, for me, as a non-native English speaker, the distinction between configuration and preferences is quite obvious.


Hope this helps,

Liviu



Back to the top