bazel-contrib / bazel-contrib/bazel-lib
copy_directory and copy_to_directory code needs fix before upgrade to go 1.23+
- Dominant language
- Starlark
- Stars
- 182
- Forks
- 134
- Avg merge
- 1d 46m
- Merged PRs (30d)
- 1
Description
When I attempt to upgrade to go 1.23+ I see the following errors on windows:
```
cd e2e\smoke
bazel test //...
```
```
ERROR: D:/workdir/github/peakschris/bazel-lib/e2e/smoke/BUILD.bazel:112:15: Copying directory d failed: (Exit 1): copy_directory.exe failed: error executing CopyDirectory command (from target //:copy_directory_mtime_case) bazel-out\x64_windows-opt-exec-ST-d57f47055a04\bin\external\aspect_bazel_lib+\tools\copy_directory\copy_directory_\copy_directory.exe d bazel-out/x64_windows-fastbuild/bin/copy_directory_mtime_out ... (remaining 1 argument skipped)
2025/08/15 07:03:38 d is not a regular file
walking bazel-out\x64_windows-fastbuild\bin\copy_directory_mtime_out
copying regular file: bazel-out\x64_windows-fastbuild\bin\copy_directory_mtime_out
```
The code in tools/common/copy.go is not identifying directories as such.
@fmeum tracked it down to possibly this: https://tip.golang.org/doc/go1.23#ospkgos
Contributor guide
Research direction
Start with tools/common/copy.go and the //:copy_directory_mtime_case target in e2e/smoke/BUILD.bazel. Run `cd e2e\smoke` followed by `bazel test //...` on Windows with Go 1.23 or newer, then trace why the directory is treated as a regular file. Done means the copy_directory test passes on the affected Go versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100