ITADN

buf-gradle-plugin build fails on newer Buf CLIs

#207Closedpkwarren 创建于 2024-07-03
P
pkwarrencommented
I attempted to upgrade the plugin from 1.27.1 to 1.34.0 (latest release) and saw these test failuires: Tests: * `BreakingWithProtobufGradleTest - normally breaking schema with an ignore` * `BreakingWithWorkspaceTest - normally breaking schema with an ignore` Error: ``` Execution failed for task ':bufBuild'. > > arguments: [/Users/pkw/dev/buf-gradle-plugin/build/tmp/test/work/.gradle-test-kit/caches/modules-2/files-2.1/build.buf/buf/1.34.0/fb40b6d9b2d05e0eafcac09f5b443778f3beab81/buf-1.34.0-osx-aarch_64.exe, build, --output, /private/var/folders/zw/8cq3lqwd2cj6fznjw037s7480000gn/T/junit15873435901407493843/build/bufbuild/image.json] > exit code: 1 > stdout: (empty) > stderr: (below) > Failure: cannot have a buf.work.yaml and buf.yaml in the same directory "private/var/folders/zw/8cq3lqwd2cj6fznjw037s7480000gn/T/junit15873435901407493843/build/bufbuild" > ``` These tests appear to copy a file tree: ``` buf.yaml src/main/proto/buf/test/v1/test.proto ``` into a directory (under `build/`) consisting of: ``` buf.work.yaml buf.yaml src-main-proto -> ../../src/main/proto ``` The generated `buf.work.yaml` contains: ```yaml version: v1 directories: - src-main-proto ``` This needs more investigation but ideally for v2 configs we wouldn't need to create any filesystem structure like this during the build. A user should be able to use the plugin entirely from the root `buf.yaml` file with a config like: ```yaml version: v2 modules: - path: src/main/proto lint: except: - FIELD_NOT_REQUIRED - PACKAGE_NO_IMPORT_CYCLE disallow_comment_ignores: true breaking: except: - EXTENSION_NO_DELETE - FIELD_SAME_DEFAULT ignore: - buf ```
关闭于 2024-07-26 2 条评论