Remove gogoproto in favor of the standard protobuf compiler. This
removes any nonstandard extensions that were part of gogoproto such as
the custom types.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
In the case for Windows, this line at
frontend/dockerfile/dockerfile2llb/convert.go#L1142
```go
dest += string(filepath.Separator)
```
was adding the `\\` to a path that is already normalized
to unix-format, hence ending up with dest paths like
`/\\` for `C:\\` and `/test\\` for `C:\\test\\`.
the src paths are well normalized too at ~L1290.
This change removes the block of code and instead
does the "/" appending using the keepSlash logic
that is in system.NormalizePath called in
pathRelativeToWorkingDir() function before.
fixes#4696
Signed-off-by: Anthony Nandaa <profnandaa@gmail.com>
The os.RemoveAll() call returns nil if the path doesn't exist. When the
rmPath function is called with allowNotFound set to false, it doesn't change the
behaviour of the function.
Change the code so if allowNotFound is set to false, we first check
whether the file exists. If it doesn't exist, return an error.
Add tests for three relevant cases.
Signed-off-by: Jakub Ciolek <jakub@ciolek.dev>
This change properly handles paths on different platforms. In short, this
change checks the target platform we're building an image for and applies
normalization steps to make sure the file paths are valid. This makes buildkit
properly handle paths on both *nix systems and on Windows.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Before this change, if the path provided to FileOp.Rm was a symlink then
the target of the symlink would be removed instead of the symlink
itself. Now, the symlink will be removed instead. However, any symlinks
present in the parent dirs of the specified path will still be resolved
before calling os.Remove; this change only results in the base of the
specified path not being followed.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
I saw these, and there was no comment in the code explaining if there was a reason
for this; these were added in 2be999ba52, but couldn't
find a mention about these particular lines in the review comments, and I couldn't
think of a special reason for it ':-)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>