Skip to content

Conversation

@CharliePoole
Copy link
Member

Fixes #1061

Once this merges, I'll need to delete any existing 3.14.0-devxxxxx entries with a larger suffix from MyGet.

@CharliePoole CharliePoole requested a review from a team December 31, 2021 06:19
@CharliePoole
Copy link
Member Author

CharliePoole commented Dec 31, 2021

Closed this PR and will reopen. The issue-1061 branch already has the same commits as master plus 2 more commits. The branch build is passing on AppVeyor but the PR fails. Let's see if reopening it helps!

@CharliePoole CharliePoole reopened this Dec 31, 2021
@@ -1,135 +1,45 @@
static string Target; Target = Argument("target", "Default");
static string Configuration; Configuration = Argument("configuration", "Release");
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if you try static readonly string Configuration = Argument("configuration", "Release");?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fair. Some things can't be readonly, of course, but I got carried away.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For those things, just a shortening of the syntax then, like:

Suggested change
static string Configuration; Configuration = Argument("configuration", "Release");
static string Configuration = Argument("configuration", "Release");

// NOTE: This is complicated because (1) the user may have specified
// the package version on the command-line and (2) GitVersion may
// or may not be available. We'll work on solving (2) by getting
// GitVersion to run for us on Linux, but (1) will alwas remain.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// GitVersion to run for us on Linux, but (1) will alwas remain.
// GitVersion to run for us on Linux, but (1) will always remain.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I should take most of this out. I got it running on Linux!

// or may not be available. We'll work on solving (2) by getting
// GitVersion to run for us on Linux, but (1) will alwas remain.
//
// We simplify things a by figuring out the full package version and
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// We simplify things a by figuring out the full package version and
// We simplify things by figuring out the full package version and

@CharliePoole
Copy link
Member Author

No help there! Suspecting some code, which only executes for a PR.

@CharliePoole
Copy link
Member Author

Thanks @jnm2. Now if I can just get the PR to build!

@CharliePoole
Copy link
Member Author

Diagnostic gives me...

GitVersion.BugException: GitVersion has a bug, Your HEAD has moved after repo normalisation.

To disable this error set an environment variable called IGNORE_NORMALISATION_GIT_HEAD_MOVE to 1.

Trying that next.

@jnm2
Copy link
Collaborator

jnm2 commented Dec 31, 2021

I wonder if it has anything to do with the fact that the PR build (not the branch build) is building a dynamically created merge commit back to the main branch.

@CharliePoole
Copy link
Member Author

Yes, I took a quick look at the code and that seems to be what it is. When I get a moment (I'm taking down our tree now) I'll try the suggested workaround in AppVeyor.yml. If that fails, I'm pretty sure I can merge locally and just push to master, but I'd prefer something that will keep working for future PRs.

@CharliePoole
Copy link
Member Author

Well, that makes it build by suppressing the error but it results in an improper PackageVersion for the PR. Not that important, since we don't do anything with artifacts from a PR build anyway. I'll do one more iteration cleaning out all my debug stuff.

BTW, this is issue GitTools/GitVersion#2554

@CharliePoole
Copy link
Member Author

A comment on the issue indicates that GitVersion 5.6.3 doesn't have the problem, so I'm trying that.

@CharliePoole CharliePoole force-pushed the issue-1061 branch 2 times, most recently from ff930c1 to c8ba618 Compare January 1, 2022 03:02
@CharliePoole
Copy link
Member Author

This seems to be as good as it gets for the moment. With GitVersion 5.0.0 (the version I have used in my other projects) I get failures in Azure. With 5.8.1 (latest) the aforementioned bug shows up. Everything passes in 5.6.3 but we no longer get a special naming pattern with a "pr" label and the PR number. However, since we don't publish them it doesn't matter that much. When I get a chance I'll follow up on this with a little test project.

@CharliePoole CharliePoole merged commit 215c253 into master Jan 1, 2022
@CharliePoole CharliePoole deleted the issue-1061 branch January 1, 2022 13:53
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.

Use GitVersion to determine package version to be produced

3 participants