Skip to content

Move obj and bin directories into repo root #10063

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

Merged
merged 22 commits into from
May 15, 2019

Conversation

natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented May 8, 2019

Resolves #9928
Part of #7280 (converging to Arcade)

The Arcade SDK requires that the obj/ and bin/ folders be placed in the top-level artifacts/ folder of the repo. https://github.com/dotnet/arcade/blob/master/Documentation/ArcadeSdk.md#single-build-output Although this PR does not complete our Arcade convergence, this is a step towards updating our repo to build with the Arcade SDK.

Changes:

  • Set output path for build to artifacts/bin/$(ProjectName)/
  • Set intermediate output path for build to artifacts/obj/$(ProjectName)/
  • Cleanup .gitignore files (remove duplication between repo-root and tested gitignore files)
  • Add code check which looks for project files that share the same name (could cause issues)
  • Rename project files to have unique names (avoid race condition of build output)
  • Update all locations which were hard-coded to expect bin/ and obj/ in the project directory
  • Add overrides for tests which still assert test binaries exist in a given location relative to the source code

@Eilon Eilon added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label May 8, 2019
@BrennanConroy
Copy link
Member

@jkotalik Said something about installers

@natemcmaster
Copy link
Contributor Author

This is a draft PR. Lots of work to do before it's ready to merge. Among other this, hundreds of tests are written to assume the test binary is in a certain folder relative to the source code.

@natemcmaster
Copy link
Contributor Author

Test failures on this PR correspond exactly with tests that are disabled in Helix. The root of the problem appears to be the same -- the test code makes assumptions about the location of source code relative to the test binary. These assumptions are not true in Helix and not true in this PR where obj/ and bin/ directories have been moved.

Fixing this requires updating a lot of test code. @HaoK opened issues to track most of these test projects months ago, but we haven't seen traction on this. I see some of this issues have been punted or backlogged.

@mkArtakMSFT @Eilon @anurse - to move forward on this PR, I see 3 viable options:

  1. Kick the can down the road. Keep these tests disabled on Helix, and find a way to override the Arcade SDK to keep build output in the location the test code expects.
  2. Disablepoolza. I disable the tests completely until they are updated.
  3. Moar halp! We assign higher priority to fixing tests which are broken in Helix and this PR.

Thoughts?

By the way, here are the test projects that are broken:

image

@analogrelay
Copy link
Contributor

Sounds like it would be good to chat about this at a build team sync (unfortunately I'll be missing this Thursday's one...). I'd like to get them all fixed up and working (since Helix requires it too) but don't really have the resources right now to do it.

@HaoK
Copy link
Member

HaoK commented May 8, 2019

The good news is I'm somewhat close to finishing Components and Components E2e (those were mostly node issues). Also the two analyzer issues should be a cheap fix, as its just a max file path issue (rename a bunch of files).

So the big ones are really just: ProjectTemplates + hosting functionals left I think

@natemcmaster
Copy link
Contributor Author

@HaoK what are you doing about NodeJS? I'm wondering if we could re-use the approach I'm taking here to install mssql on-demand and extend it to include installing nodejs on-demand?

@HaoK
Copy link
Member

HaoK commented May 8, 2019

Yeah have to install nodjs on demand was basically their suggestion: https://github.com/dotnet/core-eng/issues/5302#issuecomment-490522509 I was going to try this today since they pinged me

@natemcmaster
Copy link
Contributor Author

Let's see if we can combine efforts on this. Will ping you internally.

@natemcmaster
Copy link
Contributor Author

We can discuss this more in manager sync today, but I'm favoring option 1

Kick the can down the road. Keep these tests disabled on Helix, and find a way to override the Arcade SDK to keep build output in the location the test code expects.

My concern is that we've been kicking the can down the road for months, but as this "can" is scoped to only 10 projects, it's maybe not that big a deal.

@natemcmaster
Copy link
Contributor Author

/azp run AspNetCore-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@natemcmaster natemcmaster marked this pull request as ready for review May 10, 2019 22:40
@natemcmaster
Copy link
Contributor Author

I'm going to send a PR to the team once this merges. After it goes in, everyone who pulls this change will need to do a git clean to remove obj/ directories, otherwise they'll start hitting dozens of compiler error caused by the compiler starting to pick up generated source code.

error CS0579: Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute

@natemcmaster
Copy link
Contributor Author

Flaky test: InputDateInteractsWithEditContext_NullableDateTimeOffset - appears to be unrelated to this change.

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

This PR contains a number of non-overlapping changes, making it larger than it needs to be and harder to review. Suggest splitting (say) the C++ settings consolidation, project renames and perhaps .gitignore cleanup into a separate PR.

@natemcmaster
Copy link
Contributor Author

@dougbu while it's certainly possible to split this PR, the changes made here were done for related reasons - changing the location of build output made the content of some gitignore files irrelevant, required ensuring project names are unique to avoid overlap in artifacts/bin/, and using a shared file for C++ made it easier to ensure all .vcxproj files have the new setting.

@natemcmaster
Copy link
Contributor Author

In other words, not planning to split this PR unless this somehow blocking the ability to review it.

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

Think I'm about ready to sign off. Suggest a quick offline chat to make sure I'm not missing anything.

<BaseIntermediateOutputPath />
<IntermediateOutputPath />
<BaseOutputPath />
<OutputPath />
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor but why don't $(BaseIntermediateOutputPath) and $(IntermediateOutputPath) need to be cleared elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Blazor build tools and targets are the only thing which expect the obj/ directory to exist in the project dir. See #5486. Everywhere else I tested this change, the projects and tests were okay with obj being moved to $repoRoot$/artifacts/obj/$projectName$

@@ -75,20 +75,15 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(Platform)\</OutDir>
Copy link
Contributor

Choose a reason for hiding this comment

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

Going forward, will VS restore these settings when we edit project settings? I've seen it undo changes similar to this…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened VS and built the project and didn't see .vcxproj files change. What would trigger VS to undo this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

Change something in the project's property page while in VS. If that update to the project doesn't regurgitate these settings, life is 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.

Seems to be okay. Didn't run into problems with VS when changing properties via UI.

@dougbu
Copy link
Contributor

dougbu commented May 15, 2019

Should we be concerned about the failing Helix run?

@natemcmaster
Copy link
Contributor Author

Helix failed with

Work item IISExpress.FunctionalTests/netcoreapp3.0 in job c2f5f074-88e1-4e43-877f-781abfb5abee has failed.

I'll rebase on changes Justin merged yesterday to handle this.

@natemcmaster
Copy link
Contributor Author

@natemcmaster natemcmaster merged commit dc90e11 into dotnet:master May 15, 2019
@natemcmaster natemcmaster deleted the obj-bin branch May 15, 2019 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the default repo layout to match dotnet/Arcade
6 participants