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

Update ArPow local-onboarding guidance to include --work-tree option #2445

Closed
omajid opened this issue Sep 9, 2021 · 2 comments · Fixed by #2450
Closed

Update ArPow local-onboarding guidance to include --work-tree option #2445

omajid opened this issue Sep 9, 2021 · 2 comments · Fixed by #2450
Labels
area-doc Documentation improvements

Comments

@omajid
Copy link
Member

omajid commented Sep 9, 2021

https://github.com/dotnet/source-build/blob/main/Documentation/planning/arcade-powered-source-build/onboarding/local-onboarding.md#patching misses out on --work-tree option. We use that everywhere else. For example:

https://github.com/dotnet/installer/blob/74507010fafeb931a063f8649bff0b032ebc725b/src/SourceBuild/tarball/content/repos/Directory.Build.targets#L83

The option was originally added in #937 to allow tarball builds to work when it was extracted to a sub-directory of another (non-related) git repository.

For example, I see this error now manifesting as:

dotnet6.0/dotnet-1afc0b6892dcd718cd88e281f3acd840cb966a4d-x64-bootstrap/.dotnet/sdk/6.0.100-preview.6.21355.2/NuGet.targets(565,5): error : File 'dotnet6.0/dotnet-1afc0b6892dcd718cd88e281f3acd840cb966a4d-x64-bootstrap/src/nuget-client.7363366401b43f4ea250394db8dad3707e9a9636/NuGet.config' does not exist. [dotnet6.0/dotnet-1afc0b6892dcd718cd88e281f3acd840cb966a4d-x64-bootstrap/packages/restored/ArcadeBootstrapPackage/microsoft.dotnet.arcade.sdk/6.0.0-beta.21319.2/tools/Tools.proj]

Which looks impossible on first sight because https://github.com/NuGet/NuGet.Client/blob/7363366401b43f4ea250394db8dad3707e9a9636/eng/source-build-patches/0001-Rename-NuGet.Config-to-NuGet.config-to-account-for-a.patch was supposed to have renamed the file.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@omajid omajid changed the title Update local-onboarding guidance to include --work-tree option Update ArPow local-onboarding guidance to include --work-tree option Sep 9, 2021
omajid added a commit to omajid/dotnet-vstest that referenced this issue Sep 9, 2021
This makes things work better in a source-tarball build, where there may
be a .git directory somewhere in our parent directories but it's for a
different repo than vstest. In a situation like that a plain `git apply`
will (silently!) ignore patches because they wont apply to the unrelated
repository. That will (eventually) make the source-build fail.
`--work-tree` makes git directly use the directory that we care about.

See dotnet/source-build#2445 for more details.
@dseefeld dseefeld added area-doc Documentation improvements and removed untriaged labels Sep 9, 2021
Haplois pushed a commit to microsoft/vstest that referenced this issue Sep 9, 2021
This makes things work better in a source-tarball build, where there may
be a .git directory somewhere in our parent directories but it's for a
different repo than vstest. In a situation like that a plain `git apply`
will (silently!) ignore patches because they wont apply to the unrelated
repository. That will (eventually) make the source-build fail.
`--work-tree` makes git directly use the directory that we care about.

See dotnet/source-build#2445 for more details.
@omajid
Copy link
Member Author

omajid commented Sep 9, 2021

I looked through the existing repositories and opened PRs against all repos that needed the --work-tree argument:

With these fixes a local build of install works for me. Edit: still need similar patches for xliff-tasks and fsharp, but the source-build-patches have been integrated into main repo for those repos, so there's limited need for those in the longer term.

If/when we update to those SHAs in installer, we should get the fixes too. I can do backports to the release branches too, if someone can help me figure out which ones will be used by release/6.0.

omajid added a commit to omajid/dotnet-source-build that referenced this issue Sep 9, 2021
The generated (arpow) source-tarball is often built in a context where
it's under a subdirectory of an unrelated git repository. In such a
situation, `git apply` will try and apply patches to the main git
repository instead of the extracted source-tarball contents. That fails
(silently), so the patches never get applied. Building that
source-tarball eventually fails because of those missing patches.

Use --work-tree to tell git to apply patches to the tarball directory
and not to whatever git repo the tarball directory happens to be under.

Fixes: dotnet#2445
dseefeld pushed a commit that referenced this issue Sep 15, 2021
The generated (arpow) source-tarball is often built in a context where
it's under a subdirectory of an unrelated git repository. In such a
situation, `git apply` will try and apply patches to the main git
repository instead of the extracted source-tarball contents. That fails
(silently), so the patches never get applied. Building that
source-tarball eventually fails because of those missing patches.

Use --work-tree to tell git to apply patches to the tarball directory
and not to whatever git repo the tarball directory happens to be under.

Fixes: #2445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-doc Documentation improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants