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

Fix NuGet lock files and remove RestoreForceEvaluate from CI builds #13634

Closed
wants to merge 1 commit into from

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Aug 29, 2024

Description

Type of Change

Erase all that don't apply.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Why

What is the motivation for this change? Add a few sentences describing the context and overall goals of the pull request's commits.

Resolves [Add Relevant Issue Here]

What

What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.

Screenshots

Add any relevant screen captures here from before or after your changes.

Testing

If you added tests that prove your changes are effective or that your feature works, add a few sentences here detailing the added test scenarios.

Optional: Describe the tests that you ran locally to verify your changes.

Changelog

Should this change be included in the release notes: indicate yes or no

Add a brief summary of the change to use in the release notes for the next release.

Microsoft Reviewers: Open in CodeFlow

@jonthysell jonthysell changed the title Remove RestoreForceEvaluate from builds Fix NuGet lock files and remove RestoreForceEvaluate from CI builds Aug 29, 2024
@jonthysell jonthysell linked an issue Aug 29, 2024 that may be closed by this pull request
jonthysell added a commit that referenced this pull request Sep 6, 2024
## Description

This PR fixes the two issues with `run-windows --msbuildprops`

1. When passing nothing, the command should not error and exit
2. When the string is parsed into key/value pairs, do not add empty keys to the msbuild command (which will cause msbuild to fail)

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
Ran into these issues while working on PR #13634, extracted them as general bug fixes here.

### What
See above.

## Screenshots
N/A

## Testing
Verified running `run-windows` with malformed `--msbuildprops` no longer errors.

## Changelog
Should this change be included in the release notes: _yes_

Fix parsing of empty build props in run-windows
jonthysell added a commit that referenced this pull request Sep 7, 2024
…er build (#13669)

## Description

Fixes the task which checked for changed `packages.lock.json` files so that it actually detects changes in the files.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To get more warnings when a forced NuGet restore has changed the lock file.

Extracted from PR #13634

### What
See above.

## Screenshots
N/A

## Testing
N/A

## Changelog
Should this change be included in the release notes: _no_
jonthysell added a commit that referenced this pull request Sep 9, 2024
## Description

SourceLink is needed to ensure that our NuGet packages have matching source information when symbols are resolved. So we have an `EnableSourceLink` property which tells some of our projects to add source link, and we enable that when doing CI/PR/official builds by setting the property to true when we call msbuild in our pipelines.

This PR makes it so that instead of having to pass that property, the projects themselves automatically build with source link when they need to.

### Type of Change
- New feature (non-breaking change which adds functionality)

### Why
This makes it so that local builds of RNW are closer to the the same nuget restore behavior / packages.lock.json file as when they're built in pipelines.

This is part is working toward resolving #12004 and this functionality was extracted from PR #13634.

### What
Instead of requiring us to call msbuild with `/p:EnableSourceLink=true` for every solution (or relying on setting it in `ExperimentalFeatures.props`) we now detect when our library projects are being built within the repo (detecting the `src-win` folder which isn't present in the NPM publish) and enable source link then.

## Screenshots
N/A

## Testing
N/A

## Changelog
Should this change be included in the release notes: _yes_

Automatically set EnableSourceLink for in-repo builds only
jonthysell added a commit that referenced this pull request Sep 10, 2024
## Description

Projects "built for Fabric" depend on the `Microsoft.WindowsAppSDK`, while projects "built for Paper" rely on `Microsoft.UI.Xaml`, both of which are mutually exclusive. This leads to a lot of PRs with a spurious flip-flopping of the contents of nuget package lock files, depending on which flavor the author happened to build against.

This PR enables a new separate fabric lock file for projects and also updates all of the lock files.

### Type of Change
- New feature (non-breaking change which adds functionality)

### Why
This makes it so that local builds of RNW are closer to the the same nuget restore behavior / packages.lock.json file as when they're built in pipelines, namely to reduce the number of spurious lock file changes we see in PRs.

This is part is working toward resolving #12004 and this functionality was extracted from PR #13634.

### What
For projects building within our repo that can be built as either Paper or Fabric variants, we now maintain a separate "fabric" nuget lock file: `packages.fabric.lock.json` alongside the normal `packages.lock.json` file (which can be either "paper" or "fabric" depending on what the project normally builds with).

## Screenshots
N/A

## Testing
N/A

## Changelog
Should this change be included in the release notes: _yes_

Create separate NuGet restore lock files for Fabric builds
jonthysell added a commit to jonthysell/react-native-windows that referenced this pull request Sep 11, 2024
This PR backports microsoft#13665 to 0.75.

## Description

This PR fixes the two issues with `run-windows --msbuildprops`

1. When passing nothing, the command should not error and exit
2. When the string is parsed into key/value pairs, do not add empty keys to the msbuild command (which will cause msbuild to fail)

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
Ran into these issues while working on PR microsoft#13634, extracted them as general bug fixes here.

### What
See above.

## Screenshots
N/A

## Testing
Verified running `run-windows` with malformed `--msbuildprops` no longer errors.

## Changelog
Should this change be included in the release notes: _yes_

Fix parsing of empty build props in run-windows
# This is the 1st commit message:

test from rnbot 3

# This is the commit message #2:

Change files

# This is the commit message #3:

Add sourcelink

# This is the commit message #5:

Change files

# This is the commit message #8:

temporarily re-force in ado

# This is the commit message #14:

fix packages

# This is the commit message #16:

add playground

# This is the commit message #18:

fix desktop

# This is the commit message #19:

fix test restore

# This is the commit message #20:

Remove Microsoft.WinUI from packages

# This is the commit message #21:

fix merge

# This is the commit message #23:

.npmignore

# This is the commit message #24:

more npmignore

# This is the commit message #25:

re-enable force restore for csproj files

# This is the commit message #26:

merge fix

# This is the commit message #30:

get better msbuildprops fixes

# This is the commit message #32:

delete chakra

# This is the commit message #33:

remove unecessary changes

# This is the commit message #34:

more cleanup

# This is the commit message #35:

more cleanup 3

# This is the commit message #36:

Delete vnext/PropertySheets/Nuget.LockFile.props
# This is the commit message #37:

fix

# This is the commit message #38:

fix
@jonthysell jonthysell closed this Sep 11, 2024
jonthysell added a commit that referenced this pull request Sep 12, 2024
This PR backports #13665 to 0.75.

## Description

This PR fixes the two issues with `run-windows --msbuildprops`

1. When passing nothing, the command should not error and exit
2. When the string is parsed into key/value pairs, do not add empty keys to the msbuild command (which will cause msbuild to fail)

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
Ran into these issues while working on PR #13634, extracted them as general bug fixes here.

### What
See above.

## Screenshots
N/A

## Testing
Verified running `run-windows` with malformed `--msbuildprops` no longer errors.

## Changelog
Should this change be included in the release notes: _yes_

[0.75] Fix parsing of empty build props in run-windows
jonthysell added a commit to jonthysell/react-native-windows that referenced this pull request Sep 12, 2024
…er build (microsoft#13669)

## Description

Fixes the task which checked for changed `packages.lock.json` files so that it actually detects changes in the files.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To get more warnings when a forced NuGet restore has changed the lock file.

Extracted from PR microsoft#13634

### What
See above.

## Screenshots
N/A

## Testing
N/A

## Changelog
Should this change be included in the release notes: _no_
jonthysell added a commit that referenced this pull request Sep 13, 2024
This PR backports #13669 and #13684 to 0.75

# Fix msbuild-sln.yml detection of changed packages.lock.json files after build (#13669)

## Description

Fixes the task which checked for changed `packages.lock.json` files so that it actually detects changes in the files.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To get more warnings when a forced NuGet restore has changed the lock file.

Extracted from PR #13634

### What
See above.

## Screenshots
N/A

## Testing
N/A

## Changelog
Should this change be included in the release notes: _no_

# Fix CLI init args to prevent non-blocking errors (#13684)

## Description

Changed our creation of new RN projects via the CLI to:
* Be verbose for better debugging
* Not automatically install ios pods (we don't need them)
* Not call yarn install (it fails sometimes due to yarn version mismatches, we call `yarn install` later anyway)
* No create a git repo (unnecessary for our tests)

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To unblock PRs.

### What
See above.

## Screenshots
N/A

## Testing
Verified commands worked

## Changelog
Should this change be included in the release notes: _no_

# fix old react-native-init.yml with new community cli command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using /p:RestoreForceEvaluate=true in CI
2 participants