- Notifications
You must be signed in to change notification settings - Fork 138
Add guidance for repo owners #2726
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
16 commits Select commit Hold shift + click to select a range
1ec992f Add guidance for new dependencies
crummel b0ea2ed Instructions for upating dependencies.
crummel e6d7c3e Guidance for new features
crummel df97e81 Add general build info guidance.
crummel c118fc1 Add index.
crummel c5d7e20 Add onboarding new repo documentation
MichaelSimons f5b6628 onboard new repo cleanup
MichaelSimons 747e3de Rename new repo doc
MichaelSimons 91a6c60 Address code review comments.
crummel eb294b4 Try to make this a bit clearer.
crummel 93ba998 wip
crummel afbf268 Update for review comments.
crummel ac51d06 Apply suggestions from code review
crummel e2a8873 Address review comments.
crummel d021e41 Markdown linter clean.
crummel 61d1ec4 Address review comments.
crummel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Repo owner's handbook for source-build | ||
| | ||
| These docs aim to be a collection of useful information for repo owners who work with and participate in source-build. | ||
| | ||
| ## Index | ||
| | ||
| [Adding new dependencies](new-dependencies.md) | ||
| [Updating dependencies](update-dependencies.md) | ||
| [Considerations when adding features](adding-features.md) | ||
| [General notes on the source-build build](build-info.md) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # New features | ||
| | ||
| New features are great! They also have source-build considerations though. .NET is no longer just multi-platform but also multi-distribution: there's a Linux SDK produced by Microsoft, but there's also a Linux SDK produced by Red Hat, one produced by Fedora, and one that anyone in the community can build himself from source. | ||
| | ||
| ## Things to consider | ||
| | ||
| New features, or expansions of current features, should act sensibly across Windows, Linux, and OSX. This also involves taking into account the limitations and conventions of the different platforms - for instance, on Linux, it's typical for the .NET SDK to be installed by root and therefore be unchangeable by normal users, so installing global tools needs to take into account the fact that the user might not be able to add anything to the SDK directories. | ||
| | ||
| XXX details on the global tools issues | ||
| | ||
| New features also need to be compatible across all distributions of .NET - for instance, Fedora and Debian cannot distribute *any* non-open-source code, even samples, tests, or minor additions to licenses like restricting the field that the code can be used in. This includes any code or packages that are used to build product code as well. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| XXX fill in the details on dotnet-check/dotnet-format here | ||
| | ||
| XXX Should we create a Github group for source-build community members that would be interested in reviewing things like this? | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Source-build build info | ||
| | ||
| This is a collection of notes about how source-build can differ in general from your repo's build and what kind of issues that can create. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| ## Single-version and single-RID build | ||
| | ||
| Source-build is required to build on a single machine with no internet access. This means that we build targeting a single RID, usually the non-portable RID for the build machines (like rhel.7-x64). We do support building portable (linux-x64) as well - this is useful for bootstrapping new distributions. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| We also only build one version of each repo. This means that if your repo turns production of some packages on and off, for instance, if you only produce packages if they are changed, source-build will need a workaround to force all packages to be produced. Additionally, we can only supply one version of each package to a repo. This is injected into the `$(<PackageName>PackageVersion)` variables. The exception is reference-only packages - dotnet/source-build-reference-packages produces multiple versions and these can be hard-coded or use a `$(<PackageName>ReferenceVersion)` property or similar if you don't need source-build to change them. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
crummel marked this conversation as resolved. Show resolved Hide resolved | ||
| ## No Windows-specific packages | ||
| | ||
| Packages that require Windows components or references cannot be built in source-build. These should use `<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>` or other options to be excluded from the source-build. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Adding a new dependency | ||
| | ||
| ## Basics | ||
crummel marked this conversation as resolved. Show resolved Hide resolved | ||
| When adding a new dependency, there are a few steps common between any type of dependency. If you use darc, `darc add-dependency` will take care of this process for you. Otherwise: | ||
| 1. Add the package and a default version to eng/Versions.props. The default version property should be named `<PackageName>PackageVersion`, e.g. `SystemCollectionsImmutablePackageVersion`. | ||
| 2. Add the package and a repo reference to eng/Version.Details.xml. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 3. Set up dependency flow from the foreign repo to your repo. | ||
| | ||
| In general, you should aim to use one version of each package. If you are using a package as reference-only, it is possible to use multiple versions, but only one implementation version of each package will be used - source-build will override it to the version that is being built in this version of the SDK. | ||
| | ||
| ## Deciding what version to use | ||
| - If you are using the package as reference-only and want the version to be pinned, use a literal version number in the csprojs that reference the project. You can also set up a reference-only package version variable in eng/Versions.props, for instance `<PackageNameReferenceOnly>1.2.3</PackageNameReferenceOnly>` in addition to `<PackageNamePackageVersion>4.5.6</PackageNamePackageVersion>`. Also verify that the package is available in source-build-reference-packages, and if not, contact the source-build team. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| - If you are using the package in the actual build or want the version to be updated whenever the foreign repo publishes to your channel, use the version number property set up in eng/Versions.props. This will be overridden in some cases by source-build. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| - If you are using an external or non-Arcade package, please coordinate as much as possible with other teams using that package. Each package-version is essentially maintained as a separate concern, so something like repo A requiring Newtonsoft.Json 9.0.1 and repo B requiring 12.0.2 essentially doubles the source-build team's work. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| ## Internal dependencies | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| Adding a new dotnet dependency is usually pretty straightforward but does have some edge cases. Use this checklist: | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 1. Are you already using a package from the same repo? | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 1. This is the simplest case. You can add new dependencies from repos you are already using freely. | ||
| 2. Is this a Microsoft repo that uses Arcade to build? | ||
| 1. Does the foreign repo depend on your repo, directly or indirectly? i.e. would adding the dependency create a cycle? | ||
| 1. This isn't necessarily a deal-breaker - it can sometimes be worked around with reference-only packages. Please contact a source-build team member to discuss. | ||
| 2. Does the foreign repo publish to BAR? | ||
| 1. If not, please contact them to get them publishing to BAR in an appropriate channel. | ||
| 3. If neither of these caveats apply you should be in good shape. Follow the instructions under "Basics" above. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 3. Source-build has in the past used Arcade shims to allow non-Arcade repos to build appropriate packages for source-build. Please contact the source-build team to determine if this is a workable approach for your foreign repo. | ||
| | ||
| ## External dependencies | ||
| | ||
| External (non-Microsoft or even non-dotnet) dependencies need to be carefully considered for source-build in addition to the licensing issues you are probably already familiar with. | ||
| 1. Microsoft but non-dotnet repos should usually be able to use the same Arcade wrapper to publish appropriate packages for source-build - please contact a source-build team member to discuss. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 2. Dependencies that have no code (e.g. SDKs with just props and targets) can usually be added using the source-build text-only-package process. Contact a source-build team member for more information. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 3. We build some external dependencies in the dotnet/source-build repo. Good targets for this generally have very few if any dependencies and very simple build processes. Contact a source-build team member for more information. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Updating a dependency | ||
crummel marked this conversation as resolved. Show resolved Hide resolved | ||
| | ||
| In most cases, dependency flow should automatically update the packages you depend on. There are some special considerations and things to keep in mind when doing manual updates. | ||
| | ||
| ## External packages | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| Updating a non-Microsoft or non-Arcade package is typically equivalent to adding the new version all over again. Please contact a source-build team member to discuss this. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| ## Internal packages | ||
| | ||
| If you are manually updating a package, please make sure it's from a compatible branch (e.g. runtime release/6.0 to sdk release/6.0.1xx, release/6.0.2xx, etc). Package versions that you are updating to should be source-built in their respective repos. If the version you need is produced in a branch that is not yet source-build-compatible please let the source-build team know. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| ## Splitting, combining, and moving packages | ||
| | ||
| These operations often end up causing source-build issues. A typical case of what can happen is | ||
| 1. Package A is produced in version 1. | ||
| 2. In version 2, Package A is split into Package A1 and Package A2. | ||
| 3. A downstream repo is never updated to take the split packages. | ||
| 4. The version 2 source-build succeeds because Package A exists in the previously-source-built archive, but no new version of Package A is produced. | ||
crummel marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 5. Source-build version 3 fails because Package A no longer exists in the previously-source-built archive either. | ||
| | ||
| | ||
| So please keep in mind consumers of your packages and try to keep them informed of these kinds of changes. If you are the consuming repo, consider tracking PRs in the repos that produce your dependencies. | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.