Skip to content

Conversation

@adamralph
Copy link
Contributor

This is a refactoring of the changes in #923 which fixed #922.

Whilst that PR fixed the bug and allowed us to ship 0.13.2, I was quite uncomfortable leaving AssemblyUtility.IsManagedAssembly() returning true whenever the the path passed to it isn't rooted and doesn't end in 'dll' or 'exe'. For instance, I could pass "ThisDoesNotExist.txt" into it and it would return true.

In this PR I've reverted AssemblyUtility and instead changed PackageAssemblyResolver to filter out unmanaged assemblies from the list returned from IPackageObject.GetCompatibleDlls() before concatenating them with IPackageObject.FrameworkAssemblies.

IMO the quickest way to review this PR is one commit at a time.

@glennblock
Copy link
Contributor

While true, it is not really an issue as the classes that use
AssemblyUtility only scan dlls and exes. The text file will never get
loaded or indicated as a reference.

I don't have a big concern but I don't think was needed.
On Sat, Feb 7, 2015 at 2:38 PM Adam Ralph notifications@github.com wrote:

This is a refactoring of the changes in #923
#923 which fixed #922
#922.

Whilst that PR fixed the bug and allowed us to ship 0.13.2, I was quite
uncomfortable leaving AssemblyUtility.IsManagedAssembly() returning true
whenever the the path passed to it isn't rooted and doesn't end in 'dll' or
'exe'. For instance, I could pass "ThisDoesNotExist.txt" into it and it
would return true.

In this PR I've reverted AssemblyUtility and instead changed
PackageAssemblyResolver to filter out unmanaged assemblies from the list
returned from IPackageObject.GetCompatibleDlls() before concatenating
them with IPackageObject.FrameworkAssemblies.

IMO the quickest way to review this PR is one commit at a time.

You can view, comment on, or merge this pull request online at:

#926
Commit Summary

  • refactor: simplify conditional, fix whitespace, remove and sort
    usings
  • green: add scenario
    Packages.PackageContainsAFrameworkAssemblyReference
  • red: revert 923 AssemblyUtility changes
  • green: implement scenario
    Packages.PackageContainsAFrameworkAssemblyReference
  • refactor: AssemblyResolver and PackageAssemblyResolver internals

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#926.

@adamralph
Copy link
Contributor Author

It's true that the original fix was fine given all the calls made to AssemblyUtility.IsManagedAssembly from the scriptcs codebase, but the method is public and packaged in core, so I think it's important that it conveys the correct semantics. In fact, even if it was internal, I'd still consider this important.

@adamralph
Copy link
Contributor Author

@scriptcs/core does anyone fancy merging this? Are there any concerns? It should be quite quick to review if you take one commit at a time.

khellang added a commit that referenced this pull request Feb 10, 2015
@khellang khellang merged commit c6fa3c8 into scriptcs:dev Feb 10, 2015
@khellang
Copy link
Member

@adamralph 👍

@khellang khellang added this to the v0.14 milestone Feb 10, 2015
@adamralph adamralph deleted the 923-refactoring branch February 10, 2015 11:13
@adamralph
Copy link
Contributor Author

woot! thanks @khellang

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scriptcs 0.13.1 crashes when a package has a framework assembly reference

3 participants