-
Notifications
You must be signed in to change notification settings - Fork 561
[build] see if we can allow long branch names #9983
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
[build] see if we can allow long branch names #9983
Conversation
If you open a PR with a long branch name, it can error with:
NuGet.Build.Tasks.Pack.targets(221,5): error NU5123: Warning As Error: The file 'package/services/metadata/core-properties/d9cd2ffb8cfc41bdbfe90e7dbc7228fb.psmdcp' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name.
Let's set `$(WarningAsMessages)=NU5123` for pull requests.
I think the warning, in general, is good to know if we create a path
inside a `.nupkg` that is too long. But for PRs, we should ignore it.
This also reverts some commits that "shorten" branch names, which
should no longer be needed:
* 7651b64
* 6d9b295
| <!-- Allow NU5123 for pull requests, which will have $SYSTEM_PULLREQUEST_ISFORK set to true or false --> | ||
| <NoWarn Condition=" '$(SYSTEM_PULLREQUEST_ISFORK)' != '' ">$(NoWarn);NU5123</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why, but this was the only $SYSTEM_PULLREQUEST_* variable set:
The rest were blank.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dovetailing with this question, what is the relevance to $(SYSTEM_PULLREQUEST_ISFORK) to ignore NU5123? Why is it (seemingly) safe to ignore NU5123 on PR builds, but not on "local"/"on my machine" builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking it would be good to allow NU5123 to warn (and then error) on release branches.
I don't believe any $(SYSTEM_PULLREQUEST_*) variables are set on release branches, because it isn't a pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately $(SYSTEM_PULLREQUEST_ISFORK) appears to always be set, it's present and set to False when running a CI build against a main branch.
We could try something like this instead:
<NoWarn Condition=" '$(BUILD_DEFINITIONNAME)' == 'Xamarin.Android-PR' ">$(NoWarn);NU5123</NoWarn>There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pjcollins is there any other way to know it's a pull request? Or do we just need to $(NoWarn)=NU5123 no matter what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was late with my edit above, I think we could update this to ignore NU5123 on builds that happen on our Xamarin.Android-PR pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to see if logs are correct
| <PropertyGroup> | ||
| <_BinlogPrefix>-bl:$(XamarinAndroidSourcePath)bin/Build$(Configuration)/msbuild-$([System.DateTime]::Now.ToString('yyyyMMddThhmmss'))-</_BinlogPrefix> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit 5fbce47.
…nch-names-that-should-work-duh
|
What are the implications of ignoring NU5123, and why is this "safe"? NU5123 states:
("200 characters" is presumably used to provide (some) "wiggle room" when NuGet packages are installed into Is it safe to ignore NU5123 because the branch name isn't part of |
I want to ignore it on PRs and not builds on any other branch. PRs will be the only ones with long names. |



If you open a PR with a long branch name, it can error with:
Let's ignore
NU5123for pull requests.I think the warning, in general, is good to know if we create a path inside a
.nupkgthat is too long. But for PRs, we should ignore it.This also reverts some commits that "shorten" branch names, which should no longer be needed:
While making this work, I noticed that the
CreateAllPackstarget did not emit.binlogfiles.I set it up to create them in the same format as we do in
make:Then added a suffix with each specific project name.