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

Exclude uap in WinUI package, wasdk in UWP package #500

Merged
merged 8 commits into from
Sep 16, 2024

Conversation

Arlodotexe
Copy link
Member

@Arlodotexe Arlodotexe commented Sep 6, 2024

This PR fixes an issue with our CI where the built UWP and WinUI packages included "All" multitargets.

Including both doesn't cause issues in UWP or WinUI projects normally as the correct TFM is picked up. However, in certain scenarios uap may be picked up when the winappsdk TFMs were intended, such as in the packaging project for applications using the Windows Application Packaging setup.

Closes #490 (comment)

@Arlodotexe Arlodotexe changed the title Exclude uwp target under WinUI 3 build and wasdk under WinUI 2 build. Exclude uap in WinUI package, wasdk in UWP package Sep 6, 2024
@michael-hawker
Copy link
Member

Ah, I see, our old setup used to do this at one point, as we had discussed whether packages should contain the other framework for Windows developers, and then hit an issue with that scenario, so we removed it at one point. That was this issue here: #220 (I added this comment to this new issue, we can classify this as a regression at least.)

@Arlodotexe
Copy link
Member Author

That's right @michael-hawker. In the local solution, we allow all to include both uwp and wasdk regardless of the WinUI major version requested, to allow them to both load in our solution. It's not behavior we want from our CI due to the way other solution setups might select the wrong TFM.

@Arlodotexe Arlodotexe added regression What was working is now broke CI/pipeline 🔬 labels Sep 6, 2024
@Arlodotexe Arlodotexe self-assigned this Sep 6, 2024
@Arlodotexe
Copy link
Member Author

Checking from the PR feed, it looks like this didn't change the TFMs produced 🤔

Need to investigate why. It's either a variable not being passed into the CI step, or the value is being passed and it's an issue with the underlying script.

@Arlodotexe
Copy link
Member Author

Found the issue, easy mistake. Should work now.

@Arlodotexe
Copy link
Member Author

@michael-hawker Looks like that did the trick, we should be good to go!

image

@Arlodotexe
Copy link
Member Author

Curious why UWP is missing symbols though 🤔

Should we do a follow-up patch PR or try fixing it here? Seems priority to ship this patch for Windows Application Packaging project users.

@michael-hawker
Copy link
Member

Hmm, I see the UWP ones from the main latest feed missing it too:

image

Though our released 8.1.240821 seems fine for both on our MainLatest feed.

We should try and understand what's happened here. Looks like it started in the first build of 8.2 (above)

Ugh, looks like our 1148 with just the version got stuck 😡 https://github.com/CommunityToolkit/Windows/actions/runs/10514400206/job/29135997093 - going to re-kick that if I can to see what that looks like for comparison as that should just be the version number change.

1153 corresponds from this PR here: #457 with our update to WASDK 1.6, so somehow the flags are getting changed because of that.


Our goal is to patch this into 8.1 though, so this should be unaffected and something we can do still.

But, I thought you were planning to branch this PR from main before we switched to 8.2? Why are we getting the 8.2 version numbers/changes?

Our plan should be either:

  1. Fix forward and backport for the hotfix
    a. Ensure this is rebased on main and integrate as-is
    b. File a new ticket for the compiler symbols/flags, etc... to resolve for 8.2
    c. locally, create a new rel/8.1.YYMMDD branch from the rel/8.1.240821 branch and cherry-pick this specific build script change commit
    d. push that branch, validate the package in ADO feed, and push the hotfix release to NuGet
  2. Backfix and re-integrate
    a. locally create a rel/8.1.YYMMDD branch and rebase this commit on top of rel/8.1.YYMMDD in that branch
    b. push that branch, validate the package in ADO feed, and push the hotfix release to NuGet
    c. merge that rel branch back into main

@azchohfi we haven't done a hotfix in our new branching model like this, so would appreciate any insights, recommendations, or feedback you have with these approaches.

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 9, 2024

Good catch @michael-hawker, it should still be 8.1, not 8.2.

I branched off of b99aa1f, which is tagged as our 8.1 release and is the commit just before we bumped our version to 8.2 4b6c77a on main, so that's a good question 🤔

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 10, 2024

Built this branch locally at the current head 952b239, no issue with version or symbols.

image

Must be something in the CI 🤔

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 10, 2024

Looks like the CI is checking out f054447 (see run), which is a merge commit of 952b239 (the commit we intended to build) into 3e6703b (latest from main).

The commit checked out by Actions does not match my local branch, which still has this branch and main well separated:

image

If we browse the repo at the current branch fix/nupkg/uap-in-winui-package, we can see that Directory.Build.props is still set to 8.1.

Using GitHub's compare tool fix/nupkg/uap-in-winui-package...main, we can see the 8.2 bump hasn't been merged into this branch yet.
image

GitHub Actions is checking out with a detached merge between this branch and main, adding commits intended for 8.2.
But why?

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 10, 2024

Found an open issue: actions/checkout#1359

This is one potential workaround, but we'd need variations for each job and ref source (main, pr, release, other).

- uses: 'actions/checkout@v4'
   with:
     ref: ${{ github.event.pull_request.head.sha }}

