-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Refresh BuildFromSource docs #37362
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
Refresh BuildFromSource docs #37362
Conversation
captainsafia
commented
Oct 7, 2021
•
edited
Loading
edited
- Clean up build from source docs
- Add engine information to package.json files
fe59350
to
bd1633d
Compare
|
||
#### Java Development Kit on Windows | ||
## Visual Studio Code on Windows, Linux, Mac |
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.
There isn't much here that's specific to VSCode... pretty much just the part where you open the folder using code
? I'd argue that's not really important to call out, in which case this section can just become the terminal-oriented workflow (use the editor of your choice). The important things are the bits about using restore/activate/build.
ca1059f
to
165a466
Compare
We also need a true .vsconfig file that works. InstallVS.ps1 is jank |
> origin https://github.com/YOUR_USERNAME/aspnetcore (push) | ||
> upstream https://github.com/dotnet/aspnetcore.git (fetch) | ||
> upstream https://github.com/dotnet/aspnetcore.git (push) | ||
./eng/scripts/InstallVisualStudio.ps1 |
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 believe the VS install will install web tools like Node by default?
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.
If the web workload is installed than I think yes.
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.
Looks good except for a few nits.
> origin https://github.com/YOUR_USERNAME/aspnetcore (push) | ||
> upstream https://github.com/dotnet/aspnetcore.git (fetch) | ||
> upstream https://github.com/dotnet/aspnetcore.git (push) | ||
./eng/scripts/InstallVisualStudio.ps1 |
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.
If the web workload is installed than I think yes.
|
||
## Step 5: Use the result of your build | ||
 |
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.
Suggest a better alt-text for this.
|
||
| Command | What does it do? | | ||
| ------------------------------------------------------------ | ------------------------------------------------------------ | | ||
| `.\eng\build.cmd -all -pack -arch x64` | Build development packages for all the shipping projects in the repo. | |
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.
IMO this list should mainly contain the commands that we think users should be using, like .\build.cmd -t
and have them at the top, and maybe even place the .\eng\build.cmd ...
commands in a separate table for "less common" commands. Especially since a couple sentences ago we said
It is not recommended to run the top-level build script for the repo.
| ------------------------------------------------------------ | ------------------------------------------------------------ | | ||
| [Git source control](https://git-scm.org/) | Used for cloning, branching, and other source control-related activities in the repo. | | ||
| [.NET](https://dotnet.microsoft.com/) | A preview version of the .NET SDK is used for building projects within the repo. | | ||
| [NodeJS]() | Used for building JavaScript assets in the repo. | |
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.
Unless I'm mistaken Node and Yarn are optional, used when building SignalR client or Blazor
And Yarn is installed and used automatically if you use the build script.
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.
And Yarn is installed and used automatically if you use the build script.
I wasn't sure of this. The last time I had to build the repo from a clean set up I needed to install yarn separately. Do you have a reference to where in the scripts we install it?
Unless I'm mistaken Node and Yarn are optional, used when building SignalR client or Blazor
Correct. However, since we have users run a repo-wide restore before they activate their dotnet environment and launch the editor Node/Yarn are needed for the install phase in the restore.
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.
Line 31 in 1aa3490
"Yarn.MSBuild": "1.22.10", |
https://github.com/natemcmaster/Yarn.MSBuild#usage
Guess it doesn't matter much if we move away from Yarn soon
</configuration> | ||
``` | ||
|
||
In the project files for your repo, update the package versions to target the development version. For example, if you want to validate changes to the `Microsoft.AspNetCore.Components.WebAssembly` package. You can make the following changes to the PackageReference. |
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.
Sadly, I don't think it's this easy for many projects in the repo.
a) we don't produce packages for many projects
b) you often need to reference other dlls (aspnet shared fx) and probably the same runtime shared fx that was used to build the repo
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.
Agreed -- with this being in a separate doc we can expand on different ways to test under each scenarios.
If you were to add another set of instructions here, what would that be?
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.
The old docs mentioned:
Run the installers produced in
artifacts/installers/{Debug, Release}/
for your platform.
I've never gotten that to work, and maybe it doesn't, but if we could have something "simple" like that it would be great.
Personally I've never had a clean experience using the locally built product in an external app, I've had to do things like modify a file in the bin folder of the built app etc.
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.
You can reference the dlls directly using <Reference Include="path to assembly" />
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've never gotten that to work, and maybe it doesn't, but if we could have something "simple" like that it would be great.
I've been in the same situation so that's why I removed reference to the installers in this doc. I've never had it work. cc: @dougbu in case there is an issue to resolve here.
Personally I've never had a clean experience using the locally built product in an external app, I've had to do things like modify a file in the bin folder of the built app etc.
@davidfowl uses HintPath
in the reference to help with some of this.
In any case, I think sorting out these types of integrated validation scenarios is another issue worth tracking.
Co-authored-by: Kevin Pilch <kevinpi@microsoft.com>
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.
Overall this is a cleaner approach. It needs a little more detail on the "things I need to install" section.
| Dependency | Use | | ||
| ------------------------------------------------------------ | ------------------------------------------------------------ | | ||
| [Git source control](https://git-scm.org/) | Used for cloning, branching, and other source control-related activities in the repo. | | ||
| [.NET](https://dotnet.microsoft.com/) | A preview version of the .NET SDK is used for building projects within the repo. | |
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.
They don't actually need to install this, it will be downloaded for them.
| [.NET](https://dotnet.microsoft.com/) | A preview version of the .NET SDK is used for building projects within the repo. | | ||
| [NodeJS]() | Used for building JavaScript assets in the repo. | | ||
| [Yarn](https://yarnpkg.com/) | Used for installing JavaScript dependencies in the repo. | | ||
| [curl](https://curl.haxx.se/)/[wget](https://www.gnu.org/software/wget) | Used for downloading installation files and assets from the web. | |
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.
Preinstalled?
@@ -0,0 +1,25 @@ | |||
# Repo Dependencies |
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 page is not helpful from the perspective of someone trying to build the repo. Which of these do I need to install vs which are acquired automatically or come built in? What's the minimum version I need?
Visual Studio and it's many components are a required build dependencies on Windows that's not listed here.
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.
Listing the minimum required version will likely get out of date, but we could link to the place in the repo that defines it.
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 have a nagging feeling we've lost useful text while things moved around. Is that valid❔
ASP.NET Core uses git submodules to include the source from a few other projects. In order to pull the sources of the these submodules when cloning the repo, be sure to pass the `--recursive` flag to the `git clone` command. | ||
|
||
```powershell | ||
``` |
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.
Avoid Markdown lint warnings about leaving code blocks without a type. Use bash
if you don't like powershell
. This is a general problem throughout this PR.
|
||
Development is done in your own repo, not directly against the official `dotnet/aspnetcore` repo. To create your own fork, click the __Fork__ button from our GitHub repo as a signed-in user and your own fork will be created. | ||
|
||
> :bulb: All other steps below will be against your fork of the aspnetcore repo (e.g. `YOUR_USERNAME/aspnetcore`), not the official `dotnet/aspnetcore` repo. |
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.
Not sure but this note seems useful
| [NodeJS]() | Used for building JavaScript assets in the repo. | | ||
| [Yarn](https://yarnpkg.com/) | Used for installing JavaScript dependencies in the repo. | | ||
| [curl](https://curl.haxx.se/)/[wget](https://www.gnu.org/software/wget) | Used for downloading installation files and assets from the web. | | ||
| [tar](http://gnuwin32.sourceforge.net/packages/gtar.htm) | Used for unzipping installation assets. Included by default on macOS, Linux, and Windows 10 and above. | |
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.
We previously mentioned gtar.htm
as a fallback only. On Windows, users should stick w/ the pre-installed program or use eng/scripts/InstallTar.ps1 to place the git
copy where the build will find it.
To start, build the packages with your changes locally on your repo. | ||
|
||
``` | ||
.\build.cmd -all -pack -arch x64 |
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.
.\build.cmd -all -pack -arch x64 | |
.\eng\build.cmd -all -pack -arch x64 |
|
||
- Update the versions on `PackageReference` items in your .csproj project file to point to the version from your local build. | ||
The `build.cmd` and `build.sh` scripts contain multiple flags that can be used control the behavior of the build script. See [BuildScript](./BuildScript.md) for information about the flags available on the script and helpful invocation patterns. |
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.
The `build.cmd` and `build.sh` scripts contain multiple flags that can be used control the behavior of the build script. See [BuildScript](./BuildScript.md) for information about the flags available on the script and helpful invocation patterns. | |
The `eng\build.cmd` and `eng/build.sh` scripts contain multiple flags that can be used control the behavior of the build script. See [BuildScript](./BuildScript.md) for information about the flags available on the script and helpful invocation patterns. |
| ------------------------------------------------------------ | ------------------------------------------------------------ | | ||
| `.\eng\build.cmd -all -pack -arch x64` | Build development packages for all the shipping projects in the repo. | | ||
| `.\eng\build.cmd -test -projects .\src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj` | Run all the unit tests in the `Microsoft.AspNetCore.App.UnitTests` project. | | ||
| `.\build.cmd -Configuration Release` | Build projects in a subdirectory using a `Release` configuration. | |
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.
| `.\build.cmd -Configuration Release` | Build projects in a subdirectory using a `Release` configuration. | | |
| `.\eng\build.cmd -Configuration Release` | Build projects in a subdirectory using a `Release` configuration. | |
``` | ||
|
||
On macOS/Linux, you can run the shell script: | ||
4. Once you've opened the project in VS Code, you can build and test changes by running the `./build.sh` command in the terminal. |
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.
4. Once you've opened the project in VS Code, you can build and test changes by running the `./build.sh` command in the terminal. | |
4. Once you've opened the project in VS Code, you can build and test changes by running the `./eng/build.sh` command in the terminal. |
./build.sh | ||
./build.sh -test |
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.
./build.sh | |
./build.sh -test | |
./eng/build.sh | |
./eng/build.sh -test |
}, | ||
"engines": { | ||
"node": "16.x" |
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.
@captainsafia how do these additions fit in w/ the doc changes❔
@@ -0,0 +1,8 @@ | |||
{ |
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.
Unclear how this fits in