zjncs opened a new issue, #5617:
URL: https://github.com/apache/rocketmq-dashboard/issues/5617

   ## Description
   
   `cataloggen`'s freshness gate compares the on-disk generated catalog 
byte-for-byte (`rmqctl/internal/catalog/generate/main.go:829`):
   
   ```go
   if !bytes.Equal(actual, expected) {
       return fmt.Errorf("%s is stale; run make catalog-generate", outputPath)
   }
   ```
   
   `go/format.Source` always emits LF, but the repo has no `.gitattributes`, 
and Git for Windows' **installer-default `core.autocrlf=true`** smudges every 
checked-out file to CRLF. On a fresh Windows clone the on-disk `catalog_gen.go` 
is CRLF while `expected` is LF, so `bytes.Equal` fails although the catalog is 
current.
   
   Demonstrated on unmodified master: `go run ./generate -input-dir 
../../../server/src/main/resources/tool-catalog/tools -output catalog_gen.go 
-check` → `cataloggen: catalog_gen.go is stale; run make catalog-generate` 
(exit 1), while a programmatic comparison proved the working-tree file (42516 
bytes, 770 CRLF lines) and the generated output (41746 bytes, LF) are 
**byte-identical after EOL normalization**. The digest itself is 
EOL-independent (verified: LF-normalized shards produce the identical committed 
digest), so only the verify comparison is broken.
   
   ## Impact
   
   The `make catalog-verify` gate (run by CI's `rmqctl-test` job as 
`catalog-verify`) is permanently red on default Windows checkouts, and 
`catalog-generate` needlessly rewrites the file — flipping its working-tree 
EOLs and creating spurious diffs. Same applies to the `-markdown`/`-sdk` 
outputs. The project explicitly targets Windows (`build-windows.ps1`, windows 
in `build-all`), and the packaging scripts' sibling CRLF bug was just fixed in 
#5602.
   
   ## Expected behavior
   
   Compare line-ending-insensitively (strip CR from CRLF pairs on both sides 
before `bytes.Equal`); real staleness is still rejected.
   
   ## Environment
   
   - branch: master (0228dad5)
   - file: `rmqctl/internal/catalog/generate/main.go` (`verify`, ~824-833)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to