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

Fighting with build issues and dependency hell #437

Closed
wants to merge 1 commit into from

Conversation

mmarinchenko
Copy link

@mmarinchenko mmarinchenko commented Mar 3, 2021

This is my first PR to Xamarin project so I might be doing wrong many of the following. Review carefully.

I ran into some issues while trying to build the project for the first time. This PR contains changes which I made while trying to improve build experience and subsequent maintenance. I didn't edit any of the Metadata.xml files within this PR (except for one that contained the only single s character inside).

If I missed something please provide me with instructions on how I can complete these changes or perform additional testing.


build.cake

  1. Addins and tools are bumped up to latest stable versions. Message about older Cake.Core is no longer appears in the build log.
  2. No need to have java executable in the PATH anymore. JAVA_HOME/bin/java is used to generate javadocs.
  3. No need to have nuget executable in the PATH or install NuGet.CommandLine addin anymore. MSBuild is always used to restore projects.
  4. MSBuild is always uses specified MAX_CPU_COUNT now.
  5. Unused code which caused CS0162 and CS0219 is commented out.

Dependencies

This is a tough one. Initially I noticed warnings NU1603 and NU1605 in the build log. I started solving them one by one and realized that the situation is much worse than I expected.

Eventually I sorted all dependencies by nugetId in almost every file throughout the repository, bumped their versions to highest stable and compatible ones (with few exceptions like monodroid90) and eliminated unnecessary duplicates. In files with long dependency lists (like config.json or Directory.Build.targets) I also left a comment in the end:

NOTE: Don't add new artifacts just to the end of this list! Keep it sorted by nugetId for maintainability. Thanks!

The downside of these changes is that they are difficult to review manually. I'm sorry. But the build itself completes successfully (at least on my Windows machine).


Other changes

  1. Some of the projects in the repository (mostly samples) had inconsistent build configurations. This has led to XA0119 warnings in the build log. I followed the instructions given at the link.
  2. There was "unused-almost-empty" project Firebase-Iid.csproj. I deleted it.
  3. Relative path to generated.targets was incorrect in GooglePlayServices.Tests.csproj.
  4. <NoWarn> tags were filled incorrectly in GooglePlayServicesProject.cshtml (I also added BG8A01 to BG8A00 and BG8A04).

@moljac
Copy link
Member

moljac commented Apr 18, 2021

@mmarinchenko

Wow. Thanks for the PR and feeback, but this one will be tough one due to the complexity

This is my first PR to Xamarin project so I might be doing wrong many of the following.

You did good job (in general) 😄

Review carefully.

I have to. 😄

I ran into some issues while trying to build the project for the first time. This PR contains changes which I made while trying to improve build experience and subsequent maintenance. I didn't edit any of the Metadata.xml files within this PR (except for one that contained the only single s character inside).

Nice.

If I missed something please provide me with instructions on how I can complete these changes or perform additional testing.

You did not miss anything. We are (I am) aware of the issues, but time is not on my side.

Some comments:

  1. try not to solve everything in one PR. I must request changes to split it into smaller ones
    1. cake fixes - seems like all of them can be in single PR
    2. Other changes - split it into samples and UI test fixes please
  2. dependencies
    I work on some tooling for productivity improvements (maven and google dependencies) and am still working manually, so
    reordering of artifacts will cause huge problems for maintenance (few years of habit having them in certain order which I
    inherited too). Most likely I will have to reject those changes.

Thanks a lot for your effort

cheers

@moljac moljac self-requested a review April 18, 2021 15:38
@mmarinchenko mmarinchenko marked this pull request as draft April 18, 2021 18:17
@mmarinchenko
Copy link
Author

mmarinchenko commented Apr 18, 2021

@moljac

try not to solve everything in one PR

Yeah, I underestimated the complexity of building this project in the beginning. I thought I'd make a boring little PR where I'd correct a couple of warnings😄

So please treat this PR as a work in progress. I marked it as draft. I'll create separate PRs when I have some spare time (and no dependency sorting, I get it).

@moljac
Copy link
Member

moljac commented Apr 18, 2021

@mmarinchenko Thanks a lot. Take your time

@mmarinchenko
Copy link
Author

mmarinchenko commented Apr 20, 2021

@moljac

Thanks a lot.

You're welcome!

I separated this PR to 3 logically coupled ones (with your comments in mind):

Please note that each of them is based on master so they are fail to build successfully (as master fails). I had to comment out <WarningsAsErrors> list in GooglePlayServicesProject.cshtml locally to test the builds.

@mmarinchenko
Copy link
Author

@moljac this PR with 3 child ones from the above #437 (comment) is quite outdated. Does it make sense to leave them open?

@jpobst
Copy link
Contributor

jpobst commented May 3, 2024

This PR is likely outdated and no longer relevant.

@jpobst jpobst closed this May 3, 2024
@mmarinchenko mmarinchenko deleted the build-fixes branch May 5, 2024 11:52
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.

None yet

3 participants