You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to tar files on a windows 11 machine but keep getting errors.
Even with the most minimal tar I keep get errors about Rel: can't make <whatever file> relative to
Create the provided taskfile in an empty directory and call it Taskfile.yml
When I do this in a directory called D:\taskfile-uroot and run task I get...
task: [default] tar -cf test.tar Taskfile.yml
task: Failed to run task "default": Rel: can't make D:\taskfile-uroot\Taskfile.yml relative to
What I expect to get is a file called test.tar containing the taskfile.
Version
3.45.5
Operating system
Windows 11 Pro 24H2
Experiments Enabled
No response
Example Taskfile
# https://taskfile.devversion: '3'tasks:
default:
cmds:
- tar -cf test.tar Taskfile.yml
This is, I think, a problem with some internal path handling. For example, this:
- tar -cf test.tar {{.USER_WORKING_DIR}}/Taskfile.yml
results in this error
task: Failed to run task "default": GetFileAttributesEx \\wsl.localhost\Ubuntu\home\trule\git\task\ISSUES\2259\wsl.localhostUbuntuhometrulegittask\Taskfile.yml: The system cannot find the path specified.
And there are several things wrong there ... but at least this part "wsl.localhostUbuntuhometrulegittask" is quite wrong.
// Resolve all input paths relative to working directory
resolvedArgs := make([]string, len(args))
for i, arg := range args {
resolvedArgs[i] = t.ResolvePath(arg)
}
this code actually resolves paths to absolute paths, not relative, and tar does not like that. Not sure the exact solution, because ResolvePath is also used to resolve absolute paths.
@andreynering the problem here is that tar wants paths which are relative to the working dir (or tar file actually), but the code above makes the paths absolute. Removing the call to ResolvePath() fixes the problem.
WDYT? I see you worked on that code somewhat recently.
Activity
trulede commentedon Dec 14, 2025
I was able to list the content of a tar file, but could not create one (same issue).
trulede commentedon Jan 6, 2026
This is, I think, a problem with some internal path handling. For example, this:
- tar -cf test.tar {{.USER_WORKING_DIR}}/Taskfile.ymlresults in this error
task: Failed to run task "default": GetFileAttributesEx \\wsl.localhost\Ubuntu\home\trule\git\task\ISSUES\2259\wsl.localhostUbuntuhometrulegittask\Taskfile.yml: The system cannot find the path specified.And there are several things wrong there ... but at least this part "wsl.localhostUbuntuhometrulegittask" is quite wrong.
trulede commentedon Jan 6, 2026
OK, the problem is here:
u-root/u-root/pkg/core/tar/tar.go
this code actually resolves paths to absolute paths, not relative, and tar does not like that. Not sure the exact solution, because ResolvePath is also used to resolve absolute paths.
trulede commentedon Jan 6, 2026
@andreynering the problem here is that tar wants paths which are relative to the working dir (or tar file actually), but the code above makes the paths absolute. Removing the call to ResolvePath() fixes the problem.
WDYT? I see you worked on that code somewhat recently.
andreynering commentedon Jan 6, 2026
@trulede Thank you for taking a look. I can eventually take a look, but probably not soon.
ggrothendieck commentedon May 10, 2026
One thing to be aware of is that tar.exe is also included and on your PATH with Windows itself. Try
where tar:kmpm commentedon May 10, 2026
@ggrothendieck, yeah I could also use make and makefile but task was supposed to be simpler 😅
trulede commentedon May 28, 2026
@kmpm These days CoPilot can write a Makefile or a Script, and they are pretty good.
There is a PR now in u-root/u-root#3606 which fixes the problem
Build command.
GOOS=windows GOARCH=amd64 go build -o task.exe ./cmd/taskvmaerten commentedon Nov 29, 2026
It'll be fixed in the next release (by #3107)