Skip to content

Conversation

@KevinRansom
Copy link
Contributor

@KevinRansom KevinRansom commented May 31, 2020

Fixes: #9217

FSI, currently requires dependent assemblies to be referenced prior to assemblies that are dependent on them. This restriction is not observed in F# projects. This needs to be addressed for nuget package management in FSI because the package manager does not know about assembly load ordering and so can't order assembly loads accordingly.

What is happening, is that when we import types from assemblies, if we haven't yet read the assemblies in which referenced types live, we generate a thing called a ccuThunk, which allows us to fix up the reference later. In the compiler all of the referenced assemblies (except provided types) are read at startup and so fixups naturally happen, however, fsharp interactive is "iterative" and so, we don't get to do the fixing up, and so, FSI has always had this issue where assemblies need to be referenced in dependency order.

This fix, effectively stores the ccuthunks, until an assembly load can provide a backing assembly to reference. So effectively it removes the load ordering on which FSI was originally dependent.

Todo:

  1. A test
  2. I have to consider whether to change some existing code
  3. I am going to see if it can also help with another issue we are having

@KevinRansom KevinRansom requested a review from dsyme May 31, 2020 07:05
Copy link
Contributor

@dsyme dsyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks reasonable. Just a couple of questions and possible changes.

I'll mark it approved as the fix looks basically right and you can work through the questions

@KevinRansom
Copy link
Contributor Author

Shit !!!!!! I killed it.

@Happypig375
Copy link
Member

You can still reset the branch to 09c748a and force push again.

@KevinRansom
Copy link
Contributor Author

@Happypig375 thanks, I got worried for a second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nuget #r references do not resolve assemblies referenced through the primary one

3 participants