How to properly use [compat] section of project.toml?

I am attempting to use the [compat] section to fix the version of a package, say package C, in a package, say A, that I am developing. Suppose the most up to date version of C is C@1.4 while my project.toml for project A looks like:

[compat]
C = "1.1"

The issue I face occurs when, in a different project I am working on, say project B, I add the local version of package A:

]add /Users/local/path/to/A/

but then I see something like:

[0230ef0123] + C v1.4

in the log produced while adding package A to project B.

I then go back and look at the project.toml in package A, and it has been overwritten with the [compat] section removed.

How should add package A to project B instead such that package C v1.1 is added and not Cv1.4?

Thanks in advance :slight_smile:

Note that C = "1.1" doesnt mean exactly 1.1, it means anything semver compatible with 1.1, so basically [1.1, 2), which includes 1.4. For exactly 1.1 you want C = "=1.1".

That may be playing a role. I’m not sure why this is happening though:

1 Like

Thanks for clarifying how to specify versions. I do still have this odd issue of the project.toml being overwritten.

The issue regarding [compat] section being overwritten had to do with the difference between develop and add, and having not preformed a git commit.