repo
stringlengths
5
53
pr_number
int32
1
321k
task_type
stringclasses
2 values
issue_text
stringlengths
0
81.2k
pr_title
stringlengths
1
319
pr_body
stringlengths
0
105k
base_sha
stringlengths
40
40
head_sha
stringlengths
40
40
gold_diff
stringlengths
0
202M
changed_files
listlengths
0
100
review_threads
listlengths
0
100
test_patch
stringlengths
0
23.4M
merged
bool
1 class
zeromicro/go-zero
5,499
issue_to_patch
chore: upgrade Go version to 1.24 and update dependencies
## Summary Upgrades the Go directive from 1.23 to 1.24 in both modules (`go.mod` and `tools/goctl/go.mod`) and bumps direct/indirect dependencies to the highest versions compatible with Go 1.24. --- ## Go version | | Before | After | |---|---|---| | `go` directive (both modules) | `1.23.0` | `1.24.0` | --- ## Dir...
9a6447ab5ccf19f63fcd87da97edba0199a5912e
69176023f5e0d50f02273e4571353d7a2758539e
diff --git a/go.mod b/go.mod index c04ac1b896c7..ec60490e0c73 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/zeromicro/go-zero -go 1.23.0 +go 1.24.0 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 @@ -12,73 +12,74 @@ require ( github.com/golang/protobuf v1.5.4 github.com/google/uuid v1.6...
[ "core/logx/logs_test.go", "go.mod", "go.sum", "tools/goctl/go.mod", "tools/goctl/go.sum", "tools/goctl/pkg/parser/api/ast/print.go", "tools/goctl/pkg/parser/api/ast/writer.go", "tools/goctl/pkg/parser/api/parser/api.go", "tools/goctl/pkg/parser/api/parser/error.go", "tools/goctl/pkg/parser/api/par...
[ { "comment": "`mockClientConn` is used as a key in `ready := make(map[balancer.SubConn]base.SubConnInfo)`. Embedding `balancer.SubConn` adds an interface-typed field to the struct, which makes key comparability depend on the embedded interface’s runtime value (and can panic if it ever holds a non-comparable con...
diff --git a/core/logx/logs_test.go b/core/logx/logs_test.go index 6f5a3a8f5dda..398e0f78dd64 100644 --- a/core/logx/logs_test.go +++ b/core/logx/logs_test.go @@ -247,7 +247,7 @@ func TestStructedLogDebugf(t *testing.T) { defer writer.Store(old) doTestStructedLog(t, levelDebug, w, func(v ...any) { - Debugf(fmt.S...
true
zeromicro/go-zero
5,484
issue_to_patch
feat: goctl model Add a new method hasField
Add a new method to determine whether a certain field exists and change the template generation content accordingly for example: <img width="3004" height="1000" alt="image" src="https://github.com/user-attachments/assets/f0561d48-4071-4a58-b990-a2b2ff5e0403" />
004995f06ab6e84bc93545182d69862e7dc95468
4e681aa5d647626871cd2cfd05c2e1d3ca3575f3
diff --git a/tools/goctl/model/sql/gen/findone.go b/tools/goctl/model/sql/gen/findone.go index 7916507c147b..66236cba0b17 100644 --- a/tools/goctl/model/sql/gen/findone.go +++ b/tools/goctl/model/sql/gen/findone.go @@ -16,6 +16,7 @@ func genFindOne(table Table, withCache, postgreSql bool) (string, string, error) ou...
[ "tools/goctl/model/sql/gen/findone.go", "tools/goctl/model/sql/gen/findonebyfield.go", "tools/goctl/model/sql/gen/gen.go", "tools/goctl/model/sql/gen/imports.go", "tools/goctl/model/sql/gen/template.go", "tools/goctl/model/sql/gen/template_test.go", "tools/goctl/model/sql/gen/update.go", "tools/goctl/...
[]
diff --git a/tools/goctl/model/sql/gen/template_test.go b/tools/goctl/model/sql/gen/template_test.go index 206ed565e6fc..463af3c5f88f 100644 --- a/tools/goctl/model/sql/gen/template_test.go +++ b/tools/goctl/model/sql/gen/template_test.go @@ -6,8 +6,10 @@ import ( "testing" "github.com/stretchr/testify/assert" + ...
true
zeromicro/go-zero
5,471
issue_to_patch
test(mathx,stringx): add missing edge case tests for CalcEntropy and …
**Problem** 1. **`CalcEntropy`** in `core/mathx/entropy.go` has an explicit early-return branch for `len(m) == 1` (returns `1`), but no test exercises a map with exactly one key. Only empty maps and multi-key maps are tested. 2. **`HasEmpty`** in `core/stringx/strings.go` has no direct test function. It is only t...
85d770d34020ba6ded937ad15aa629f52517c415
7aa8f2d4c4b41043816a5bc978af91f875a61eef
[ "core/mathx/entropy_test.go", "core/stringx/strings_test.go" ]
[]
diff --git a/core/mathx/entropy_test.go b/core/mathx/entropy_test.go index 03db018d154d..1f477acac263 100644 --- a/core/mathx/entropy_test.go +++ b/core/mathx/entropy_test.go @@ -29,3 +29,10 @@ func TestCalcDiffEntropy(t *testing.T) { } assert.True(t, CalcEntropy(m) < .99) } + +func TestCalcEntropySingleItem(t *te...
true
zeromicro/go-zero
5,472
issue_to_patch
feat(goctl/rpc): support external proto imports with cross-package ty…
- Add -I/--proto_path support for importing proto files from external directories - Implement transitive dependency resolution for imported protos - Add cross-package type resolution with automatic Go import generation - Support Google well-known types (Empty, Timestamp, etc.) as RPC parameters - Remove restriction...
c12c82b2f6efe51d87b2386c0cb0deae0ba1a208
bfe63a7a6939df5ea5a7ad122a186cb6ab734ebe
diff --git a/tools/goctl/internal/version/version.go b/tools/goctl/internal/version/version.go index 4a5eec4c588f..07c07eef984d 100644 --- a/tools/goctl/internal/version/version.go +++ b/tools/goctl/internal/version/version.go @@ -6,7 +6,7 @@ import ( ) // BuildVersion is the version of goctl. -const BuildVersion =...
[ "tools/goctl/internal/version/version.go", "tools/goctl/rpc/CHANGELOG-cn.md", "tools/goctl/rpc/CHANGELOG.md", "tools/goctl/rpc/README-cn.md", "tools/goctl/rpc/README.md", "tools/goctl/rpc/cli/cli.go", "tools/goctl/rpc/cli/zrpc.go", "tools/goctl/rpc/example/01-basic/README-cn.md", "tools/goctl/rpc/ex...
[ { "comment": "ResolveImports/collectImports silently skip imports that are not found in the provided protoPaths (lines 100-105). For user-defined imports this will hide configuration mistakes (missing -I/--proto_path), leading to incomplete pb generation and later confusing compilation errors. Consider returnin...
diff --git a/tools/goctl/rpc/parser/import_test.go b/tools/goctl/rpc/parser/import_test.go new file mode 100644 index 000000000000..fed78d4de372 --- /dev/null +++ b/tools/goctl/rpc/parser/import_test.go @@ -0,0 +1,107 @@ +package parser + +import ( + "path/filepath" + "strings" + "testing" + + "github.com/stretchr/test...
true
zeromicro/go-zero
5,472
comment_to_fix
feat(goctl/rpc): support external proto imports with cross-package ty…
ResolveImports/collectImports silently skip imports that are not found in the provided protoPaths (lines 100-105). For user-defined imports this will hide configuration mistakes (missing -I/--proto_path), leading to incomplete pb generation and later confusing compilation errors. Consider returning an error for missing...
c12c82b2f6efe51d87b2386c0cb0deae0ba1a208
bfe63a7a6939df5ea5a7ad122a186cb6ab734ebe
diff --git a/tools/goctl/rpc/parser/import.go b/tools/goctl/rpc/parser/import.go index bb9591f56949..bd53f095ac3d 100644 --- a/tools/goctl/rpc/parser/import.go +++ b/tools/goctl/rpc/parser/import.go @@ -1,8 +1,194 @@ package parser -import "github.com/emicklei/proto" +import ( + "fmt" + "os" + "path/filepath" + "str...
[ "tools/goctl/rpc/parser/import.go" ]
[ { "comment": "ResolveImports/collectImports silently skip imports that are not found in the provided protoPaths (lines 100-105). For user-defined imports this will hide configuration mistakes (missing -I/--proto_path), leading to incomplete pb generation and later confusing compilation errors. Consider returnin...
true
zeromicro/go-zero
5,472
comment_to_fix
feat(goctl/rpc): support external proto imports with cross-package ty…
The new addLogicImports helper is not gofmt-formatted (indentation inside the function body is missing), which makes the generator code harder to read and diverges from standard Go formatting used elsewhere in this repo. Please run gofmt on this file (or reformat this function) before merging.
c12c82b2f6efe51d87b2386c0cb0deae0ba1a208
bfe63a7a6939df5ea5a7ad122a186cb6ab734ebe
diff --git a/tools/goctl/rpc/generator/genlogic.go b/tools/goctl/rpc/generator/genlogic.go index 4a51d4fb7340..b2e65ee4437e 100644 --- a/tools/goctl/rpc/generator/genlogic.go +++ b/tools/goctl/rpc/generator/genlogic.go @@ -40,6 +40,7 @@ func (g *Generator) genLogicInCompatibility(ctx DirContext, proto parser.Proto, c...
[ "tools/goctl/rpc/generator/genlogic.go" ]
[ { "comment": "The new addLogicImports helper is not gofmt-formatted (indentation inside the function body is missing), which makes the generator code harder to read and diverges from standard Go formatting used elsewhere in this repo. Please run gofmt on this file (or reformat this function) before merging.", ...
true
zeromicro/go-zero
5,472
comment_to_fix
feat(goctl/rpc): support external proto imports with cross-package ty…
buildExtraImportLines is not gofmt-formatted (function body is not indented). Please run gofmt on gencall.go (or reformat this function) to keep generator code consistent and readable.
c12c82b2f6efe51d87b2386c0cb0deae0ba1a208
bfe63a7a6939df5ea5a7ad122a186cb6ab734ebe
diff --git a/tools/goctl/rpc/generator/gencall.go b/tools/goctl/rpc/generator/gencall.go index 8381ad065d77..5a7bc3a8efc4 100644 --- a/tools/goctl/rpc/generator/gencall.go +++ b/tools/goctl/rpc/generator/gencall.go @@ -47,6 +47,7 @@ func (g *Generator) GenCall(ctx DirContext, proto parser.Proto, cfg *conf.Config func ...
[ "tools/goctl/rpc/generator/gencall.go" ]
[ { "comment": "buildExtraImportLines is not gofmt-formatted (function body is not indented). Please run gofmt on gencall.go (or reformat this function) to keep generator code consistent and readable.", "path": "tools/goctl/rpc/generator/gencall.go", "hunk": "@@ -290,3 +326,18 @@ func (g *Generator) getIn...
true
zeromicro/go-zero
5,472
comment_to_fix
feat(goctl/rpc): support external proto imports with cross-package ty…
resolveGoogleWKT falls back to returning GoRef "interface{}" for unknown google.protobuf types (line 114). This will generate server/logic method signatures that won't match the generated gRPC interfaces, causing confusing compile-time errors. Prefer returning an explicit error (or otherwise failing fast with a clear m...
c12c82b2f6efe51d87b2386c0cb0deae0ba1a208
bfe63a7a6939df5ea5a7ad122a186cb6ab734ebe
diff --git a/tools/goctl/rpc/generator/typeref.go b/tools/goctl/rpc/generator/typeref.go new file mode 100644 index 000000000000..453972702cd7 --- /dev/null +++ b/tools/goctl/rpc/generator/typeref.go @@ -0,0 +1,115 @@ +package generator + +import ( + "fmt" + "strings" + + "github.com/zeromicro/go-zero/tools/goctl/rpc/p...
[ "tools/goctl/rpc/generator/typeref.go" ]
[ { "comment": "resolveGoogleWKT falls back to returning GoRef \"interface{}\" for unknown google.protobuf types (line 114). This will generate server/logic method signatures that won't match the generated gRPC interfaces, causing confusing compile-time errors. Prefer returning an explicit error (or otherwise fai...
true
zeromicro/go-zero
5,453
issue_to_patch
perf(core/stringx): replace manual char filter with strings.Map
The original Filter function used a manual []rune loop to remove characters satisfying a predicate. This change: - Replaces it with a simpler, more efficient implementation using strings.Map - Renames the predicate parameter from 'filter' to 'remove' to accurately reflect that the function removes characters fo...
8cd7f7a2d8b023d8842447c76205958377b12aca
db6140049965ae307671dc959154a5ee851ec0e4
diff --git a/core/stringx/strings.go b/core/stringx/strings.go index 5a9554a7b752..dadf2c52c157 100644 --- a/core/stringx/strings.go +++ b/core/stringx/strings.go @@ -3,6 +3,7 @@ package stringx import ( "errors" "slices" + "strings" "unicode" "github.com/zeromicro/go-zero/core/lang" @@ -21,20 +22,14 @@ func...
[ "core/stringx/strings.go", "core/stringx/strings_test.go" ]
[ { "comment": "BenchmarkFilter currently calls Filter(...) as a standalone statement, but Filter returns a string; Go doesn’t allow ignoring a returned value, so this benchmark won’t compile. Assign the result to `_` (or a package-level sink) inside the loop to make the call valid and prevent the compiler from o...
diff --git a/core/stringx/strings_test.go b/core/stringx/strings_test.go index 3fb3e7bcec1e..b4681fe5c592 100644 --- a/core/stringx/strings_test.go +++ b/core/stringx/strings_test.go @@ -92,6 +92,24 @@ func TestFilter(t *testing.T) { } } +func BenchmarkFilter(b *testing.B) { + b.Run("true", func(b *testing.B) { + ...
true
zeromicro/go-zero
5,453
comment_to_fix
perf(core/stringx): replace manual char filter with strings.Map
BenchmarkFilter currently calls Filter(...) as a standalone statement, but Filter returns a string; Go doesn’t allow ignoring a returned value, so this benchmark won’t compile. Assign the result to `_` (or a package-level sink) inside the loop to make the call valid and prevent the compiler from optimizing it away.
8cd7f7a2d8b023d8842447c76205958377b12aca
db6140049965ae307671dc959154a5ee851ec0e4
diff --git a/core/stringx/strings_test.go b/core/stringx/strings_test.go index 3fb3e7bcec1e..b4681fe5c592 100644 --- a/core/stringx/strings_test.go +++ b/core/stringx/strings_test.go @@ -92,6 +92,24 @@ func TestFilter(t *testing.T) { } } +func BenchmarkFilter(b *testing.B) { + b.Run("true", func(b *testing.B) { + ...
[ "core/stringx/strings_test.go" ]
[ { "comment": "BenchmarkFilter currently calls Filter(...) as a standalone statement, but Filter returns a string; Go doesn’t allow ignoring a returned value, so this benchmark won’t compile. Assign the result to `_` (or a package-level sink) inside the loop to make the call valid and prevent the compiler from o...
true
zeromicro/go-zero
5,453
comment_to_fix
perf(core/stringx): replace manual char filter with strings.Map
The updated doc comment is still a bit ambiguous/awkward (“filters chars … with given remove function”). Consider clarifying that this function *removes* runes for which `remove(r)` returns true, and that it returns the resulting string.
8cd7f7a2d8b023d8842447c76205958377b12aca
db6140049965ae307671dc959154a5ee851ec0e4
diff --git a/core/stringx/strings.go b/core/stringx/strings.go index 5a9554a7b752..dadf2c52c157 100644 --- a/core/stringx/strings.go +++ b/core/stringx/strings.go @@ -3,6 +3,7 @@ package stringx import ( "errors" "slices" + "strings" "unicode" "github.com/zeromicro/go-zero/core/lang" @@ -21,20 +22,14 @@ func...
[ "core/stringx/strings.go" ]
[ { "comment": "The updated doc comment is still a bit ambiguous/awkward (“filters chars … with given remove function”). Consider clarifying that this function *removes* runes for which `remove(r)` returns true, and that it returns the resulting string.\n", "path": "core/stringx/strings.go", "hunk": "@@ -...
true
zeromicro/go-zero
5,461
issue_to_patch
refactor(core): replace TakeOne usage with cmp.Or
The custom `TakeOne` function is redundant since Go 1.21 introduced `cmp.Or`, which provides identical functionality for selecting the first non-zero value. Changes: - Mark `TakeOne` as deprecated with a pointer to `cmp.Or`. - Replace all internal usages of `TakeOne` with `cmp.Or`.
db3101361bc5f3b05bf475c611ba5724afd548ff
397cb4205da0ba27ee9edb348f825dab7e4e54fc
diff --git a/core/mapping/utils.go b/core/mapping/utils.go index 1c281e328de3..dc499b138e33 100644 --- a/core/mapping/utils.go +++ b/core/mapping/utils.go @@ -1,6 +1,7 @@ package mapping import ( + "cmp" "encoding/json" "errors" "fmt" @@ -12,7 +13,6 @@ import ( "sync" "github.com/zeromicro/go-zero/core/...
[ "core/mapping/utils.go", "core/stringx/strings.go" ]
[]
true
zeromicro/go-zero
5,470
issue_to_patch
docs(mathx): add godoc comment to Numerical type constraint
**Problem** The `Numerical` type constraint in `core/mathx/range.go` is the only exported type in the go-zero `core/` packages without a godoc comment. Every other exported type, function, and variable follows the Go convention of having a documentation comment. **Solution** Added a standard godoc comment: ``...
eb2302b71e9c1388fcd00bf0a5985545b318f1f0
b9074d105d68f36f587ab4e14e12892fb126883c
diff --git a/core/mathx/range.go b/core/mathx/range.go index 17e63fd5f13a..8b2574c51f9b 100644 --- a/core/mathx/range.go +++ b/core/mathx/range.go @@ -1,5 +1,6 @@ package mathx +// Numerical is a constraint that permits any numeric type. type Numerical interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uin...
[ "core/mathx/range.go" ]
[]
true
zeromicro/go-zero
5,497
issue_to_patch
fix(swagger): add example field to path/form/header parameters
Fixes issue #5496: the example= tag option in path, form and header struct tags was silently ignored when generating swagger JSON. SimpleSchema already has an Example field; wire it up via exampleValueFromOptions() the same way json body parameters do. - parameter.go: set SimpleSchema.Example for header, path, query...
04ed63736648ed5683db40f85098c71ab41410d2
df72bf1d795f58e81e7938cd989a86bfca93e333
diff --git a/tools/goctl/api/swagger/issue5496/issue5496.api b/tools/goctl/api/swagger/issue5496/issue5496.api new file mode 100644 index 000000000000..ca2f709bfb60 --- /dev/null +++ b/tools/goctl/api/swagger/issue5496/issue5496.api @@ -0,0 +1,34 @@ +syntax = "v1" + +info ( + title: "Issue 5496 Reproduce" + version: ...
[ "tools/goctl/api/swagger/issue5496/issue5496.api", "tools/goctl/api/swagger/issue5496/issue5496.json", "tools/goctl/api/swagger/parameter.go", "tools/goctl/api/swagger/parameter_test.go" ]
[]
diff --git a/tools/goctl/api/swagger/parameter_test.go b/tools/goctl/api/swagger/parameter_test.go index 92939dd334c0..a437d66611cc 100644 --- a/tools/goctl/api/swagger/parameter_test.go +++ b/tools/goctl/api/swagger/parameter_test.go @@ -83,6 +83,41 @@ func TestParametersFromType_EdgeCases(t *testing.T) { assert.Emp...
true
zeromicro/go-zero
5,469
issue_to_patch
test(hash): add unit tests for Hash, Hash determinism, and Md5Hex edg…
**Problem** The `Hash()` function in `core/hash/hash.go` (murmur3 wrapper) has no dedicated unit test. Only `Md5()` and `Md5Hex()` are directly tested. While `Hash()` is exercised indirectly through `consistenthash_test.go`, the function itself lacks isolated coverage. **Solution** Added 4 new test cases to `c...
567087a715723e7ecaff92747dc4eaa3b139ec7d
69521c8c10ad0915717ab1b2e3057bce984b42d9
[ "core/hash/hash_test.go" ]
[]
diff --git a/core/hash/hash_test.go b/core/hash/hash_test.go index 5e0962a78a3a..e2f043187e0d 100644 --- a/core/hash/hash_test.go +++ b/core/hash/hash_test.go @@ -25,6 +25,29 @@ func TestMd5Hex(t *testing.T) { assert.Equal(t, md5Digest, actual) } +func TestHash(t *testing.T) { + result := Hash([]byte(text)) + asse...
true
zeromicro/go-zero
5,483
issue_to_patch
test(goctl): add regression test for per-service type alias filtering (#5481)
## What Adds `TestGenCallGroup_OnlyUsedTypesAliased` to `tools/goctl/rpc/generator/gencall_test.go` as a regression guard for #5481 (fixed in #5482). ## Why The fix in #5482 was merged without a test. This test exercises `genCallGroup` directly with two services that have completely disjoint message sets and asserts...
4d2e64a417bacea100e45c4bc5f310073a27e49c
6e648b3add274e70a56443089a854278f40850ba
[ "tools/goctl/rpc/generator/gencall_test.go" ]
[ { "comment": "The assertions for \"should alias\" are currently too weak: `assert.Contains(aFile, \"AReq\")`/`\"AResp\"` will be true even if no type aliases were generated, because those identifiers also appear in the generated method signatures. To actually verify alias generation (and avoid false positives),...
diff --git a/tools/goctl/rpc/generator/gencall_test.go b/tools/goctl/rpc/generator/gencall_test.go new file mode 100644 index 000000000000..deb773a287cb --- /dev/null +++ b/tools/goctl/rpc/generator/gencall_test.go @@ -0,0 +1,125 @@ +package generator + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "gi...
true
zeromicro/go-zero
5,483
comment_to_fix
test(goctl): add regression test for per-service type alias filtering (#5481)
The assertions for "should alias" are currently too weak: `assert.Contains(aFile, "AReq")`/`"AResp"` will be true even if no type aliases were generated, because those identifiers also appear in the generated method signatures. To actually verify alias generation (and avoid false positives), assert on the alias form pr...
4d2e64a417bacea100e45c4bc5f310073a27e49c
6e648b3add274e70a56443089a854278f40850ba
diff --git a/tools/goctl/rpc/generator/gencall_test.go b/tools/goctl/rpc/generator/gencall_test.go new file mode 100644 index 000000000000..deb773a287cb --- /dev/null +++ b/tools/goctl/rpc/generator/gencall_test.go @@ -0,0 +1,125 @@ +package generator + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "gi...
[ "tools/goctl/rpc/generator/gencall_test.go" ]
[ { "comment": "The assertions for \"should alias\" are currently too weak: `assert.Contains(aFile, \"AReq\")`/`\"AResp\"` will be true even if no type aliases were generated, because those identifiers also appear in the generated method signatures. To actually verify alias generation (and avoid false positives),...
true
zeromicro/go-zero
5,483
comment_to_fix
test(goctl): add regression test for per-service type alias filtering (#5481)
Same issue as above for the ServiceB assertions: checking for bare `"BReq"`/`"BResp"` doesn't prove aliases are present (those identifiers also appear in method signatures). Prefer asserting on the concrete alias strings (e.g., `"BReq = pb.BReq"`) and negating `"AReq = pb.AReq"` / `"AResp = pb.AResp"` to make the test ...
4d2e64a417bacea100e45c4bc5f310073a27e49c
6e648b3add274e70a56443089a854278f40850ba
diff --git a/tools/goctl/rpc/generator/gencall_test.go b/tools/goctl/rpc/generator/gencall_test.go new file mode 100644 index 000000000000..deb773a287cb --- /dev/null +++ b/tools/goctl/rpc/generator/gencall_test.go @@ -0,0 +1,125 @@ +package generator + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "gi...
[ "tools/goctl/rpc/generator/gencall_test.go" ]
[ { "comment": "Same issue as above for the ServiceB assertions: checking for bare `\"BReq\"`/`\"BResp\"` doesn't prove aliases are present (those identifiers also appear in method signatures). Prefer asserting on the concrete alias strings (e.g., `\"BReq = pb.BReq\"`) and negating `\"AReq = pb.AReq\"` / `\"AResp...
true
zeromicro/go-zero
5,482
issue_to_patch
fix #5481
b01831b4c579d1c37ab7c6f408b3e53baa7da444
2071ca0027a7db82ef927f4a791318e9e253ecdb
diff --git a/tools/goctl/rpc/generator/gencall.go b/tools/goctl/rpc/generator/gencall.go index 6d59610be259..8381ad065d77 100644 --- a/tools/goctl/rpc/generator/gencall.go +++ b/tools/goctl/rpc/generator/gencall.go @@ -64,16 +64,26 @@ func (g *Generator) genCallGroup(ctx DirContext, proto parser.Proto, cfg *conf.C i...
[ "tools/goctl/rpc/generator/gencall.go" ]
[]
true
zeromicro/go-zero
5,475
issue_to_patch
(goctl)fix file copy permission missed
fix issue #5440
d1a014955c17cfa5c537f6dbbc4754e11316fd8e
d030b9d998dccbabc236f148fa22041e44c1a0c4
diff --git a/tools/goctl/util/zipx/zipx.go b/tools/goctl/util/zipx/zipx.go index e41d42d8774b..2e72a6d0b8d2 100644 --- a/tools/goctl/util/zipx/zipx.go +++ b/tools/goctl/util/zipx/zipx.go @@ -64,6 +64,15 @@ func fileCopy(file *zip.File, destPath string) error { return err } defer w.Close() + _, err = io.Copy(w,...
[ "tools/goctl/util/zipx/zipx.go", "tools/goctl/util/zipx/zipx_test.go" ]
[]
diff --git a/tools/goctl/util/zipx/zipx_test.go b/tools/goctl/util/zipx/zipx_test.go new file mode 100644 index 000000000000..6574c85762bd --- /dev/null +++ b/tools/goctl/util/zipx/zipx_test.go @@ -0,0 +1,118 @@ +package zipx + +import ( + "archive/zip" + "os" + "path/filepath" + "runtime" + "testing" + + "github.com/s...
true
zeromicro/go-zero
5,479
issue_to_patch
fix: critical security fixes in core/codec (S0)
## Summary Four security-critical (S0) fixes in `core/codec/`, identified by independent code review with high confidence. ## Changes ### S0-1: DH Public Key Validation — `core/codec/dh.go` `ComputeKey` used `&&` instead of `||` in the public key bounds check: ```go // Before: mathematically impossible — never reje...
ec802e25a607737eaf2d2060983d414ff1ae4645
e040215d9df0100646266da63a280088166f67e6
diff --git a/core/codec/aesecb.go b/core/codec/aesecb.go index 1ec99a04c34e..0ee472ec4498 100644 --- a/core/codec/aesecb.go +++ b/core/codec/aesecb.go @@ -6,8 +6,6 @@ import ( "crypto/cipher" "encoding/base64" "errors" - - "github.com/zeromicro/go-zero/core/logx" ) // ErrPaddingSize indicates bad padding size...
[ "core/codec/aesecb.go", "core/codec/aesecb_test.go", "core/codec/dh.go", "core/codec/dh_test.go", "core/codec/rsa.go", "core/codec/rsa_test.go" ]
[]
diff --git a/core/codec/aesecb_test.go b/core/codec/aesecb_test.go index a1117f3abc01..39cd9abbb02f 100644 --- a/core/codec/aesecb_test.go +++ b/core/codec/aesecb_test.go @@ -28,8 +28,8 @@ func TestAesEcb(t *testing.T) { _, err = EcbDecrypt(badKey2, dst) assert.NotNil(t, err) _, err = EcbDecrypt(key, val) - // no...
true
zeromicro/go-zero
5,433
issue_to_patch
feat: add JSON5 configuration support
## Description This PR adds JSON5 support to go-zero's configuration system, enabling modern configuration file syntax with comments, trailing commas, and other developer-friendly features while maintaining full backward compatibility with existing JSON configs. ## Changes ### Core Implementation - **Added JSON5 de...
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/core/conf/config.go b/core/conf/config.go index 481b8ac12733..7f7f920c0719 100644 --- a/core/conf/config.go +++ b/core/conf/config.go @@ -21,10 +21,11 @@ const ( var ( fillDefaultUnmarshaler = mapping.NewUnmarshaler(jsonTagKey, mapping.WithDefault()) loaders = map[string]func([]byte, an...
[ "core/conf/config.go", "core/conf/config_test.go", "go.mod", "go.sum", "internal/encoding/encoding.go", "internal/encoding/encoding_test.go" ]
[ { "comment": "`github.com/titanous/json5` is imported from go-zero code (internal/encoding), so it should be listed as a direct requirement (remove the `// indirect` marker). Keeping it indirect will be reverted by `go mod tidy` and can confuse dependency audits.\n```suggestion\n\tgithub.com/titanous/json5 v1.0...
diff --git a/core/conf/config_test.go b/core/conf/config_test.go index 7eae5964c30a..7c26a64933b3 100644 --- a/core/conf/config_test.go +++ b/core/conf/config_test.go @@ -75,6 +75,160 @@ func TestLoadFromJsonBytesArray(t *testing.T) { assert.EqualValues(t, []string{"foo", "bar"}, expect) } +func TestConfigJson5(t ...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
`github.com/titanous/json5` is imported from go-zero code (internal/encoding), so it should be listed as a direct requirement (remove the `// indirect` marker). Keeping it indirect will be reverted by `go mod tidy` and can confuse dependency audits. ```suggestion github.com/titanous/json5 v1.0.0 ```
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/go.mod b/go.mod index 369fb936f43e..c04ac1b896c7 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/redis/go-redis/v9 v9.18.0 github.com/spaolacci/murmur3 v1.1.0 github.com/stretchr/testify v1.11.1 + github.com/titanous/json5 v1.0.0 go.etcd.io/etcd/api/v3 v3.5.15 go.etcd.io/e...
[ "go.mod" ]
[ { "comment": "`github.com/titanous/json5` is imported from go-zero code (internal/encoding), so it should be listed as a direct requirement (remove the `// indirect` marker). Keeping it indirect will be reverted by `go mod tidy` and can confuse dependency audits.\n```suggestion\n\tgithub.com/titanous/json5 v1.0...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
JSON5 allows `Infinity`/`NaN`, but this converter emits strict JSON via `encoding/json`. If JSON5 input contains values that cannot be represented in JSON, the encode step will fail (or semantics will be lost). Please either (1) explicitly reject such values with a clear error, and add a test, or (2) adjust the PR desc...
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/internal/encoding/encoding.go b/internal/encoding/encoding.go index e1f82fb0380c..a9fe2723764d 100644 --- a/internal/encoding/encoding.go +++ b/internal/encoding/encoding.go @@ -3,12 +3,63 @@ package encoding import ( "bytes" "encoding/json" + "fmt" + "math" "github.com/pelletier/go-toml/v2" + "gi...
[ "internal/encoding/encoding.go" ]
[ { "comment": "JSON5 allows `Infinity`/`NaN`, but this converter emits strict JSON via `encoding/json`. If JSON5 input contains values that cannot be represented in JSON, the encode step will fail (or semantics will be lost). Please either (1) explicitly reject such values with a clear error, and add a test, or ...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
The loader registry now accepts `.json5` (and routes `.json` through the JSON5 loader). The comment on `Load` still says only `.json`, `.yaml`, and `.yml` are acceptable; please update the docs/comment (and any related documentation) to include `.json5` so callers have accurate guidance.
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/core/conf/config.go b/core/conf/config.go index 481b8ac12733..7f7f920c0719 100644 --- a/core/conf/config.go +++ b/core/conf/config.go @@ -21,10 +21,11 @@ const ( var ( fillDefaultUnmarshaler = mapping.NewUnmarshaler(jsonTagKey, mapping.WithDefault()) loaders = map[string]func([]byte, an...
[ "core/conf/config.go" ]
[ { "comment": "The loader registry now accepts `.json5` (and routes `.json` through the JSON5 loader). The comment on `Load` still says only `.json`, `.yaml`, and `.yml` are acceptable; please update the docs/comment (and any related documentation) to include `.json5` so callers have accurate guidance.", "pa...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
The PR description claims JSON5 number features like `Infinity` and `NaN`, but `Json5ToJson` re-encodes via `encoding/json` (`encodeToJSON`), which errors on non-finite floats. As a result, JSON5 inputs containing `NaN`/`Infinity` will fail to load; either document these as unsupported, add explicit validation with a c...
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/internal/encoding/encoding.go b/internal/encoding/encoding.go index e1f82fb0380c..a9fe2723764d 100644 --- a/internal/encoding/encoding.go +++ b/internal/encoding/encoding.go @@ -3,12 +3,63 @@ package encoding import ( "bytes" "encoding/json" + "fmt" + "math" "github.com/pelletier/go-toml/v2" + "gi...
[ "internal/encoding/encoding.go" ]
[ { "comment": "The PR description claims JSON5 number features like `Infinity` and `NaN`, but `Json5ToJson` re-encodes via `encoding/json` (`encodeToJSON`), which errors on non-finite floats. As a result, JSON5 inputs containing `NaN`/`Infinity` will fail to load; either document these as unsupported, add explic...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
The loader registry now supports `.json5` (and `.json` is handled by the JSON5 loader), but the doc comment for `Load`/`LoadConfig` still states only `.json`, `.yaml`, `.yml` are accepted. Please update the public-facing documentation/comments to include `.json5` (and `.toml`, which is also supported).
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/core/conf/config.go b/core/conf/config.go index 481b8ac12733..7f7f920c0719 100644 --- a/core/conf/config.go +++ b/core/conf/config.go @@ -21,10 +21,11 @@ const ( var ( fillDefaultUnmarshaler = mapping.NewUnmarshaler(jsonTagKey, mapping.WithDefault()) loaders = map[string]func([]byte, an...
[ "core/conf/config.go" ]
[ { "comment": "The loader registry now supports `.json5` (and `.json` is handled by the JSON5 loader), but the doc comment for `Load`/`LoadConfig` still states only `.json`, `.yaml`, `.yml` are accepted. Please update the public-facing documentation/comments to include `.json5` (and `.toml`, which is also suppor...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
The new JSON5 tests cover comments/trailing commas/quotes, but there are no cases for the additional number formats mentioned in the PR description (e.g., hex literals, leading/trailing decimal points, `Infinity`, `NaN`). Adding targeted cases here would lock in the intended behavior (and will surface whether non-finit...
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/internal/encoding/encoding_test.go b/internal/encoding/encoding_test.go index b7f8b858d2fb..4cefe65327cb 100644 --- a/internal/encoding/encoding_test.go +++ b/internal/encoding/encoding_test.go @@ -1,6 +1,7 @@ package encoding import ( + "math" "testing" "github.com/stretchr/testify/assert" @@ -1...
[ "internal/encoding/encoding_test.go" ]
[ { "comment": "The new JSON5 tests cover comments/trailing commas/quotes, but there are no cases for the additional number formats mentioned in the PR description (e.g., hex literals, leading/trailing decimal points, `Infinity`, `NaN`). Adding targeted cases here would lock in the intended behavior (and will sur...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
`TestConfigJsonWithJson5Parser` largely duplicates what `TestConfigJson` already asserts for the `.json` extension (and `.json` is now routed through the JSON5 loader via `loaders`). Consider folding this into the existing table-driven test (or extending it to cover JSON5-only syntax in `.json`) to reduce redundant cov...
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/core/conf/config_test.go b/core/conf/config_test.go index 7eae5964c30a..7c26a64933b3 100644 --- a/core/conf/config_test.go +++ b/core/conf/config_test.go @@ -75,6 +75,160 @@ func TestLoadFromJsonBytesArray(t *testing.T) { assert.EqualValues(t, []string{"foo", "bar"}, expect) } +func TestConfigJson5(t ...
[ "core/conf/config_test.go" ]
[ { "comment": "`TestConfigJsonWithJson5Parser` largely duplicates what `TestConfigJson` already asserts for the `.json` extension (and `.json` is now routed through the JSON5 loader via `loaders`). Consider folding this into the existing table-driven test (or extending it to cover JSON5-only syntax in `.json`) t...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
`Json5ToJson` unmarshals JSON5 into `any` and then re-encodes via `encoding/json`. The `titanous/json5` parser is JS-based (numbers are `float64`), so integers larger than 2^53 will be rounded and can even be emitted in scientific notation when re-encoding. That breaks `core/jsonx.Unmarshal` + mapping for `int64/uint64...
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/internal/encoding/encoding.go b/internal/encoding/encoding.go index e1f82fb0380c..a9fe2723764d 100644 --- a/internal/encoding/encoding.go +++ b/internal/encoding/encoding.go @@ -3,12 +3,63 @@ package encoding import ( "bytes" "encoding/json" + "fmt" + "math" "github.com/pelletier/go-toml/v2" + "gi...
[ "internal/encoding/encoding.go" ]
[ { "comment": "`Json5ToJson` unmarshals JSON5 into `any` and then re-encodes via `encoding/json`. The `titanous/json5` parser is JS-based (numbers are `float64`), so integers larger than 2^53 will be rounded and can even be emitted in scientific notation when re-encoding. That breaks `core/jsonx.Unmarshal` + map...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
Routing `.json` files through `LoadFromJson5Bytes` changes number handling: JSON5 parsing goes through `float64` (JS number semantics) before being re-encoded, which can round large integers (>2^53) and/or emit scientific notation. This can cause previously-working `.json` configs to fail to unmarshal into `int64/uint6...
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/core/conf/config.go b/core/conf/config.go index 481b8ac12733..7f7f920c0719 100644 --- a/core/conf/config.go +++ b/core/conf/config.go @@ -21,10 +21,11 @@ const ( var ( fillDefaultUnmarshaler = mapping.NewUnmarshaler(jsonTagKey, mapping.WithDefault()) loaders = map[string]func([]byte, an...
[ "core/conf/config.go" ]
[ { "comment": "Routing `.json` files through `LoadFromJson5Bytes` changes number handling: JSON5 parsing goes through `float64` (JS number semantics) before being re-encoded, which can round large integers (>2^53) and/or emit scientific notation. This can cause previously-working `.json` configs to fail to unmar...
true
zeromicro/go-zero
5,433
comment_to_fix
feat: add JSON5 configuration support
This test is effectively a documentation note (it logs a value but has no assertions beyond "MustLoad doesn't exit"). It also uses MustLoad, which calls log.Fatalf/os.Exit on failure and can abort the entire test run. Prefer asserting expected behavior explicitly (even if it's only "loads successfully" via Load+assert....
8a2e09dfd17ae3e2df426f9c8ea30fd69f0d14d1
17d190f75b3eb72a6b2d1def5389939f86c74138
diff --git a/core/conf/config_test.go b/core/conf/config_test.go index 7eae5964c30a..7c26a64933b3 100644 --- a/core/conf/config_test.go +++ b/core/conf/config_test.go @@ -75,6 +75,160 @@ func TestLoadFromJsonBytesArray(t *testing.T) { assert.EqualValues(t, []string{"foo", "bar"}, expect) } +func TestConfigJson5(t ...
[ "core/conf/config_test.go" ]
[ { "comment": "This test is effectively a documentation note (it logs a value but has no assertions beyond \"MustLoad doesn't exit\"). It also uses MustLoad, which calls log.Fatalf/os.Exit on failure and can abort the entire test run. Prefer asserting expected behavior explicitly (even if it's only \"loads succe...
true
zeromicro/go-zero
5,090
issue_to_patch
Update goctl version to 1.9.0-alpha
4bdb07f22574edee17f01b7348fb8f6da12168f2
14a9464d33b16c90270a0b76559e04775d2be1d1
diff --git a/tools/goctl/internal/version/version.go b/tools/goctl/internal/version/version.go index ae9cabaf78db..7f9176cadd58 100644 --- a/tools/goctl/internal/version/version.go +++ b/tools/goctl/internal/version/version.go @@ -6,7 +6,7 @@ import ( ) // BuildVersion is the version of goctl. -const BuildVersion =...
[ "tools/goctl/internal/version/version.go" ]
[]
true
zeromicro/go-zero
4,953
issue_to_patch
goctll api swagger panic with nil pointer when there is wrong field tag in api file **Describe the bug** A clear and concise description of what the bug is. goctll api swagger panic with nil pointer when api tag is wrong **To Reproduce** Steps to reproduce the behavior, if applicable: write a api file with...
(goctl): fix #4943
- fix #4943 - fix #4936
0ba86b1849d83a7f27df7be34e8247bb94ae20b2
31f413b93ecb6c6db4866faf255c517f4af39911
[ "tools/goctl/api/spec/tags.go", "tools/goctl/api/spec/tags_test.go" ]
[]
diff --git a/tools/goctl/api/spec/tags.go b/tools/goctl/api/spec/tags.go index 312772d35f97..1e3d153b3bbe 100644 --- a/tools/goctl/api/spec/tags.go +++ b/tools/goctl/api/spec/tags.go @@ -49,6 +49,9 @@ func Parse(tag string) (*Tags, error) { // Get gets tag value by specified key func (t *Tags) Get(key string) (*Tag...
true
zeromicro/go-zero
4,812
issue_to_patch
Update goctl version to 1.8.3-beta
15ea07aad1dd7ac9338dead1096e8021892d98c0
6702ace36737c22a0e3393fb38c388148831ef80
diff --git a/tools/goctl/internal/version/version.go b/tools/goctl/internal/version/version.go index 09fab1581006..03a335538628 100644 --- a/tools/goctl/internal/version/version.go +++ b/tools/goctl/internal/version/version.go @@ -6,7 +6,7 @@ import ( ) // BuildVersion is the version of goctl. -const BuildVersion =...
[ "tools/goctl/internal/version/version.go" ]
[]
true
zeromicro/go-zero
4,808
issue_to_patch
fix: goctl swagger missing security definition and submit json body data error
44735e949cedfdc802cf7c54eaec8de0d38a011d
82a3583cb842db60be378b482abc2f15cf381058
diff --git a/tools/goctl/api/swagger/annotation.go b/tools/goctl/api/swagger/annotation.go index 6af5cd3be216..09f31097e76c 100644 --- a/tools/goctl/api/swagger/annotation.go +++ b/tools/goctl/api/swagger/annotation.go @@ -7,6 +7,15 @@ import ( "google.golang.org/grpc/metadata" ) +func hasKey(properties map[string...
[ "tools/goctl/api/swagger/annotation.go", "tools/goctl/api/swagger/command.go", "tools/goctl/api/swagger/const.go", "tools/goctl/api/swagger/example/example_cn.api", "tools/goctl/api/swagger/parameter.go", "tools/goctl/api/swagger/path.go", "tools/goctl/api/swagger/properties.go", "tools/goctl/api/swag...
[]
true
zeromicro/go-zero
4,801
issue_to_patch
fix array schmea generation incorrect
bf313c3c561d2f47a47acd01443a9c3f4ec6bf3b
a15d433e782b8d75fe83c2a3053d6e0d2403c904
diff --git a/tools/goctl/api/swagger/example/example_cn.api b/tools/goctl/api/swagger/example/example_cn.api index 670a728e49a3..546ebf871db1 100644 --- a/tools/goctl/api/swagger/example/example_cn.api +++ b/tools/goctl/api/swagger/example/example_cn.api @@ -144,6 +144,8 @@ type ( MapMapNumber map[string]map[string...
[ "tools/goctl/api/swagger/example/example_cn.api", "tools/goctl/api/swagger/parameter.go", "tools/goctl/api/swagger/properties.go", "tools/goctl/api/swagger/swagger.go" ]
[]
true
zeromicro/go-zero
4,799
issue_to_patch
fix: swagger separator incorrect in Windows OS
94e7753262cd526293fda35e3de87ae3ea8472ad
d26c51212659bffcaa5e66ecb3dcec0a269454b6
diff --git a/tools/goctl/api/swagger/swagger.go b/tools/goctl/api/swagger/swagger.go index 042d82d487bc..fc65bf2d3c92 100644 --- a/tools/goctl/api/swagger/swagger.go +++ b/tools/goctl/api/swagger/swagger.go @@ -1,7 +1,6 @@ package swagger import ( - "path/filepath" "strings" "time" @@ -279,7 +278,7 @@ func pa...
[ "tools/goctl/api/swagger/swagger.go" ]
[]
true
zeromicro/go-zero
4,791
issue_to_patch
fix: the parameter "required" in the Swagger document generated for repair is incorrect
fix: the parameter `required` in the Swagger document generated for repair is incorrect
9c478626d2261a5d7c328481a472cb6391fa96e3
cd58ee14c4edf8c263b34eb84c349d0bbb3d72d6
diff --git a/tools/goctl/api/swagger/swagger.go b/tools/goctl/api/swagger/swagger.go index eb64d4a691ab..042d82d487bc 100644 --- a/tools/goctl/api/swagger/swagger.go +++ b/tools/goctl/api/swagger/swagger.go @@ -238,14 +238,35 @@ func rangeMemberAndDo(structType apiSpec.Type, do func(tag *apiSpec.Tags, requir var memb...
[ "tools/goctl/api/swagger/swagger.go" ]
[]
true
zeromicro/go-zero
5,348
issue_to_patch
Fix the issue of incorrect values notified in the configuration center
39729f375608ba1830dbbe2e5ae74716a9184f90
870cdaea8cd650b99818ce1480519886dc48468f
diff --git a/core/configcenter/subscriber/etcd.go b/core/configcenter/subscriber/etcd.go index f9a11efccbd6..c5a8f5334c1e 100644 --- a/core/configcenter/subscriber/etcd.go +++ b/core/configcenter/subscriber/etcd.go @@ -3,6 +3,8 @@ package subscriber import ( "github.com/zeromicro/go-zero/core/discov" "github.com/z...
[ "core/configcenter/subscriber/etcd.go", "core/configcenter/subscriber/etcd_test.go", "core/discov/subscriber.go", "core/discov/subscriber_test.go" ]
[ { "comment": "Spelling error: \"forth\" should be \"fourth\" to correctly indicate the ordinal position (4th item).\n```suggestion\n\t\t\t\t\tkey: \"fourth\",\n```", "path": "core/discov/subscriber_test.go", "hunk": "@@ -201,6 +201,179 @@ func TestContainer(t *testing.T) {\n \t}\n }\n \n+func TestConfig...
diff --git a/core/configcenter/subscriber/etcd_test.go b/core/configcenter/subscriber/etcd_test.go new file mode 100644 index 000000000000..db6482f44536 --- /dev/null +++ b/core/configcenter/subscriber/etcd_test.go @@ -0,0 +1,186 @@ +package subscriber + +import ( + "testing" + + "github.com/stretchr/testify/assert" + ...
true
zeromq/libzmq
4,850
issue_to_patch
build: default to epoll for MinGW on Windows (fix IPC/select issue)
MinGW builds were falling back to select poller, which is incompatible with IPC and causes compilation failure. Default epoll is now enabled for both MSVC and MinGW to ensure consistent behavior. Comments updated accordingly.
7d95ac02ae1af9a2f6896794d12b9de2ae30a3a8
e00438aa2f66651c97e8ee823914a1fad78e404c
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e807d1a21..48b4a5e170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,13 +383,14 @@ if(WIN32) "${ZMQ_WIN32_WINNT_DEFAULT}" CACHE STRING "Value to set _WIN32_WINNT to for building [default=autodetect from build environment]") - # On Windows Vi...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,822
issue_to_patch
VSOCK support # Issue description I'd like to make a feature request to explicitly add support for `AF_VSOCK` sockets, as the form of `vsock://CID:PORT`. [VSOCK](https://man7.org/linux/man-pages/man7/vsock.7.html) is used to implement IPC between VMs and containers without extra network configurations in Linux s...
Add the Linux VSOCK transport.
Hello, VSOCK transport allows communication between the Host and guests. It requires linux on the host and Guest. the code is mostly inspire from the tipc and vmci. there is a conflict between VMCI and VSOCK header, i don't know how to treat this issue, do we support having both build ? or do we make exclusion ...
7a7bfa10e6b0e99210ed9397369b59f9e69cef8e
148da6dd40b08c84d4acddd23da7b2c78d34301a
diff --git a/AUTHORS b/AUTHORS index dc1667e342..239a340112 100644 --- a/AUTHORS +++ b/AUTHORS @@ -102,6 +102,7 @@ Philip Kovacs Pieter Hintjens Piotr Trojanek Reza Ebrahimi +Remi Jouannet Richard Newton Rik van der Heijden Robert G. Jakabosky diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e5f4929dc..9184cd8...
[ "AUTHORS", "CMakeLists.txt", "Makefile.am", "builds/cmake/platform.hpp.in", "configure.ac", "doc/Makefile.am", "doc/zmq.adoc", "doc/zmq_bind.adoc", "doc/zmq_connect.adoc", "doc/zmq_inproc.adoc", "doc/zmq_ipc.adoc", "doc/zmq_pgm.adoc", "doc/zmq_tcp.adoc", "doc/zmq_tipc.adoc", "doc/zmq_udp...
[]
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index eb59de29f9..a6b1bb7444 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -152,6 +152,10 @@ if(WITH_VMCI) list(APPEND tests test_pair_vmci test_reqrep_vmci) endif() +if(ZMQ_HAVE_VSOCK) + list(APPEND tests test_pair_vsock test_reqrep_vsoc...
true
zeromq/libzmq
4,846
issue_to_patch
Compilation Issue with libzmq 4.3.5 on AIX due to MSG_DONTWAIT
Hi All, While attempting to compile libzmq 4.3.5 on AIX, I encountered compilation issues during test runs in files such as test_bind_stream_fuzzer.cpp, test_connect_stream_fuzzer.cpp, test_bind_curve_fuzzer.cpp, test_connect_curve_fuzzer, test_connect_ws_fuzzer.cpp, etc. The errors occur because MSG_DONTWAIT is ...
3a1af92db37d192d4319864a21d9fc14138f4a41
bf91f707e84dc431ced7c151e25f9322d28718e2
[ "tests/testutil.hpp" ]
[]
diff --git a/tests/testutil.hpp b/tests/testutil.hpp index 164bdf5911..a2faf6c8b8 100644 --- a/tests/testutil.hpp +++ b/tests/testutil.hpp @@ -1,5 +1,9 @@ /* SPDX-License-Identifier: MPL-2.0 */ +#ifdef _AIX +#define MSG_DONTWAIT MSG_NONBLOCK +#endif + #ifndef __TESTUTIL_HPP_INCLUDED__ #define __TESTUTIL_HPP_INCLUD...
true
zeromq/libzmq
4,845
issue_to_patch
TST: bind bsd socket to loopback instead of all interfaces
## Problem: on macOS, at least, INADDR_ANY is not a connectable host, leading to EHOSTUNREACH when the address is passed to `sendto`: ``` tests/test_zmq_poll_fd.cpp:42:test_poll_fd:FAIL: sendto ( send_socket, buf, 10, 0, (struct sockaddr *) &saddr, sizeof (saddr)) failed, errno = 65 (Host unreachable) ``` ##...
51a5a9cbe315ab149357afe063e9e2d41f4c99a8
e6e29cca4fe8f6239d0a5db9430e57f215597e85
[ "tests/testutil.cpp" ]
[]
diff --git a/tests/testutil.cpp b/tests/testutil.cpp index 6f21e8f608..f8a40255f9 100644 --- a/tests/testutil.cpp +++ b/tests/testutil.cpp @@ -331,7 +331,7 @@ sockaddr_in bind_bsd_socket (int socket_) struct sockaddr_in saddr; memset (&saddr, 0, sizeof (saddr)); saddr.sin_family = AF_INET; - saddr.sin...
true
zeromq/libzmq
4,835
issue_to_patch
The #4486 fix for `CACHELINE_SIZE` probe on qemu-user is incomplete, libzmq v4.3.5 compilation still fails There is an already merged past PR trying to fix a compilation error on s390x when running in qemu-user emulation. * https://github.com/zeromq/libzmq/pull/4486 ## Steps to reproduce I am still seeing this issu...
Problem: CACHELINE_SIZE conditions check string after numeric comparisons
## Problem When `getconf LEVEL1_DCACHE_LINESIZE` returns `"undefined"` (e.g., on s390x under qemu-user emulation), the current condition ordering checks `STREQUAL "undefined"` after `EQUAL 0` and `EQUAL -1`. While this works in current CMake versions, performing numeric comparisons on non-numeric strings before strin...
00f12d22f3e1413b65665b288d665923af90df2e
0c72c6544c7afbb3ec6d39da44914fc19d3c300c
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e5f4929dc..fc046e1848 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -491,9 +491,9 @@ execute_process( OUTPUT_VARIABLE CACHELINE_SIZE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(CACHELINE_SIZE STREQUAL "" + OR CACHELINE_SIZE STREQUAL "undefined" ...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,833
issue_to_patch
test_mock_pub_sub: increase wait time in mock pub/sub test for loaded…
… systems The msleep(1) in test_mock_pub_sub() can cause random failures onmachines under heavy load. As this test seems to validates compatibility between different ZMTP version and not performance, I propose Increase the wait time to allow the state machine to properly attach the pipe after handshake. Note to s...
900a548a43395a367801e48d9a953cd42c6da545
1aed230e84aebaf919b6acfd07eda07d00880dc6
[ "tests/test_mock_pub_sub.cpp" ]
[]
diff --git a/tests/test_mock_pub_sub.cpp b/tests/test_mock_pub_sub.cpp index d1229ddd54..affbc28eb6 100644 --- a/tests/test_mock_pub_sub.cpp +++ b/tests/test_mock_pub_sub.cpp @@ -141,7 +141,7 @@ static void test_mock_pub_sub (bool sub_command_, bool mock_pub_) TEST_ASSERT_EQUAL_INT (0, rc); // SUB bi...
true
zeromq/libzmq
4,829
issue_to_patch
problem: no API to disconnect a specific peer by routing id
Background: JeroMQ added disconnectPeer(routingId) to allow dropping a single peer connection. In libzmq there was no C API to disconnect a single connection by its routing id; applications had to tear down entire endpoints or sockets. This also created divergence between JeroMQ and libzmq for the PEER/SERVER patterns....
7a7bfa10e6b0e99210ed9397369b59f9e69cef8e
1610d21124fc50e7cc9df8d1e754018c4110f52d
diff --git a/Makefile.am b/Makefile.am index 19aa168096..17dc1e6e16 100755 --- a/Makefile.am +++ b/Makefile.am @@ -1059,6 +1059,7 @@ test_apps += tests/test_poller \ tests/test_xpub_manual_last_value \ tests/test_router_notify \ tests/test_peer \ + tests/test_peer_disconnect \ tests/test_reconnect_options \ t...
[ "Makefile.am", "doc/Makefile.am", "doc/zmq_disconnect_peer.adoc", "doc/zmq_socket.adoc", "include/zmq.h", "src/server.cpp", "src/server.hpp", "src/socket_base.cpp", "src/socket_base.hpp", "src/zmq.cpp", "tests/CMakeLists.txt", "tests/test_peer_disconnect.cpp" ]
[]
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index eb59de29f9..12ac80c175 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -167,6 +167,7 @@ if(ENABLE_DRAFTS) test_router_notify test_xpub_manual_last_value test_peer + test_peer_disconnect test_msg_init test_channel ...
true
zeromq/libzmq
4,635
issue_to_patch
Build with -D_DEFAULT_SOURCE along with -std=c11
On its own, `-std=c11` hides POSIX and other extensions from C headers such as `<stdlib.h>` when building against glibc. This causes the `posix_memalign` probe to fail incorrectly with compilers that do not accept implicit function declarations. `_DEFAULT_SOURCE` is ignored by most non-GNU/Linux systems or not releva...
2622e618f0badcd8aad7906e2dc6984f2c57e81a
77e32bf41f8b40e9182ebc5c15708b74d162e450
diff --git a/CMakeLists.txt b/CMakeLists.txt index 68fb72512d..f956f3fd93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,7 +122,7 @@ if (NOT MSVC) if(NOT CMAKE_C_FLAGS MATCHES "-std=" AND NOT C_STANDARD AND NOT CMAKE_C_STANDARD) check_c_compiler_flag("-std=c11" COMPILER_SUPPORTS_C11) if(COMPILER_...
[ "CMakeLists.txt", "configure.ac" ]
[ { "comment": "it's a preprocessor flags, so it should be appended to CPPFLAGS rather than CFLAGS", "path": "configure.ac", "hunk": "@@ -66,7 +66,7 @@ ZMQ_ORIG_CXXFLAGS=\"${CXXFLAGS:-none}\"\n \n # Checks for programs.\n AC_PROG_CC\n-AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=\" -std=c11\"], [AC_PROG_CC_...
true
zeromq/libzmq
4,635
comment_to_fix
Build with -D_DEFAULT_SOURCE along with -std=c11
it's a preprocessor flags, so it should be appended to CPPFLAGS rather than CFLAGS
2622e618f0badcd8aad7906e2dc6984f2c57e81a
77e32bf41f8b40e9182ebc5c15708b74d162e450
diff --git a/configure.ac b/configure.ac index b9e13d4f97..ffcc145b9f 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}" # Checks for programs. AC_PROG_CC -AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=" -std=c11"], [AC_PROG_CC_C99]) +AX_CHECK_COMPILE_FLAG([-std=c11], ...
[ "configure.ac" ]
[ { "comment": "it's a preprocessor flags, so it should be appended to CPPFLAGS rather than CFLAGS", "path": "configure.ac", "hunk": "@@ -66,7 +66,7 @@ ZMQ_ORIG_CXXFLAGS=\"${CXXFLAGS:-none}\"\n \n # Checks for programs.\n AC_PROG_CC\n-AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=\" -std=c11\"], [AC_PROG_CC_...
true
zeromq/libzmq
4,814
issue_to_patch
CMake: fix installation of config files on MinGW
You have configured zeromq with CMake. Build environment is MinGW. When you install the the package config files, they are copied into a "CMake" directory into the sysroot, but this is a nonsense. <img width="622" height="220" alt="immagine" src="https://github.com/user-attachments/assets/e20b217d-5a33-4b05-8de5-...
aaf88cdfd8286a81e569ac9d3e106df22a77a412
157b485d6cd589a71baf3fa587d219fd368bd29d
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7caf2c8763..5e5f4929dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1756,7 +1756,7 @@ if(WITH_DOC) endif() endif() -if(WIN32) +if(WIN32 AND NOT MINGW) set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "CMake" CACHE STRING "install path for ZeroMQConfig....
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,812
issue_to_patch
fix(windows) VMCI Listener not compiling
make vmci_listener compile on windows again
3e5ce5c1cd75bd93b2ab51d98e0239eb8628b953
3d6a276e1fefce14148a931fff9beb0e604ee680
diff --git a/src/vmci_listener.cpp b/src/vmci_listener.cpp index af7d3602b3..94eabce1e9 100644 --- a/src/vmci_listener.cpp +++ b/src/vmci_listener.cpp @@ -93,7 +93,7 @@ int zmq::vmci_listener_t::set_local_address (const char *addr_) _s = open_socket (this->get_ctx ()->get_vmci_socket_family (), SOCK_STREAM,...
[ "src/vmci_listener.cpp" ]
[]
true
zeromq/libzmq
4,622
issue_to_patch
Make failing test not hang
The tests/test_radio_dish test implements is_multicast_available() to verify that multicast is working on the system before running tests that relies on this, or skipping those test otherwise. In some circumstances this check itself hangs due to the recvfrom() call being blocking waiting for data. The test is eventu...
dd7369b0a99d476a8e7e7d86d3bc581ff16c61e2
0761bb13e61a844c15ee8e07607fd010c399fc47
[ "tests/test_radio_dish.cpp" ]
[ { "comment": "strlen() returns size_t and socklen_t is int -> size reduction.", "path": "tests/test_radio_dish.cpp", "hunk": "@@ -395,15 +395,14 @@ static bool is_multicast_available (int ipv6_)\n \n msleep (SETTLE_TIME);\n \n- rc = sendto (send_sock, msg, static_cast<socklen_t> (strlen (msg)), 0...
diff --git a/tests/test_radio_dish.cpp b/tests/test_radio_dish.cpp index 7bfa722d6f..b84b1b1448 100644 --- a/tests/test_radio_dish.cpp +++ b/tests/test_radio_dish.cpp @@ -321,7 +321,7 @@ static bool is_multicast_available (int ipv6_) struct sockaddr_in *mcast_ipv4 = &mcast.ipv4; any_ipv4->sin_family...
true
zeromq/libzmq
4,622
comment_to_fix
Make failing test not hang
strlen() returns size_t and socklen_t is int -> size reduction.
dd7369b0a99d476a8e7e7d86d3bc581ff16c61e2
0761bb13e61a844c15ee8e07607fd010c399fc47
diff --git a/tests/test_radio_dish.cpp b/tests/test_radio_dish.cpp index 7bfa722d6f..b84b1b1448 100644 --- a/tests/test_radio_dish.cpp +++ b/tests/test_radio_dish.cpp @@ -321,7 +321,7 @@ static bool is_multicast_available (int ipv6_) struct sockaddr_in *mcast_ipv4 = &mcast.ipv4; any_ipv4->sin_family...
[ "tests/test_radio_dish.cpp" ]
[ { "comment": "strlen() returns size_t and socklen_t is int -> size reduction.", "path": "tests/test_radio_dish.cpp", "hunk": "@@ -395,15 +395,14 @@ static bool is_multicast_available (int ipv6_)\n \n msleep (SETTLE_TIME);\n \n- rc = sendto (send_sock, msg, static_cast<socklen_t> (strlen (msg)), 0...
true
zeromq/libzmq
4,622
comment_to_fix
Make failing test not hang
ZMQ_DONTWAIT?
dd7369b0a99d476a8e7e7d86d3bc581ff16c61e2
0761bb13e61a844c15ee8e07607fd010c399fc47
diff --git a/tests/test_radio_dish.cpp b/tests/test_radio_dish.cpp index 7bfa722d6f..b84b1b1448 100644 --- a/tests/test_radio_dish.cpp +++ b/tests/test_radio_dish.cpp @@ -321,7 +321,7 @@ static bool is_multicast_available (int ipv6_) struct sockaddr_in *mcast_ipv4 = &mcast.ipv4; any_ipv4->sin_family...
[ "tests/test_radio_dish.cpp" ]
[ { "comment": "ZMQ_DONTWAIT?", "path": "tests/test_radio_dish.cpp", "hunk": "@@ -395,15 +395,14 @@ static bool is_multicast_available (int ipv6_)\n \n msleep (SETTLE_TIME);\n \n- rc = sendto (send_sock, msg, static_cast<socklen_t> (strlen (msg)), 0,\n- &mcast.generic, sl);\n+ rc...
true
zeromq/libzmq
4,800
issue_to_patch
Problem: code coverage build fails
Solution: add -fprofile-update=atomic and --ignore-errors unused as indicated by log message ``` geninfo: ERROR: Unexpected negative count '-1' for /usr/include/c++/13/bits/stl_tree.h:2466. Perhaps you need to compile with '-fprofile-update=atomic LCOV --remove /tmp/* lcov: ERROR: 'exclude' pattern '/tmp/*'...
f4329c5ec69ad5c4dade88cca971c6fcd57f590f
00e3b9ba02a751dcb778d46ba31b6efb31539f60
diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4 index 6484f03324..1434098a0a 100644 --- a/m4/ax_code_coverage.m4 +++ b/m4/ax_code_coverage.m4 @@ -125,8 +125,8 @@ AC_DEFUN([AX_CODE_COVERAGE],[ dnl Build the code coverage flags dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility CODE_COVERA...
[ "m4/ax_code_coverage.m4" ]
[]
true
zeromq/libzmq
4,799
issue_to_patch
tools: curve_keygen not built when building with cmake, ninja # Issue description When building with cmake using the ninja builder, the `curve_keygen` tool is not compiled or installed. This tool is built when using the autoconf toolchain and GNU Make. # Environment * libzmq versions: 4.3.5 and latest (2a7...
cmake: add curve_keygen binary
When sodium is enabled, also build curve_keygen binary. This is to bring cmake builds to parity with autoconf. Fixes: https://github.com/zeromq/libzmq/issues/4675
b91a6201307b72beb522300366aad763d19b1456
dacde1f11aa4fcbf7571ea520e7b1b8ccee154ec
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ab2259e6f..7caf2c8763 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1915,3 +1915,9 @@ if(ENABLE_NO_EXPORT) message(STATUS "Building with empty ZMQ_EXPORT macro") add_definitions(-DZMQ_NO_EXPORT) endif() + +if (ENABLE_CURVE) + add_executable(curve_keygen...
[ "CMakeLists.txt" ]
[ { "comment": "leftover commented out line?", "path": "CMakeLists.txt", "hunk": "@@ -1915,3 +1915,9 @@ if(ENABLE_NO_EXPORT)\n message(STATUS \"Building with empty ZMQ_EXPORT macro\")\n add_definitions(-DZMQ_NO_EXPORT)\n endif()\n+\n+if (ENABLE_CURVE)\n+ add_executable(curve_keygen tools/curve_keygen...
true
zeromq/libzmq
4,799
comment_to_fix
cmake: add curve_keygen binary
leftover commented out line?
b91a6201307b72beb522300366aad763d19b1456
dacde1f11aa4fcbf7571ea520e7b1b8ccee154ec
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ab2259e6f..7caf2c8763 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1915,3 +1915,9 @@ if(ENABLE_NO_EXPORT) message(STATUS "Building with empty ZMQ_EXPORT macro") add_definitions(-DZMQ_NO_EXPORT) endif() + +if (ENABLE_CURVE) + add_executable(curve_keygen...
[ "CMakeLists.txt" ]
[ { "comment": "leftover commented out line?", "path": "CMakeLists.txt", "hunk": "@@ -1915,3 +1915,9 @@ if(ENABLE_NO_EXPORT)\n message(STATUS \"Building with empty ZMQ_EXPORT macro\")\n add_definitions(-DZMQ_NO_EXPORT)\n endif()\n+\n+if (ENABLE_CURVE)\n+ add_executable(curve_keygen tools/curve_keygen...
true
zeromq/libzmq
4,797
issue_to_patch
Fix up broken CI checks
- Updated clang format to a version that is available in the recent Github Actions environments - Run clang-format on the codebase to get the ci check passing Testing: - Relying on CI
798a689df1a7945f556d5404311c6ccebb282788
6123b6d160b3af1a65a0050a533c7ad8ab76751f
diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index a5946e6a9d..bc7807060f 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -66,7 +66,7 @@ jobs: - os: ubuntu-latest BUILD_TYPE: cmake DRAFT: enabled - PACKAGES: cmake clang-form...
[ ".github/workflows/CI.yaml", "builds/cmake/ci_build.sh", "include/zmq.h", "src/atomic_counter.hpp", "src/atomic_ptr.hpp", "src/blob.hpp", "src/clock.cpp", "src/err.hpp", "src/mailbox.hpp", "src/norm_engine.cpp", "src/socket_poller.cpp", "src/stream_engine_base.hpp", "src/tipc_address.cpp", ...
[]
diff --git a/tests/test_tcp_accept_filter.cpp b/tests/test_tcp_accept_filter.cpp index 04c6da4ca5..8576e3517c 100644 --- a/tests/test_tcp_accept_filter.cpp +++ b/tests/test_tcp_accept_filter.cpp @@ -56,10 +56,7 @@ void test_bad_filter_string (const char *const filter_) } #define TEST_BAD_FILTER_STRING(case, filter)...
true
zeromq/libzmq
4,776
issue_to_patch
set upper bound in cmake_minimum_required
setting an upper bound improves forward-compatibility as legacy version support is dropped. Without an upper bound, the minimum version is used as the policy version, which means that setting a version lower than 3.5 will result in warnings starting with cmake 3.27 and errors starting in 4.0 (release candidate out now)...
34f7fa22022bed9e0e390ed3580a1c83ac4a2834
1e65e8e61d693b14dd2f9e3ace4ffae46159691c
diff --git a/CMakeLists.txt b/CMakeLists.txt index e4ce8a3d17..3ab2259e6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ # CMake build script for ZeroMQ if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin) - cmake_minimum_required(VERSION 3.0.2) + cmake_minimum_required(VERSION 3.0.2...3.31) else() - ...
[ "CMakeLists.txt", "tests/CMakeLists.txt", "unittests/CMakeLists.txt" ]
[]
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a8dfa8f2a4..eb59de29f9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ # CMake build script for ZeroMQ tests -cmake_minimum_required(VERSION "2.8.1") +cmake_minimum_required(VERSION 2.8.1...3.31) # On Windows: solution file ...
true
zeromq/libzmq
4,796
issue_to_patch
Rename RemoveSection macro to avoid duplicate conflict with NSIS3
The latest version of NSIS (3.11) gives an error with the included NSIS templates. Renaming the RemoveSection macro seems to solve this issue.
c2f7f8ae12720f48e97dc7d719da73cdab77e450
9bac00b5c895ebc37530029db8659e082aca52aa
diff --git a/builds/cmake/NSIS.template32.in b/builds/cmake/NSIS.template32.in index 0b7d245497..5ff3eae318 100644 --- a/builds/cmake/NSIS.template32.in +++ b/builds/cmake/NSIS.template32.in @@ -120,7 +120,7 @@ Var AR_RegFlags "exit_${SecName}:" !macroend -!macro RemoveSection SecName +!macro RemoveSection_CPack ...
[ "builds/cmake/NSIS.template32.in", "builds/cmake/NSIS.template64.in" ]
[]
true
zeromq/libzmq
4,795
issue_to_patch
Libzmq Android build fails with NDK r27 # Issue description Android build fails with latest NDK version r27. # Environment * libzmq version (commit hash if unreleased): Latest commit on master 90b4f410a07222fa2e9a5f53b454a09d4533e45a * OS: Ubuntu 24.04 # Minimal test code / Steps to reproduce the issue ...
ANDROID: Support NDK r27x.
This fix has to be reported in LIBZMQ as well and will fix https://github.com/zeromq/libzmq/issues/4744. Close #4744
34f7fa22022bed9e0e390ed3580a1c83ac4a2834
5cdcf7ddffd821561930e96c97dc42a4120680a6
diff --git a/builds/android/android_build_helper.sh b/builds/android/android_build_helper.sh index d47a905df1..b0175916d3 100644 --- a/builds/android/android_build_helper.sh +++ b/builds/android/android_build_helper.sh @@ -355,8 +355,11 @@ function android_build_opts { _android_build_opts_process_binaries - ...
[ "builds/android/android_build_helper.sh" ]
[]
true
zeromq/libzmq
4,678
issue_to_patch
Do not use _MSC_VER if windows
This fixes several instances where _MSC_VER was used to determine whether to use afunix.h or not. For example, MinGW requires the use of afunix.h but does not define _MSC_VER. The correct behavior is checking ZMQ_HAVE_WINDOWS.
2a75ef07be0ba76f86592e10b999331cd6124d52
241c24cb038770d0c9b499fea8ae1e6df5d170a4
diff --git a/src/ipc_address.hpp b/src/ipc_address.hpp index 422c271127..87f1245b1b 100644 --- a/src/ipc_address.hpp +++ b/src/ipc_address.hpp @@ -7,7 +7,7 @@ #include <string> -#if defined _MSC_VER +#if defined ZMQ_HAVE_WINDOWS #include <afunix.h> #else #include <sys/socket.h> diff --git a/src/ipc_connecter.cp...
[ "src/ipc_address.hpp", "src/ipc_connecter.cpp", "src/ipc_listener.cpp", "tests/testutil.cpp" ]
[]
diff --git a/tests/testutil.cpp b/tests/testutil.cpp index bdc80283cb..6f21e8f608 100644 --- a/tests/testutil.cpp +++ b/tests/testutil.cpp @@ -7,7 +7,7 @@ #if defined _WIN32 #include "../src/windows.hpp" -#if defined _MSC_VER +#if defined ZMQ_HAVE_WINDOWS #if defined ZMQ_HAVE_IPC #include <direct.h> #include <af...
true
zeromq/libzmq
4,764
issue_to_patch
cmake_minimum_required() before project()
* Without this CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded (MT) Windows builds still produced incompatible MultiThreadedDLL (MD) output. * Resolves following warning: CMake Warning (dev) at CMakeLists.txt:2 (project): cmake_minimum_required() should be called prior to this top-level project() call. * Use...
a23330dbe249f7ebd81bb5be47c892e8fa9cc4f8
621369a40ef3a53dfeeec5d3fc4b43ad738b3c5d
diff --git a/CMakeLists.txt b/CMakeLists.txt index 861164ad9e..e4ce8a3d17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,13 @@ # CMake build script for ZeroMQ -project(ZeroMQ) -if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) +if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin) cmake_minimum_required(VERSION 3.0....
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,757
issue_to_patch
Fix compilation with modern compilers
Fixes error: jump to label 'try_tcpip' crosses initialization of 'const SOCKET listener'
60899603a4c3a71e2561af4081d2f96cf1ae6e46
1f7580ab7d5c2508de30ba8dcbbf2fd103daab5c
diff --git a/src/ip.cpp b/src/ip.cpp index 30d70eb022..721acb1de7 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -557,6 +557,7 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_) socklen_t lcladdr_len = sizeof lcladdr; int rc = 0; int saved_errno = 0; + SOCKET listener = INVALID_SOCKET; // It appears tha...
[ "src/ip.cpp" ]
[]
true
zeromq/libzmq
4,756
issue_to_patch
The example of zmq_timers document is wrong # Issue description https://zeromq.github.io/libzmq/zmq_timers.html The description of `zmq_timers_execute` is: _zmq_timers_execute will run callbacks of all expired timers from the instance timers._ However, the example does not call `zmq_timers_execute` after the t...
Fix example issue of zmq_timers.adoc
Call `zmq_timers_execute` after the timer expires, making sure `assert(timer_invoked)` passes. Fixes #4755
90b4f410a07222fa2e9a5f53b454a09d4533e45a
65d4724aaf4568f181bf9d91efa2359e6f5ed794
diff --git a/doc/zmq_timers.adoc b/doc/zmq_timers.adoc index 0a88a9dcf0..b51a656446 100644 --- a/doc/zmq_timers.adoc +++ b/doc/zmq_timers.adoc @@ -136,6 +136,10 @@ _timer_id_ did not exist or was already cancelled. // Wait until the end rc = msleep (zmq_timers_timeout (timers)); assert (rc == 0); + + ...
[ "doc/zmq_timers.adoc" ]
[]
true
zeromq/libzmq
4,743
issue_to_patch
cmake: Refer to `prefix` variable in generated `libzmq.pc`
This change: 1. Makes the `libzmq.pc` files generated by Autotools and CMake more aligned. 2. Allows the `prefix` variable to be redefined if the package is relocated.
64db7d28fea695132834f6d2c5949cfea2f22d01
b187bd2c27907312eaaaa24473ef354e2e0363c1
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ad2cc106f..861164ad9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1256,9 +1256,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/platform.hpp.in ${CMAKE_ list(APPEND sources ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp) set(prefix ${CMAKE_INSTALL_P...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,739
issue_to_patch
zmq_socket document format error # Issue description https://zeromq.github.io/libzmq/zmq_socket.html ![image](https://github.com/user-attachments/assets/059eb815-5309-4f09-b009-dbb953fe671e)
Problem: zmq_socket document format error
Solution: Fix format issue of zmq_socket.adoc Fixes #4738
1f4dd54f94009cb57bb68bfc856edc1c0bd3df06
e758c01d2c1e1980bd3fe59f434c884277140397
diff --git a/doc/zmq_socket.adoc b/doc/zmq_socket.adoc index e0f8657756..57fa81611b 100644 --- a/doc/zmq_socket.adoc +++ b/doc/zmq_socket.adoc @@ -164,7 +164,7 @@ Groups are matched using exact matching (vs prefix matching of PubSub). NOTE: Radio-dish is still in draft phase. ZMQ_RADIO -^^^^^^^ +^^^^^^^^^ A socket...
[ "doc/zmq_socket.adoc" ]
[]
true
zeromq/libzmq
4,734
issue_to_patch
Problem: epoll crashes for some Windows users # Issue description Reported [in pyzmq](https://github.com/zeromq/pyzmq/issues/1981), but after updating to libzmq 4.3.5, it appears the patch in #4422 did not fix the problem, but just shifted the error. # Environment * libzmq version (commit hash if unreleased):...
Problem: ipc connect can fail on Windows, even after bind
Solution: - move tcpip fallback to after connect instead of assuming successful ipc bind means ipc works (it's very weird and possibly a Windows bug that this can happen, but I can at least confirm that it does in very specific scenarios - Python from Windows Store + non-ascii username + default `$env:TMP`) - corre...
0ed7a08cd946e0832ac4655b7a76c09ac221f63b
27696d7eaaed945fcf84aae4dfc999e81ca28266
diff --git a/src/ip.cpp b/src/ip.cpp index 1aaf6ad6b1..30d70eb022 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -23,6 +23,11 @@ #include "tcp.hpp" #ifdef ZMQ_HAVE_IPC #include "ipc_address.hpp" +// Don't try ipc if it fails once +namespace zmq +{ +static bool try_ipc_first = true; +} #endif #include <direct.h> @@ ...
[ "src/ip.cpp" ]
[]
true
zeromq/libzmq
4,732
issue_to_patch
Problem: create_ipc_wildcard_address can fail
check and handle failure as a fallback to tcp I _believe_ this is the cause of #4730 There may be a better underlying fix to prevent the failure in the first place, but this treats failure to create the path for the ipc socket as a condition for falling back on tcp, just like failing to create the AF_UNIX socket ...
5f408ba371ae4789549fb4696dcccd2ac946b7eb
a8ab9ca1a29620e2b36676a9778f209af10a540e
diff --git a/src/ip.cpp b/src/ip.cpp index 5016da5bbd..1aaf6ad6b1 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -565,7 +565,11 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_) goto try_tcpip; } - create_ipc_wildcard_address (dirname, filename); + rc = create_ipc_wildcard_address (dirname, filename); + ...
[ "src/ip.cpp" ]
[]
true
zeromq/libzmq
4,706
issue_to_patch
Fix CMake-generated `libzmq.pc` file
This PR mirrors the Autotools-based build system behavior for cross-compiling for Windows with static linking: https://github.com/zeromq/libzmq/blob/ee29bcd64ac257e3e8c20ffa0fe8093f697fe429/configure.ac#L365 and properly populates the `Libs.private` section in the CMake-generated `libzmq.pc` file. Addresses the ...
4c6cff63910891b079f688b321a647bc11f7fe55
d5c3bc42b2352f853d6d7a15cfe41b8610e6872a
diff --git a/CMakeLists.txt b/CMakeLists.txt index 36f4876901..5ad2cc106f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -567,12 +567,18 @@ if(ZMQ_HAVE_WINDOWS) # Cannot use check_library_exists because the symbol is always declared as char(*)(void) set(CMAKE_REQUIRED_LIBRARIES "ws2_32.lib") check_cxx_sym...
[ "CMakeLists.txt" ]
[ { "comment": "Should probably be done in the Windows block above, where the other checks for the same libs are being done?", "path": "CMakeLists.txt", "hunk": "@@ -585,7 +585,9 @@ else()\n check_cxx_symbol_exists(SO_BUSY_POLL sys/socket.h ZMQ_HAVE_BUSY_POLL)\n endif()\n \n-if(NOT MINGW)\n+if(MINGW)", ...
true
zeromq/libzmq
4,706
comment_to_fix
Fix CMake-generated `libzmq.pc` file
Should probably be done in the Windows block above, where the other checks for the same libs are being done?
4c6cff63910891b079f688b321a647bc11f7fe55
d5c3bc42b2352f853d6d7a15cfe41b8610e6872a
diff --git a/CMakeLists.txt b/CMakeLists.txt index 36f4876901..5ad2cc106f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -567,12 +567,18 @@ if(ZMQ_HAVE_WINDOWS) # Cannot use check_library_exists because the symbol is always declared as char(*)(void) set(CMAKE_REQUIRED_LIBRARIES "ws2_32.lib") check_cxx_sym...
[ "CMakeLists.txt" ]
[ { "comment": "Should probably be done in the Windows block above, where the other checks for the same libs are being done?", "path": "CMakeLists.txt", "hunk": "@@ -585,7 +585,9 @@ else()\n check_cxx_symbol_exists(SO_BUSY_POLL sys/socket.h ZMQ_HAVE_BUSY_POLL)\n endif()\n \n-if(NOT MINGW)\n+if(MINGW)", ...
true
zeromq/libzmq
4,726
issue_to_patch
CI build android on ubuntu-latest failed # Issue description ## Error logs: ld.lld: error: non-exported symbol '__aeabi_ldivmod' in '/usr/local/lib/android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-arm-android.a(aeabi_ldivmod.S.o)' is referenced by DSO 's...
Problem: CI build android on ubuntu-latest failed
Solution: Fixed the NDK version to android-ndk-r25 to avoid using unsupported NDK version on ubuntu-latest. Fixes #4725
b71434140e8ed40b1840a5704370bfc8dfdbf627
57490aee686d8315d5ea6f75151b5418288b0a9c
diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index f0cb245b76..a5946e6a9d 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -34,6 +34,7 @@ jobs: POLLER: poll - os: ubuntu-latest BUILD_TYPE: android + NDK_VERSION: android-ndk-r...
[ ".github/workflows/CI.yaml" ]
[]
true
zeromq/libzmq
4,724
issue_to_patch
Build fails on Win-On-ARM when compiled with gcc/clang # Issue description ``` 6.703 /50-libzmq/src/clock.cpp:251:48: error: use of undeclared identifier 'nsecs_per_usec'; did you mean 'usecs_per_sec'? 6.703 251 | return static_cast<uint64_t> (ts.tv_sec) * nsecs_per_usec * usecs_per_sec 6.705 | ...
Fix reading cycle count on non-msvc win-on-aarch64
This closes #4723 This seems fairly portable across all aarch64 systems, be it Windows or Linux. The arm 32bit intrinsic seems to be Microsoft-Specific, so I don't know how to implement this for arm32. I don't think either gcc or clang support 32bit arm Windows though, so at least the issue with the undefined va...
b95d94935ed107679fd0ad9efd2f3d47309b6fd3
fda851c8e52dd969b5c1c442c464d97edbe78259
diff --git a/src/clock.cpp b/src/clock.cpp index fc2151f63b..eeb7a68167 100644 --- a/src/clock.cpp +++ b/src/clock.cpp @@ -223,6 +223,10 @@ uint64_t zmq::clock_t::rdtsc () ((13 & 15) << 3) | // crm ((0 & 7) << 0)); // op2 return _ReadStatusReg (...
[ "src/clock.cpp" ]
[]
true
zeromq/libzmq
4,721
issue_to_patch
Issue with ZMQ_RECONNECT_STOP_AFTER_DISCONNECT option # Issue description The description of `ZMQ_RECONNECT_STOP_AFTER_DISCONNECT` in the zeromq documentation is: The 'ZMQ_RECONNECT_STOP_AFTER_DISCONNECT' option will stop reconnection when zmq_disconnect() has been called. This can be useful when the user's request...
Fix issue with ZMQ_RECONNECT_STOP_AFTER_DISCONNECT option
Solution: Specify `_disconnected` as `false` in initialize list to solve this problem, and add tests to cover this scenario. Fixed #4720
b95d94935ed107679fd0ad9efd2f3d47309b6fd3
ce17349f8bafcf3f73061f7297a18613c0ee7d3f
diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 5a9adcdeea..c76ff98d97 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -228,7 +228,8 @@ zmq::socket_base_t::socket_base_t (ctx_t *parent_, _monitor_events (0), _thread_safe (thread_safe_), _reaper_signaler (NULL), - _monitor_sy...
[ "src/socket_base.cpp", "tests/test_reconnect_options.cpp" ]
[]
diff --git a/tests/test_reconnect_options.cpp b/tests/test_reconnect_options.cpp index af34934b72..43d8cc5afb 100644 --- a/tests/test_reconnect_options.cpp +++ b/tests/test_reconnect_options.cpp @@ -246,6 +246,46 @@ void reconnect_stop_on_handshake_failed () } #endif +#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ...
true
zeromq/libzmq
4,717
issue_to_patch
CI build macos-latest with libsodium compilation failed # Issue description CXX unittests/unittest_curve_encoding-unittest_curve_encoding.o In file included from ../../unittests/unittest_curve_encoding.cpp:10: ../../src/curve_mechanism_base.hpp:9:10: fatal error: 'sodium.h' file not found CXXLD unittes...
Problem: macos-latest with libsodium compilation failed
Solution: Add libsodium dependencies to Makefile.am file. Fixes #4716
59c91227b46b60b7f965816544b25fe0a3cc8bbe
65d294679c46106da31d665bff0277d78e4a5af5
diff --git a/Makefile.am b/Makefile.am index 6d7085af36..19aa168096 100755 --- a/Makefile.am +++ b/Makefile.am @@ -1418,6 +1418,11 @@ unittests_unittest_curve_encoding_LDADD = \ $(top_builddir)/src/.libs/libzmq.a \ ${src_libzmq_la_LIBADD} \ $(CODE_COVERAGE_LDFLAGS) + +if USE_LIBSODIUM +unitt...
[ "Makefile.am" ]
[]
true
zeromq/libzmq
4,711
issue_to_patch
use proper STREQUAL instead of EQUAL to compare strings
ee29bcd64ac257e3e8c20ffa0fe8093f697fe429
55bd6b3df06734730d3012c17bc26681e25b549d
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f3a64a8a8..36f4876901 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -492,7 +492,7 @@ execute_process( if(CACHELINE_SIZE STREQUAL "" OR CACHELINE_SIZE EQUAL 0 OR CACHELINE_SIZE EQUAL -1 - OR CACHELINE_SIZE EQUAL "undefined") + OR CACHELINE_SIZE STREQ...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,702
issue_to_patch
problem: trying to link against librt on macOS
Solution: don't use `rt` if not `RT_LIBRARY` This currently causes the check to fail on macOS: ```bash /Library/Developer/CommandLineTools/usr/bin/c++ -std=c++11 -Wno-tautological-constant-compare -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad...
de290e91e3dbadfc6797ae5435e71046c2361077
e6a0e69e26d5ab82d7d515e1b3244dc5bdb5b430
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1859493835..6dcec7df36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -589,6 +589,12 @@ if(NOT MINGW) find_library(RT_LIBRARY rt) if(RT_LIBRARY) set(pkg_config_libs_private "${pkg_config_libs_private} -lrt") + + set(CMAKE_REQUIRED_LIBRARIES rt) + ...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,699
issue_to_patch
problem: using `-errwarn` on non-Sun systems
solution: only use `-errwarn` on SunPro systems For example, using Clang on Alpine, this just results in build spam, and the option is incorrectly passed through to `ld`, which trys to use it (`-e`) as an entrypoint, i.e: ```bash cmake -B build -DLIBZMQ_WERROR=ON ... [ 28%] Building CXX object CMakeFiles/local_l...
c2fae81460d9d39a896da7b3f72484d23a172fa7
2f30fc5b14759e823615babdafaa186eb9dbf107
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1859493835..b16bdb803c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -705,7 +705,7 @@ if(LIBZMQ_WERROR) zmq_check_cxx_flag_prepend("/WX") else() zmq_check_cxx_flag_prepend("-Werror") - if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if(${CM...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,701
issue_to_patch
Problem: macos-latest CIs both failing
Solution: Install `libtool`. This seems to be the issue, given the CI output of a recent run, i.e: ```bash configure.ac:1023: the top level configure.ac:80: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf docu...
c2fae81460d9d39a896da7b3f72484d23a172fa7
84d8eff11594222f9c0e063880bd31fdb445b59b
diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index e4ffffb2ce..f0cb245b76 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -112,11 +112,11 @@ jobs: CXX: clang++ - os: macos-latest BUILD_TYPE: default - PACKAGES: automake auto...
[ ".github/workflows/CI.yaml" ]
[]
true
zeromq/libzmq
4,688
issue_to_patch
Problem: my name is not in the AUTHORS file
Solution: add myself to the list
0a1aa1e4a770944cfa6ab842071a7637a0aa1e38
246c9cc286867a34bd9c6753429cfec42e56af31
diff --git a/AUTHORS b/AUTHORS index 87c0b0ca93..dc1667e342 100644 --- a/AUTHORS +++ b/AUTHORS @@ -120,6 +120,7 @@ Toralf Wittner Tore Halvorsen Trevor Bernard Vitaly Mayatskikh +Yacheng Zhou Credits =======
[ "AUTHORS" ]
[]
true
zeromq/libzmq
2,852
issue_to_patch
Problem: Debian packages are missing zmq.hpp
Solution: install it if available. Download it from its repo as part of the OBS source run. Debian and Ubuntu always ship zmq.hpp in libzmq-dev, so do the same. In the RPM world it is in its own separate package, so don't do the same for RPM.
fcacb603d6fb48d2a67ec5b6dfc6ca16e11cd6b6
83c042ccda60cc94a6ad07a38fd8eb0e6dc12375
diff --git a/packaging/debian/rules b/packaging/debian/rules index 56d499e605..c7fbe670df 100755 --- a/packaging/debian/rules +++ b/packaging/debian/rules @@ -52,6 +52,12 @@ else endif endif +override_dh_auto_install: + dh_auto_install +ifneq ("$(wildcard debian/zmq.hpp)","") + cp $(CURDIR)/debian/zmq.hpp $(CURDIR)...
[ "packaging/debian/rules", "packaging/obs/_service" ]
[]
true
zeromq/libzmq
4,685
issue_to_patch
Fix typos in gssapi cmake support PR
43a8b3c6c800b3c234ddc18180a59892b9f3a57d
adc122aea02af510bd787d5c1d6d7d6c719b3557
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 6f835122e9..64198eebd3 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -44,7 +44,7 @@ foreach(test ${unittests}) endif() if (WITH_GSSAPI_KRB5) - target_link_libraries(${static} ${GSSAPI_KRB5_LIBRARIES}) + target...
[ "tests/CMakeLists.txt", "unittests/CMakeLists.txt" ]
[]
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fa462becbe..a8dfa8f2a4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -289,7 +289,7 @@ foreach(test ${tests}) endif() if (WITH_GSSAPI_KRB5) - target_link_libraries(${static} ${GSSAPI_KRB5_LIBRARIES}) + target_link_libraries(${...
true
zeromq/libzmq
4,684
issue_to_patch
Add gssapi support to cmake
aa885c5a154256612108636b0fb22f44ae0e247a
3ec2dcc70d96fab0f67ca14904853fc49d52c503
diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index dd6af6666f..e4ffffb2ce 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -55,6 +55,13 @@ jobs: DRAFT: enabled PACKAGES: cmake libsodium-dev TLS: enabled + - os: ubuntu-latest ...
[ ".github/workflows/CI.yaml", "CMakeLists.txt", "builds/cmake/Modules/Findgssapi_krb5.cmake", "builds/cmake/ci_build.sh", "builds/cmake/platform.hpp.in", "tests/CMakeLists.txt", "unittests/CMakeLists.txt" ]
[]
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d342202986..fa462becbe 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -288,6 +288,10 @@ foreach(test ${tests}) target_link_libraries(${test} ${RT_LIBRARY}) endif() + if (WITH_GSSAPI_KRB5) + target_link_libraries(${static} ${GS...
true
zeromq/libzmq
4,670
issue_to_patch
cmake: don't use builtin sha1 if not using ws
The builtin SHA1 (`ZMQ_USE_BUILTIN_SHA1`) is only used in the websocket engine (`ws_engine.cpp`), so if websockets are disabled, i.e `-DENABLE_DRAFTS=OFF`, don't add `sha1.c` to the sources list.
4a5ece54b8ce0d3408e4d302b8a64b2a5aaa19cf
180ce55ef9766515b35f806885fe22fdb8e412f5
diff --git a/CMakeLists.txt b/CMakeLists.txt index 200a82e5fa..6b62cc1ec3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,7 @@ if(NOT ZMQ_USE_GNUTLS) endif() endif() endif() - if(NOT ZMQ_USE_NSS) + if(ENABLE_WS AND NOT ZMQ_USE_NSS) list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/ex...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,668
issue_to_patch
build: fix mkdtemp check on macOS
On macOS, mkdtemp is in `unistd.h`. Fix the CMake check so that is works. This was discovered when comparing the output of the Autotools an CMake build systems.
45b2924a0aa969ab51d1733e84ad892867580708
e6d53c53c9b89ae4d35a2ba038380a7c6f228e6c
diff --git a/CMakeLists.txt b/CMakeLists.txt index c124a6a4a6..200a82e5fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -605,7 +605,7 @@ if(NOT MSVC) check_cxx_symbol_exists(fork unistd.h HAVE_FORK) check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME) - check_cxx_symbol_exists(mkdtemp stdlib.h HA...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,667
issue_to_patch
Fix Autotools-generated `libzmq.pc` file
On the master branch @ 481cc3fa2c4414e407d863b4428f1efd5441e97d, cross-compiling for Windows with static linking fails when relying on the `libzmq.pc` file. Consider the minimum reproducible `zmq_win_demo.cpp` source file: ``` $ cat zmq_win_demo.cpp #include <zmq.h> int main() { auto ctx = zmq_ctx_new(); ...
481cc3fa2c4414e407d863b4428f1efd5441e97d
5bd0b91a64b4acacb210d91ee297e775fdc58737
diff --git a/configure.ac b/configure.ac index e181d63332..7832edab99 100644 --- a/configure.ac +++ b/configure.ac @@ -362,7 +362,7 @@ case "${host_os}" in if test "x$enable_static" = "xyes"; then CPPFLAGS="-DZMQ_STATIC $CPPFLAGS" - PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -liphlpapi...
[ "configure.ac" ]
[]
true
zeromq/libzmq
4,663
issue_to_patch
halt build if CURVE requested but not found
Problem: It's frustrating to attempt to build libzmq with curve, only to find out _after build has completed_ that it wasn't found and the request was ignored. Solution: respect user input and fail if their choice cannot be satisfied instead of ignoring it. now builds where requested configuration is not found fa...
ff231d267370493814f933d151441866bf1e200b
6af5a2379d70a7ca3afa887984b87747b0ec6307
diff --git a/CMakeLists.txt b/CMakeLists.txt index 814d5d4606..c124a6a4a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,12 +258,13 @@ endif() # Select curve encryption library, defaults to disabled To use libsodium instead, use --with-libsodium(must be # installed) To disable curve, use --disable-curve -...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,659
issue_to_patch
Problem: cmake search for kqueue missing headers
Result: on some BSD platforms (at least openbsd 7.4), cmake build will default to POLLER=poll instead of POLLER=kqueue. Solution: include sys/types.h and sys/time.h as [documented by kqueue](https://man.openbsd.org/kqueue.2) and [used in autotools](https://github.com/zeromq/libzmq/blob/3b264019a24b08246e8a75f5014f89...
3b264019a24b08246e8a75f5014f893d7b6ffef9
f9a798c9fb26124206ae2a3e72225f6d9dd8c646
diff --git a/CMakeLists.txt b/CMakeLists.txt index f956f3fd93..814d5d4606 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,7 +380,7 @@ endif(WIN32) if(NOT MSVC) if(POLLER STREQUAL "") - check_cxx_symbol_exists(kqueue sys/event.h HAVE_KQUEUE) + check_cxx_symbol_exists(kqueue "sys/types.h;sys/event.h;...
[ "CMakeLists.txt" ]
[]
true
zeromq/libzmq
4,600
issue_to_patch
Fix zmq_proxy_steerable
Continuing Brett's work on zmq_proxy_steerable here: https://github.com/zeromq/libzmq/pull/4598 2 problems addressed (split into 2 commits): 1. PAUSE/RESUME commands were seemingly mixed up and the test didn't cover it. 2. The reimplementation changed behaviour by always replying for the simple commands PAUSE, RES...
9d31965548b5c734f1edc01742c39f984e9cedd8
058ad60b9a5b9dae444279bc5cee6d040b0b08d7
diff --git a/doc/zmq_proxy_steerable.txt b/doc/zmq_proxy_steerable.txt index c5c0f661cf..23081fa9c2 100644 --- a/doc/zmq_proxy_steerable.txt +++ b/doc/zmq_proxy_steerable.txt @@ -19,21 +19,21 @@ The _zmq_proxy_steerable()_ function is a variant of the _zmq_proxy()_ function. It accepts a fourth _control_ socket. When...
[ "doc/zmq_proxy_steerable.txt", "src/proxy.cpp", "tests/test_proxy_steerable.cpp" ]
[]
diff --git a/tests/test_proxy_steerable.cpp b/tests/test_proxy_steerable.cpp index 68de26c12c..14092df185 100644 --- a/tests/test_proxy_steerable.cpp +++ b/tests/test_proxy_steerable.cpp @@ -5,6 +5,7 @@ #include <stdlib.h> #include <string.h> +#include <inttypes.h> #define CONTENT_SIZE 13 #define CONTENT_SIZE_M...
true
zeromq/libzmq
4,651
issue_to_patch
configure: fix basic syntax errors in the shell script programming language
There is no such thing as `+=` unless you happen to be using the Bash programming language, i.e. your script shebang is /bin/bash. However, configure scripts are run via /bin/sh instead, which may or may not be be bash, usually depending on whether the system in question preferred to have one less package installed ...
959a133520dfc80d29e83aa7ef762e1d0327f63b
e6809a6d0e486c0c37ca49958e7f90c83be76fde
diff --git a/configure.ac b/configure.ac index ffcc145b9f..e181d63332 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}" # Checks for programs. AC_PROG_CC -AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=" -std=c11 -D_DEFAULT_SOURCE"], [AC_PROG_CC_C99]) +AX_CHECK_COMPILE...
[ "configure.ac" ]
[]
true
zeromq/libzmq
4,647
issue_to_patch
Segfault near socket close using zmq_socket_monitor_pipes_stats # Issue description Segfault involving: https://github.com/zeromq/libzmq/blob/bd6fa4bbb3ec775d6ff9df0e1bb3174254daffa4/src/object.cpp#L111 near a socket close. Potentially related issue: https://github.com/zeromq/libzmq/issues/3446 # Environment *...
Fixing SEGV #4524. Pipe should only send to peer when active.
When socket monitoring is active a segmentation fault can occur when the pipepair has entered the mutual termination procedure. When this process is ongoing the pipe should not send or request any stats to or from the pipepair, because the pipepair could already be deleted. The conditions and the occurance of the SEGV ...
86a42e1e4379120db7d6dcddaead86b82505b0dd
be88154297ddda650c52a77c1b32970b9c4f2749
diff --git a/src/pipe.cpp b/src/pipe.cpp index 20caf5baca..181fe87832 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -539,7 +539,8 @@ bool zmq::pipe_t::check_hwm () const void zmq::pipe_t::send_hwms_to_peer (int inhwm_, int outhwm_) { - send_pipe_hwm (_peer, inhwm_, outhwm_); + if (_state == active) + ...
[ "src/pipe.cpp" ]
[]
true
zeromq/libzmq
4,642
issue_to_patch
Using non-ASCII characters in Unix domain socket paths doesn't work on Windows platform When using socket paths containing non-ASCII characters (i.e. Cyrillic) in `ipc://` socket paths, the socket opening may fail. This seems to happen because Windows expects UDS paths encoded in `utf-8`, however 'narrow' versions ...
Non-ASCII characters support in ipc:// socket paths
Problem: Using non-ascii characters in unix domain socket path doesn't work on Windows. Solution: Convert utf-8 socket paths to utf-16 file names when using filesystem calls to delete files and directories as Windows doesn't have any filesystem calls that take utf-8 path. rmdir_utf8() and unlink_utf8() static fun...
665d1d46576f9a4eff6fa42a11c54f23b6b11803
6a407135fd06c67757dd91eaaf4bee76c9a231c0
diff --git a/src/ip.cpp b/src/ip.cpp index 98804e8c6c..5016da5bbd 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -27,8 +27,8 @@ #include <direct.h> -#define rmdir _rmdir -#define unlink _unlink +#define rmdir rmdir_utf8 +#define unlink unlink_utf8 #endif #if defined ZMQ_HAVE_OPENVMS || defined ZMQ_HAVE_VXWORKS di...
[ "src/ip.cpp", "src/ipc_listener.cpp", "src/windows.hpp" ]
[ { "comment": "Consider: replace with std::wstring result, use result.resize(utf16_length), and &result[0] as dest address, then return that string. The vector is superfluous. Example:\r\n\r\n```\r\nstatic std::wstring ToUtf16 (_In_z_ const char *str)\r\n{\r\n std::wstring retVal;\r\n\r\n if (str && *str) ...
true
zeromq/libzmq
4,631
issue_to_patch
Replace old website contribution page link with the page of the new website
Problem: all doc pages are pointing to the old wiki website "how to contribute" Solution: mass-replace all docs with the link to the updated page in the new website
b268effd886c9ea45f8a6f37f8d62b4bb045ad37
0a496f70cd1da134aec6d8fb810487407364916c
diff --git a/doc/zmq.adoc b/doc/zmq.adoc index 146e3c9f37..f728654c1d 100644 --- a/doc/zmq.adoc +++ b/doc/zmq.adoc @@ -254,7 +254,7 @@ members of the 0MQ community and pointers can be found on the 0MQ website. == AUTHORS This page was written by the 0MQ community. To make a change please -read the 0MQ Contribution ...
[ "doc/zmq.adoc", "doc/zmq_atomic_counter_dec.adoc", "doc/zmq_atomic_counter_destroy.adoc", "doc/zmq_atomic_counter_inc.adoc", "doc/zmq_atomic_counter_new.adoc", "doc/zmq_atomic_counter_set.adoc", "doc/zmq_atomic_counter_value.adoc", "doc/zmq_bind.adoc", "doc/zmq_close.adoc", "doc/zmq_connect.adoc",...
[]
true
zeromq/libzmq
4,630
issue_to_patch
endpoint.hpp throws a compiler warning due to `const bool` return https://github.com/zeromq/libzmq/blame/814dab58a4eea3202d28d7db4fa24c27287c5378/src/endpoint.hpp#L32 Since bool is returned by value, the `const` is redundant and will throw an `ignored-qualifier` warning with clang: ``` [build] build/host/_deps/...
Fix 4629 compile warning in endpoint.hpp
Removes unused qualifier `const` from function returning a bool.
814dab58a4eea3202d28d7db4fa24c27287c5378
a589dbaf77cfa3d14513c95893f22bccba62e700
diff --git a/src/endpoint.hpp b/src/endpoint.hpp index 8727ae5c44..3bfa2415ea 100644 --- a/src/endpoint.hpp +++ b/src/endpoint.hpp @@ -29,7 +29,7 @@ struct endpoint_uri_pair_t return local_type == endpoint_type_bind ? local : remote; } - const bool clash () const { return local == remote; } + bool...
[ "src/endpoint.hpp" ]
[]
true
zeromq/libzmq
4,628
issue_to_patch
Documentation: fix the HTMLZIP name to restore the download-documentation functionality
* fix the HTMLZIP name to restore the download-documentation functionality
61050beca6bb4a18d7f73641e010bb21afb20fdd
7aa68511e1f54384c79bf10073130c0cca4ad8e8
diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 590ce5b06c..e38258c800 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -33,5 +33,6 @@ build: # ------------ # Note that for usability we make sure zip will create a zipfile containing just a flat list of HTML files; # to achieve that it'...
[ ".readthedocs.yaml" ]
[]
true
zhayujie/CowAgent
2,891
issue_to_patch
- Auto-scan roles/*.json on startup and merge into built-in roles
- Same title overrides built-in role; different title appends as new - roles/ directory is optional — no impact when absent Users can now add custom roles by simply dropping a .json file into the roles/ directory and restarting. No config changes needed. <!-- Thanks for your contribution! Please wr...
c9c293f67c63c081c9cc7daf47a87e3483dbf7b1
583c1de5baa704f6ae6a9c6dd1bf2f31ee2d3625
diff --git a/plugins/role/README.md b/plugins/role/README.md index f53e9575f2..25f7640c39 100644 --- a/plugins/role/README.md +++ b/plugins/role/README.md @@ -4,19 +4,41 @@ - `$角色/$role <角色名>` - 让AI扮演该角色,角色名支持模糊匹配。 - `$停止扮演` - 停止角色扮演。 -添加自定义角色请在`roles/roles.json`中添加。 +## 目录结构 + +``` +plugins/role/ +├── README.md +├...
[ "plugins/role/README.md", "plugins/role/role.py" ]
[]
true
zhayujie/CowAgent
2,888
issue_to_patch
fix: avoid KeyError on /cancel and infinite loop in image compression
Two small, independent robustness fixes found while reading the channel/util code. ## 1. `KeyError` in `cancel_session` / `cancel_all_session` `channel/chat_channel.py` keeps two parallel dicts: - `self.sessions[session_id]` is created in **`produce()`** when a message arrives. - `self.futures[session_id]` is create...
6fb19a68b5ee812ee70065a94fd61982ff41c522
ad64e17a345826140be844f81a90967a28ffbed9
diff --git a/channel/chat_channel.py b/channel/chat_channel.py index 9104a38e3..e2a65c5b6 100644 --- a/channel/chat_channel.py +++ b/channel/chat_channel.py @@ -519,7 +519,10 @@ def consume(self): def cancel_session(self, session_id): with self.lock: if session_id in self.sessions: - ...
[ "channel/chat_channel.py", "common/utils.py", "tests/test_robustness_fixes.py" ]
[]
diff --git a/tests/test_robustness_fixes.py b/tests/test_robustness_fixes.py new file mode 100644 index 000000000..9f8aa453c --- /dev/null +++ b/tests/test_robustness_fixes.py @@ -0,0 +1,121 @@ +# encoding:utf-8 +""" +Unit tests for robustness fixes: + 1. ChatChannel.cancel_session / cancel_all_session must not raise ...
true
zhayujie/CowAgent
2,879
issue_to_patch
feat: stream Bash progress and guard message actions during replies
## What does this PR do? This PR adds bounded streaming progress for long-running Bash tool executions in the web console and prevents message edit/delete operations while the current session is generating a reply. Key improvements: - Long-running Bash commands now show recent output snapshots in the existing ...
63bfab03f68a5e39b0e0ffedd8e09267615f4254
9387980e74ae31a209ad1b1170b70492dddcf091
diff --git a/.github/workflows/test-windows-bash.yml b/.github/workflows/test-windows-bash.yml new file mode 100644 index 0000000000..4a39dbe64c --- /dev/null +++ b/.github/workflows/test-windows-bash.yml @@ -0,0 +1,32 @@ +name: Windows Bash Streaming Tests + +on: + workflow_dispatch: + pull_request: + paths: + ...
[ ".github/workflows/test-windows-bash.yml", "agent/protocol/agent_stream.py", "agent/tools/base_tool.py", "agent/tools/bash/bash.py", "channel/web/static/css/console.css", "channel/web/static/js/console.js", "channel/web/web_channel.py", "tests/test_bash_streaming.py" ]
[]
diff --git a/tests/test_bash_streaming.py b/tests/test_bash_streaming.py new file mode 100644 index 0000000000..ff3d3591f5 --- /dev/null +++ b/tests/test_bash_streaming.py @@ -0,0 +1,185 @@ +import subprocess +import sys +import time +from unittest.mock import patch + +import pytest + +from agent.tools.bash.bash import...
true
zhayujie/CowAgent
2,877
issue_to_patch
建议“模型管理”中的“添加厂商”功能中能添加多个“自定义”厂商 ### ⚠️ 搜索是否存在类似issue - [x] 我已经搜索过issues和disscussions,没有发现相似issue ### 总结 现在添加厂商时只有“自定义”和各个大模型的官方接口,没有硅基流动、七牛云等第三方提供商,且“自定义”接口只能添加一个,所以应该允许用户设置多个“自定义”接口。 ### 举例 _No response_ ### 动机 _No response_
feat(web): manage multiple custom (OpenAI-compatible) providers in console UI
## What & Why Closes #2838. Currently the web console only lets you configure **one** custom OpenAI-compatible endpoint. Many users run several at once (SiliconFlow, DeepSeek, Moonshot, a local vLLM/Ollama box, ...) and want to switch between them without editing `config.json` by hand. This PR adds first-class, full...
f5caba81d62645c6d11306f4e5ddec32dda52294
0092376c07129de4b353400a0b59b32e0f699b1a
diff --git a/channel/web/chat.html b/channel/web/chat.html index 4f527bb40a..0b71d745a3 100644 --- a/channel/web/chat.html +++ b/channel/web/chat.html @@ -1165,6 +1165,72 @@ <h3 id="vendor-modal-title" class="font-semibold text-slate-800 dark:text-slate- </div> </div> + <!-- Custom Provider Modal (mu...
[ "channel/web/chat.html", "channel/web/static/js/console.js", "channel/web/web_channel.py", "config.py", "docs/ja/models/custom.mdx", "docs/models/custom.mdx", "docs/zh/models/custom.mdx", "models/bot_factory.py", "models/chatgpt/chat_gpt_bot.py", "models/custom_provider.py", "tests/test_custom_p...
[]
diff --git a/tests/test_custom_provider.py b/tests/test_custom_provider.py new file mode 100644 index 0000000000..fcd5dcebec --- /dev/null +++ b/tests/test_custom_provider.py @@ -0,0 +1,240 @@ +# encoding:utf-8 +""" +Unit tests for multiple custom (OpenAI-compatible) provider support (issue #2838). + +Covers models/cus...
true
zhayujie/CowAgent
2,886
issue_to_patch
[Security] Authenticated cloud skill installation path traversal writes files outside the intended `skills/` root ### Advisory Details **Title**: Authenticated cloud skill installation path traversal writes files outside the intended `skills/` root **Description**: ### Summary CowAgent's cloud skill-management ins...
fix(security): SSRF protection for vision tool + path traversal guard for skill install
## Summary Two security fixes addressing reported vulnerabilities: ### 1. Vision Tool SSRF Protection (Closes #2878, Ref #2872) **Problem:** `Vision._download_to_data_url()` performs `requests.get(url)` on attacker-controlled image URLs without any pre-fetch validation. This allows probing of loopback services, RFC1...
f5caba81d62645c6d11306f4e5ddec32dda52294
e85290cddcbb5ffc9c235927f4c92e5b4c3ec264
diff --git a/agent/skills/service.py b/agent/skills/service.py index a34a546fa7..95cfb9bbab 100644 --- a/agent/skills/service.py +++ b/agent/skills/service.py @@ -34,6 +34,27 @@ def __init__(self, skill_manager: SkillManager): """ self.manager = skill_manager + def _safe_skill_dir(self, name: str...
[ "agent/skills/service.py", "agent/tools/vision/vision.py", "tests/test_security_ssrf_path_traversal.py" ]
[]
diff --git a/tests/test_security_ssrf_path_traversal.py b/tests/test_security_ssrf_path_traversal.py new file mode 100644 index 0000000000..6c2dbb09eb --- /dev/null +++ b/tests/test_security_ssrf_path_traversal.py @@ -0,0 +1,194 @@ +# encoding:utf-8 +""" +Unit tests for security fixes: + 1. Vision tool SSRF protection...
true