Maybe there's a better way, some other variable we can use. Will skim the docs.

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 10, 2024

Looks like this setup:

- name: Checkout Repository
  uses: actions/checkout@v4
  with:
    submodules: recursive
    ref: ${{ github.ref }}

is checking out via:

Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/pull/500/merge:refs/remotes/pull/500/merge
  From https://github.com/CommunityToolkit/Windows
   * [new ref]         refs/pull/500/merge -> pull/500/merge

using the branch ref instead of the commit hash:

Fetching the repository
  "C:\Program Files\Git\bin\git.exe" -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +f0544474d2f9bd86ea8ced7e9c2fb9f724d936b6:refs/remotes/pull/500/merge
  From https://github.com/CommunityToolkit/Windows
   * [new ref]         f0544474d2f9bd86ea8ced7e9c2fb9f724d936b6 -> pull/500/merge

Which tells us that this variable ref: ${{ github.ref }} is pre-resolved and provided as a hash by default, whereas here we've provided it as a branch name.

Either way, this resolves to an unexpected merge commit 8fc117d, a different hash but the same problem as before. It's a merge of 3e6703b and a9cb1b6.

It stands to reason that the ref refs/remotes/pull/500/merge provided by GitHub always has the merge from main already in it, though I can't access these refs from a local terminal to check.

@michael-hawker What now? Is this something we can even fix, or do we try to work around it for now by setting this branch to merge elsewhere?

@Arlodotexe Arlodotexe changed the base branch from main to pre/rel/8.1.240911 September 11, 2024 16:10
@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 11, 2024

@michael-hawker I've created a pre/rel/8.1.240911 branch from our existing rel/8.1.240821 and changed this PR base to that branch. Hopefully should resolve the merge issue we're seeing with Actions during checkout.

If all looks good here, we can:

  1. Merge this PR into pre/rel/8.1.240911
  2. Create a new rel/8.1.240911 branch off of pre/rel/8.1.240911 for releasing the patch.
  3. Open a PR merging pre/rel/8.1.240911 or rel/8.1.240911 into main

@Arlodotexe
Copy link
Member Author

Looks like some checks aren't appearing in CI now, closing and re-opening to fix.

@Arlodotexe Arlodotexe closed this Sep 11, 2024
@Arlodotexe Arlodotexe reopened this Sep 11, 2024
@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 11, 2024

@michael-hawker CI ran once through without the detached merge from main we saw before, but won't run again because of our build.yml preferences. Seems like they only kicked in when I pushed, after changing the base branch from main to pre/rel/8.1.240911. Thoughts?

branches: [ main ]

For moving forward:

  • We could ignore this for now and could keep moving, since the last two commits are cleanup and shouldn't change any behavior. The one CI run done before these two commits have validated that the issue is fixed.
  • We could/should lay out some "official" process for shipping these patches without all of main, as that would include our 8.2 changes.

@Arlodotexe Arlodotexe changed the base branch from pre/rel/8.1.240911 to dev/rel/8.1.240912 September 12, 2024 19:34
@Arlodotexe Arlodotexe closed this Sep 12, 2024
@Arlodotexe Arlodotexe reopened this Sep 12, 2024
@Arlodotexe
Copy link
Member Author

Checks still aren't running, maybe c859b6e needs to be in the target branch? 🤔

@Arlodotexe
Copy link
Member Author

That didn't help... Need to figure out where GitHub is getting the policy from for this.

@michael-hawker
Copy link
Member

Checks still aren't running, maybe c859b6e needs to be in the target branch? 🤔

I think you need it duplicated in the push trigger as well? Not 100% sure, but that's what I'd try next.

@Arlodotexe
Copy link
Member Author

We merged both #504 and #505 into main, the same commits pushed to dev/rel/8.1.240912 and fix/nupkg/uap-in-winui-package (this branch).

This should have allowed CI checks to run for merging into a dev/* branch instead of just main, but that doesn't seem to have worked.

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Sep 13, 2024

@michael-hawker For now, I've manually kicked off CommunityToolkit/Windows/actions/runs/10853721313. It's still not clear why checks aren't running here.

@michael-hawker michael-hawker merged commit 28e6925 into dev/rel/8.1.240912 Sep 16, 2024
24 checks passed
@michael-hawker
Copy link
Member

As discussed, squashed into the prep branch. Next step is to merge into main and kick-off a hotfix for 8.1

Arlodotexe added a commit that referenced this pull request Sep 16, 2024
* Update build.yml to include 'dev/*' branches in pull_request event

* Update CI to trigger on branch push to 'dev/*'

* Exclude uap in WinUI package, wasdk in UWP package (#500)

* Exclude uwp target under WinUI 3 build and wasdk under WinUI 2 build.

* Fixed typo in param name

* Checkout repo at ref that triggered workflow run.

* Revert "Checkout repo at ref that triggered workflow run."

This reverts commit a9cb1b6.

* Fix incorrect step name when run under matrix

* Update build.yml to include 'dev/*' branches in pull_request event
@Arlodotexe Arlodotexe deleted the fix/nupkg/uap-in-winui-package branch September 18, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/pipeline 🔬 regression What was working is now broke
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Crash on start (EntryPointNotFoundException)
2 participants