1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

chore: update blog post date

This commit is contained in:
Pete Davison
2025-09-15 12:16:51 +00:00
parent cd8c831204
commit 092b9b6391
2 changed files with 64 additions and 65 deletions

View File

@@ -6,7 +6,7 @@ description: Latest news and updates from the Task team
<BlogPost <BlogPost
title="Announcing Built-in Core Utilities for Windows" title="Announcing Built-in Core Utilities for Windows"
url="/blog/windows-core-utils" url="/blog/windows-core-utils"
date="2025-08-26" date="2025-09-15"
author="andreynering" author="andreynering"
description="When I started Task back in 2017, one of my biggest goals was to build a task runner that would work well on all major platforms, including Windows. At the time, I was using Windows as my main platform, and it caught my attention how much of a pain it was to get a working version of Make on Windows, for example." description="When I started Task back in 2017, one of my biggest goals was to build a task runner that would work well on all major platforms, including Windows. At the time, I was using Windows as my main platform, and it caught my attention how much of a pain it was to get a working version of Make on Windows, for example."
:tags="['windows', 'core-utils']" :tags="['windows', 'core-utils']"

View File

@@ -1,8 +1,8 @@
--- ---
title: "Announcing Built-in Core Utilities for Windows" title: 'Announcing Built-in Core Utilities for Windows'
description: The journey of enhancing Windows support in Task. description: The journey of enhancing Windows support in Task.
author: andreynering author: andreynering
date: 2025-08-26 date: 2025-09-15
outline: deep outline: deep
--- ---
@@ -11,42 +11,39 @@ outline: deep
<AuthorCard :author="$frontmatter.author" /> <AuthorCard :author="$frontmatter.author" />
When I started Task back in 2017, one of my biggest goals was to build a task When I started Task back in 2017, one of my biggest goals was to build a task
runner that would work well on all major platforms, including Windows. runner that would work well on all major platforms, including Windows. At the
At the time, I was using Windows as my main platform, and it caught my attention time, I was using Windows as my main platform, and it caught my attention how
how much of a pain it was to get a working version of Make on Windows, for much of a pain it was to get a working version of Make on Windows, for example.
example.
## The very beginning ## The very beginning
The very first versions, which looked very prototyp-ish, already supported The very first versions, which looked very prototyp-ish, already supported
Windows, but it was falling back to Command Prompt (`cmd.exe`) to run commands Windows, but it was falling back to Command Prompt (`cmd.exe`) to run commands
if `bash` wasn't available in the system. That didn't mean you couldn't run if `bash` wasn't available in the system. That didn't mean you couldn't run Bash
Bash commands on Windows necessarily, because if you used Task inside Git Bash, commands on Windows necessarily, because if you used Task inside Git Bash, it
it would expose `bash.exe` into your `$PATH`, which made possible for Task to would expose `bash.exe` into your `$PATH`, which made possible for Task to use
use it. Outside of it, you would be out of luck, though, because running on it. Outside of it, you would be out of luck, though, because running on Command
Command Prompt meant that the commands wouldn't be really compatible. Prompt meant that the commands wouldn't be really compatible.
## Adopting a shell interpreter ## Adopting a shell interpreter
I didn't take too much time to discover that there was I didn't take too much time to discover that there was [a shell interpreter for
[a shell interpreter for Go that was very solid][mvdan], and I quickly adopted Go that was very solid][mvdan], and I quickly adopted it to ensure we would be
it to ensure we would be able to run commands with consistency across all able to run commands with consistency across all platforms. It was fun because
platforms. It was fun because once adopted, I had the opportunity to once adopted, I had the opportunity to [make some contributions to make it more
[make some contributions to make it more stable][mvdan-prs], which I'm sure the stable][mvdan-prs], which I'm sure the author appreciated.
author appreciated.
## The lack of core utilities ## The lack of core utilities
There was one important thing missing, though. If you needed to use any core There was one important thing missing, though. If you needed to use any core
utilities on Windows, like copying files with `cp`, moving with `mv`, creating utilities on Windows, like copying files with `cp`, moving with `mv`, creating a
a directory with `mkdir -p`, that likely would just fail :boom:. directory with `mkdir -p`, that likely would just fail :boom:. There were
There were workarounds, of course. You could run `task` inside Git Bash which workarounds, of course. You could run `task` inside Git Bash which exposed core
exposed core utils in `$PATH` for you, or you could install these core utils utils in `$PATH` for you, or you could install these core utils manually (there
manually (there are a good number of alternative implementations available are a good number of alternative implementations available for download).
for download).
That was still far from ideal, though. One of my biggest goals with Task is that it That was still far from ideal, though. One of my biggest goals with Task is that
should "just work", even on Windows. Requiring additional setup to make it should "just work", even on Windows. Requiring additional setup to make
things work is exactly what I wanted to avoid. things work is exactly what I wanted to avoid.
## They finally arrive! ## They finally arrive!
@@ -55,21 +52,21 @@ And here we are, in 2025, 8 years after the initial release. We might be late,
but I'm happy nonetheless. From now on, the following core utilities will be but I'm happy nonetheless. From now on, the following core utilities will be
available on Windows. This is the start. We want to add more with time. available on Windows. This is the start. We want to add more with time.
* `base64` - `base64`
* `cat` - `cat`
* `chmod` - `chmod`
* `cp` - `cp`
* `find` - `find`
* `gzip` - `gzip`
* `ls` - `ls`
* `mkdir` - `mkdir`
* `mktemp` - `mktemp`
* `mv` - `mv`
* `rm` - `rm`
* `shasum` - `shasum`
* `tar` - `tar`
* `touch` - `touch`
* `xargs` - `xargs`
## How we made this possible ## How we made this possible
@@ -78,24 +75,23 @@ projects.
### u-root/u-root ### u-root/u-root
We are using the core utilities implementations in Go from the We are using the core utilities implementations in Go from the [u-root][u-root]
[u-root][u-root] project. It wasn't as simple as it sounds because they have project. It wasn't as simple as it sounds because they have originally
originally implemented every core util as a standalone `main` package, which implemented every core util as a standalone `main` package, which means we
means we couldn't just import and use them as libraries. We had some discussion couldn't just import and use them as libraries. We had some discussion and we
and we agreed on a common [interface][uroot-interface] and agreed on a common [interface][uroot-interface] and [base
[base implementation][uroot-base]. Then, I refactored one-by-one of the core implementation][uroot-base]. Then, I refactored one-by-one of the core utils in
utils in the list above. This is the reason we don't have all of them: there are the list above. This is the reason we don't have all of them: there are too
too many! But the good news is that we can refactor more with time and include many! But the good news is that we can refactor more with time and include them
them in Task. in Task.
### mvdan/sh ### mvdan/sh
The other collaboration was with the maintainer of the shell interpreter. The other collaboration was with the maintainer of the shell interpreter. He
He agreed on having [an official middleware][middleware] to expose these core agreed on having [an official middleware][middleware] to expose these core
utilities. utilities. This means that other projects that use the shell interpreter can
This means that other projects that use the shell interpreter can also benefit also benefit from this work, and as more utilities are included, those projects
from this work, and as more utilities are included, those projects will benefit will benefit as well.
as well.
## Can I choose whether to use them or not? ## Can I choose whether to use them or not?
@@ -112,25 +108,28 @@ env TASK_CORE_UTILS=1 task ...
env TASK_CORE_UTILS=0 task ... env TASK_CORE_UTILS=0 task ...
``` ```
We'll consider making this enabled by default on all platforms in the future. We'll consider making this enabled by default on all platforms in the future. In
In the meantime, we're still using the system core utils on non-Windows the meantime, we're still using the system core utils on non-Windows platforms
platforms to avoid regressions as the Go implementations may not be 100% to avoid regressions as the Go implementations may not be 100% compatible with
compatible with the system ones. the system ones.
## Feedback ## Feedback
If you have any feedback about this feature, join our [Discord server][discord] If you have any feedback about this feature, join our [Discord server][discord]
or [open an issue][gh-issue] on GitHub. or [open an issue][gh-issue] on GitHub.
Also, if Task is useful for you or your company, consider Also, if Task is useful for you or your company, consider [sponsoring the
[sponsoring the project][sponsor]! project][sponsor]!
[mvdan]: https://github.com/mvdan/sh [mvdan]: https://github.com/mvdan/sh
[mvdan-prs]: https://github.com/mvdan/sh/pulls?q=is%3Apr+author%3Aandreynering+is%3Aclosed+sort%3Acreated-asc [mvdan-prs]:
https://github.com/mvdan/sh/pulls?q=is%3Apr+author%3Aandreynering+is%3Aclosed+sort%3Acreated-asc
[u-root]: https://github.com/u-root/u-root [u-root]: https://github.com/u-root/u-root
[uroot-interface]: https://github.com/u-root/u-root/blob/main/pkg/core/command.go [uroot-interface]:
https://github.com/u-root/u-root/blob/main/pkg/core/command.go
[uroot-base]: https://github.com/u-root/u-root/blob/main/pkg/core/base.go [uroot-base]: https://github.com/u-root/u-root/blob/main/pkg/core/base.go
[middleware]: https://github.com/mvdan/sh/blob/master/moreinterp/coreutils/coreutils.go [middleware]:
https://github.com/mvdan/sh/blob/master/moreinterp/coreutils/coreutils.go
[task-core-utils]: /docs/reference/environment#task-core-utils [task-core-utils]: /docs/reference/environment#task-core-utils
[discord]: https://discord.com/invite/6TY36E39UK [discord]: https://discord.com/invite/6TY36E39UK
[gh-issue]: https://github.com/go-task/task/issues [gh-issue]: https://github.com/go-task/task/issues