-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Build places dependent project outputs wrong folder #4869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
[Clarification by @anurse: This comment was originally written when this bug was describing a proposed solution of having This creates a bit of a problem for referencing the project dependencies to the compiler. Let's say you have three projects, A -> B -> C, and you run C would build into its own private binC directory, and copy its output to binA. On the other hand, for incrementality this is great news because each output directory has only files relevant to that project. It also enables a potential concurrent build by eliminating racing in the same directory (somewhat) |
FYI, I've updated the title and description to be more of a problem statement rather than a potential solution, to clarify the desired outcome. |
@cdmihai I don't actually think that would be a problem with my proposed solution, since the output of compiling project |
Marking as |
Even if we do copy the binaries to the project individual folder, how do we understand the relation from say dnx451 referencing net451. We need to understand that one is usable by the other and from there we could know from where tfm folder to pick up the dependency from, even if we still keep things compiled wherever, be it the first project folder, or the output folder passed in the command line. |
It should just follow the lock file, to me, wether it will find files in a single output (appended with config/tfm), or each individual project folder (with config/tfm), I don't really have a strong opinion about. But I do believe that the mapping from one tfm to another should be happening magically as far as compile is concerned. It will just follow the references. This way, if its target tfm is dnx451 and it depends on a project with net451, this mapping should be in the lock file and compile should reference that dependency with tfm net451. This way, we would still be building each project on their own tfm folders but it would still work. |
That's how the lock file works already. We just need to produce output paths to the correct place. The reason we eventually copy those p2p refs is to run them. In fact, we need to drop them in a RID specific folder for non class libraries |
@livarcocc @piotrpMSFT Hey folks, this is blocking our builds currently. Do you guys have an ETA for fixing it? cc: @danroth27 @Eilon |
I also think this inconsistency of target frameworks (project A built for framework X depends on project B built for framework Y) should be caught by Nuget restore, which should output an error like If this should not be an error, then there needs to be some logic somewhere with a compatibility table specifying how frameworks are compatible between themselves. Could the lock file contain this information? If a dependency is actually a project dependency, have the lock file point to its output directory dlls. |
I'll take a look at this since it's blocking us. |
@davidfowl any updates on this one? |
@victorhurdugaci I'm close. |
Right now, when you have project A depending on project B, we compile project B directly to project A's output directory. For example, consider the following projects:
A/project.json:
B/project.json:
Running
dotnet build
onA
results in the following files under theA
directory:Notice that
B
was built into thebin/Debug/dotnet5.4
folder (the TFM ofB
) rather than into thebin/Debug/dnxcore50
folder (the TFM ofA
, the project being built). As a result,A
's compilation then fails because it is expected to find the binary in thednxcore50
folder.An example of this is here: https://github.com/anurse/Scratch/tree/master/cli987. Clone the repo and go to that
cli987
folder, rundotnet restore
, thencd A
, thendotnet build
. It should succeed. However, it will actually fail with:error CS0006: Metadata file '...path.../cli987/A/bin/Debug/dnxcore50/B.dll' could not be found
/cc @livarcocc @piotrpMSFT @davidfowl
The text was updated successfully, but these errors were encountered: