Skip to content

Commit

Permalink
Exploration of .NET build cache reuse bug (#9)
Browse files Browse the repository at this point in the history
* add initial exploration of build cache reuse bug

discussed in paketo-buildpacks/dotnet-publish#279

* Add manual steps to dotnet cache reuse

* make a fresh copy of the app before rebuilding

Co-authored-by: Sophie Wigmore <[email protected]>
  • Loading branch information
Frankie G-J and Sophie Wigmore authored Jul 29, 2022
1 parent 4c2ce23 commit 1dd49b9
Show file tree
Hide file tree
Showing 6 changed files with 3,257 additions and 0 deletions.
1 change: 1 addition & 0 deletions dotnet-build-cache-reuse/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet-build-cache
31 changes: 31 additions & 0 deletions dotnet-build-cache-reuse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build cache issue reproduction

## Testing locally

Run
```
APP_SOURCE=<path to console app> go run main.go
```

## Testing in a docker container
Use the official .NET SDK docker container for .NET 3.1 on top of ubuntu 18.04:
1. Compile the go program for linux: `GOOS=linux go build .`
3. Run the test in a container:
```
docker run -it -v $(pwd):/test \
-v $APP_SOURCE:/source \
--env APP_SOURCE=/source \
mcr.microsoft.com/dotnet/sdk:3.1-bionic \
/test/dotnet-build-cache
```

## Testing `dotnet publish` behaviour manually (on Linux)
On Linux, it appears that the issue only occurs when orchestrated through
Golang. When run manually or through a bash script, the failure does not crop
up.

Running the following appears to have the expected effects, in which the app
serves the updated content:
```
./manual.sh --dir <path to some temporary directory"
```
16 changes: 16 additions & 0 deletions dotnet-build-cache-reuse/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module github.com/fg-j/explorations/dotnet-build-cache

go 1.18

require (
github.com/paketo-buildpacks/occam v0.8.0
github.com/paketo-buildpacks/packit/v2 v2.3.0
)

require (
github.com/ForestEckhardt/freezer v0.0.11 // indirect
github.com/gabriel-vasile/mimetype v1.4.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
)
Loading

0 comments on commit 1dd49b9

Please sign in to comment.