Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Repository build targets:
./build.sh
```

On Windows, use the corresponding `build.cmd` commands. The full build restores tools and dependencies, builds all projects, and runs broad test suites; on Linux it also depends on Mono and system tooling. If those prerequisites are unavailable, run the relevant `dotnet test` command and report what was not validated.
On Windows, use the corresponding `build.cmd` commands. Both scripts run `build.fsx` with `dotnet fsi`, so the build script itself only needs the .NET SDK declared in `global.json`. The full build restores tools and dependencies, builds all projects, and runs broad test suites; on Linux it still depends on Mono for the targets that run .NET Framework binaries, namely `MergePaketTool` (ILRepack) and the `net461` test passes. If those prerequisites are unavailable, run the relevant `dotnet test` command and report what was not validated.

## Tests

Expand Down
13 changes: 10 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Paket is a dependency manager for .NET with support for NuGet packages and git r

## Build Commands

Both scripts run `build.fsx` with `dotnet fsi`; FAKE is used as a library, there is no FAKE runner
to install.

```bash
# Full build (restores, builds, runs tests)
build.cmd # Windows
Expand All @@ -21,11 +24,15 @@ build.cmd QuickIntegrationTests # Run quick integration tests (scriptgen catego
build.cmd RunIntegrationTestsNet # Run full .NET Framework integration tests
build.cmd RunIntegrationTestsNetCore # Run full .NET Core integration tests

# Skip specific stages
build.cmd SkipTests # Skip all tests
build.cmd SkipIntegrationTests # Skip integration tests only
# Skip specific stages: these are build parameters, so they take a value and
# come after the target name (they can also be passed as environment variables)
build.cmd BuildPackage SkipTests=true # Skip all tests
build.cmd BuildPackage SkipIntegrationTests=true # Skip integration tests only
```

Mono is still required on Linux for the targets that run .NET Framework binaries: `MergePaketTool`
(ILRepack) and the `net461` test passes.

## Testing

**Unit Tests:**
Expand Down
12 changes: 12 additions & 0 deletions DEV_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Please contribute any notes that made your contributions easier here.

Note that historically, the bulk of the development occured on Windows before dotnet got cross platform, for now, the tooling to target .NET Framework is still required for some areas.

# Notes about the build script

`build.cmd` and `build.sh` run `build.fsx` with `dotnet fsi`. FAKE is used as a library only: there
is no FAKE runner to install, and its version no longer has to match the .NET SDK. Targets and
parameters are unchanged, so `./build.sh <Target> [key=value ...]` keeps working as before — the
script translates those arguments into environment variables itself, which is what the FAKE runner
used to do.

Mono is still needed on Linux for the targets that execute .NET Framework binaries: `MergePaketTool`
(which runs `ILRepack.exe`) and the `net461` test passes. Removing that is tracked separately in
[#4348](https://github.com/fsprojects/Paket/issues/4348).

# Notes about the Paket F# Interactive extension

Some pointers to help efforts to foster the F# Interactive extension ecosystem:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ For more reasons see the [FAQ][10].
- Build the solution with Visual Studio, `build.cmd` or `build.sh`.
- Create a topic specific branch in git. Add a nice feature in the code. Do not
forget to add tests and/or docs.
- Run `build.cmd` (`build.sh` on Mono) to make sure all tests are still
- Run `build.cmd` (`build.sh` on Linux/macOS) to make sure all tests are still
passing.
- When built, you'll find the binaries in `./bin` which you can then test
with locally, to ensure the bug or feature has been successfully implemented.
Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if errorlevel 1 (
setlocal


packages\build\FAKE\tools\FAKE.exe build.fsx %*
dotnet fsi build.fsx %*

endlocal
15 changes: 13 additions & 2 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ open Fake.Testing.NUnit3
open System.Security.Cryptography
open System.Xml.Linq

// This script is run with `dotnet fsi`, so there is no FAKE.exe runner to parse the
// command line for us. The runner used to turn `build.sh <Target> key=value ...` into
// environment variables, which FAKE then reads back through getBuildParam/hasBuildParam.
// Do that translation here, before any value below reads a build parameter.
let private commandLineArgs =
let all = Environment.GetCommandLineArgs()
if all.Length > 2 then all.[2..] else [||] // skip fsi.dll and build.fsx

for arg in commandLineArgs do
match arg.IndexOf '=' with
| i when i > 0 -> Environment.SetEnvironmentVariable(arg.Substring(0, i), arg.Substring(i + 1))
| _ -> Environment.SetEnvironmentVariable("target", arg)

// Information about the project are used
// - for version and project name in generated AssemblyInfo file
// - by the generated NuGet package
Expand Down Expand Up @@ -77,8 +90,6 @@ let paketFile = buildMergedDir @@ "paket.exe"

Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

System.Net.ServicePointManager.SecurityProtocol <- unbox 192 ||| unbox 768 ||| unbox 3072 ||| unbox 48

// Read additional information from the release notes document
let releaseNotesData =
File.ReadAllLines "RELEASE_NOTES.md"
Expand Down
41 changes: 8 additions & 33 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
#!/usr/bin/env bash
if test "$OS" = "Windows_NT"
then
# use .Net
dotnet tool restore
dotnet paket restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
MSBuild=`pwd -W`/packages/build/RoslynTools.MSBuild/tools/msbuild/MSBuild.exe packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
else
dotnet tool restore
dotnet paket restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
certificate_count=$(certmgr -list -c Trust | grep X.509 | wc -l)
if [ $certificate_count -le 1 ]; then
echo "Couldn't download Paket. This might be because your Mono installation"
echo "doesn't have the right SSL root certificates installed. One way"
echo "to fix this would be to download the list of SSL root certificates"
echo "from the Mozilla project by running the following command:"
echo ""
echo " mozroots --import --sync"
echo ""
echo "This will import over 100 SSL root certificates into your Mono"
echo "certificate repository. Then try running the build script again."
fi
exit $exit_code
fi
# Note: the bundled MSBuild crashes hard on linux, so we still rely on the system-installed version
#export MSBuild=packages/build/RoslynTools.MSBuild/tools/msbuild/MSBuild.exe
mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
fi
set -eu
set -o pipefail

cd "$(dirname "$0")"

dotnet tool restore
dotnet paket restore

dotnet fsi build.fsx "$@"
Loading