Skip to content
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

[MMP] Allow resolving assemblies to the ones passed in command line args #3575

Merged
merged 2 commits into from
Mar 2, 2018

Conversation

Therzok
Copy link
Contributor

@Therzok Therzok commented Feb 22, 2018

This reverts the recursive directory search commit and allows resolving assemblies from the ones passed.

@Therzok
Copy link
Contributor Author

Therzok commented Feb 22, 2018

I think this should be cherry-picked to 15.7, so the --recursive-directories option is not surfaced to anyone.

@chamons
Copy link
Contributor

chamons commented Feb 22, 2018

I agree on removing --recursive-directories in 15.7. I am hesitant to add the

+                CommandLineAssemblies = RootAssemblies,

bit since that changes behavior, and mmp behavior is non-trivial and not testing as much as I'd like.

Though it is likely fine.

@chamons chamons added the run-mmp-tests Run the mmp tests label Feb 22, 2018
@chamons
Copy link
Contributor

chamons commented Feb 22, 2018

build

#if MMP
resolver.RecursiveSearchDirectories.AddRange (Driver.RecursiveSearchDirectories);
CommandLineAssemblies = RootAssemblies,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what actually makes the MonoMacResolver actually resolve to assemblies given as arguments. I can add another list to be checked, but I think this is fine.

  1. This code path is --runregistrar specific
  2. The other bit of code which sets this is inside Pack, which is the other hit when the action is not --runregistrar

if (action == Action.RunRegistrar) {

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that this is the correct fix at face value. And I'm totally cool with it going into master.

I've just been burned enough times with last minute behavior changes in release branches that i'm hesitant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Want me to split the PR into 2 commits? One which reverts recursive search dirs and one which implements this?

So we can backport the revert safely?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would be grand. ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

This is what actually makes the MonoMacResolver actually resolve to
assemblies given as arguments.

This mirrors the behaviour of Pack, which is called on the other
code-path (that's not --runregistrar)

https://github.com/xamarin/xamarin-macios/blob/3113c5d2b5cca730372177e9b1cee17062a959ff/tools/mmp/driver.cs#L513
Copy link
Contributor

@spouliot spouliot left a comment

Choose a reason for hiding this comment

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

I think it's a much better approach :) I did not like that new option - too many ways to misuse it

@spouliot
Copy link
Contributor

Note: this must be in d15-7 otherwise the option will become public (and can't be removed as easily).

Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

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

LGTM

@monojenkins
Copy link
Collaborator

Build failure

@spouliot
Copy link
Contributor

@chamons I think that before (unreleased) 15.7 it was not allowed to have more than one root assembly - so whatever behaviour is new (and can't break existing apps), right ?

@chamons
Copy link
Contributor

chamons commented Feb 23, 2018

I think so @spouliot but I'm not 100% certain without some archaeology.

@rolfbjarne
Copy link
Member

This change is only when passing --runregistrar to mmp, which is an internal option:

{ "runregistrar:", "Runs the registrar on the input assembly and outputs a corresponding native library.",
v => {
action = Action.RunRegistrar;
App.RegistrarOutputLibrary = v;
},
true /* this is an internal option */

Thus we shouldn't have to care for backwards compatibility.

@chamons
Copy link
Contributor

chamons commented Feb 23, 2018

Alright, then I can stop being paranoid (in this case).

@chamons
Copy link
Contributor

chamons commented Feb 23, 2018

Strange...

17:28:54.0766340 ERROR [2018-02-22 17:28:54Z]: Error reading assembly '/Library/Frameworks/Mono.framework/Versions/5.10.0/lib/mono/4.0-api/System.DirectoryServices.dll' in framework '.NETFramework,Version=v4.0':
17:28:54.0766830 System.Threading.ThreadAbortException
Assertion failure in void assertRunningOnAppKitThread

Trying one more time before filing maccore issues.

@chamons
Copy link
Contributor

chamons commented Feb 23, 2018

build

@monojenkins
Copy link
Collaborator

Build failure

@chamons
Copy link
Contributor

chamons commented Mar 1, 2018

build

@monojenkins
Copy link
Collaborator

Build failure

@chamons
Copy link
Contributor

chamons commented Mar 2, 2018

@chamons chamons merged commit d4d542d into master Mar 2, 2018
@chamons chamons deleted the mmp-resolve branch March 2, 2018 18:59
chamons pushed a commit to chamons/xamarin-macios that referenced this pull request Mar 2, 2018
…rgs (xamarin#3575)

* [MMP] Revert recursive search dirs changes
* [MMP] Allow resolving assemblies to the ones passed in command line args

This is what actually makes the MonoMacResolver actually resolve to
assemblies given as arguments.

This mirrors the behaviour of Pack, which is called on the other
code-path (that's not --runregistrar)

https://github.com/xamarin/xamarin-macios/blob/3113c5d2b5cca730372177e9b1cee17062a959ff/tools/mmp/driver.cs#L513
@chamons
Copy link
Contributor

chamons commented Mar 2, 2018

#3651 for d15-7

chamons added a commit that referenced this pull request Mar 5, 2018
…rgs (#3575) (#3651)

* [MMP] Revert recursive search dirs changes
* [MMP] Allow resolving assemblies to the ones passed in command line args

This is what actually makes the MonoMacResolver actually resolve to
assemblies given as arguments.

This mirrors the behaviour of Pack, which is called on the other
code-path (that's not --runregistrar)

https://github.com/xamarin/xamarin-macios/blob/3113c5d2b5cca730372177e9b1cee17062a959ff/tools/mmp/driver.cs#L513
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-mmp-tests Run the mmp tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants