Attempt to make the asn1 patch work in docker (#4695)

Assumption is that there is write access without sudo, as running `sudo patch …` causes the following error:
```
#26 0.112 sudo patch -N -t -d /usr/local/go/src/vendor/golang.org/x/crypto/cryptobyte -i /build/patch/asn1.diff
289
#26 0.112 make: sudo: No such file or directory
```
This commit is contained in:
Andreas Linde 2022-10-02 18:11:21 +02:00 • committed by GitHub
parent 967de7635d
commit de1a4058f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -42,7 +42,7 @@ RUN go mod download
# prepare
COPY . .
RUN make patch-asn1
RUN make patch-asn1-docker
RUN make assets
# copy ui

View file

@ -135,3 +135,9 @@ patch-asn1::
cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true"
sudo patch -N -t -d $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte -i $(CURRDIR)/patch/asn1.diff
cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true"
patch-asn1-docker::
# echo $(GOROOT)
cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true"
patch -N -t -d $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte -i $(CURRDIR)/patch/asn1.diff
cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true"