Skip to content

Conversation

andreynering
Copy link
Member

@SheGe
Copy link

SheGe commented May 27, 2025

Test results: #2199 (comment)

@noahfraiture
Copy link

The problem persist. I use task to run my webserver

  build:
    desc: Build the Go binary
    cmd: go build -o ./tmp/main ./cmd/nexzap/main.go
    deps:
      - templ
      - sqlc
      - tailwind
    sources:
      - ./go.mod
      - ./go.sum
      - ./cmd/**/*.go
      - ./internal/**/*.go
      - ./templates/**/*_templ.go
      - ./static/css/style.css
      - ./internal/db/migrations/*.sql
      - ./tutorials/**/*
    generates:
      - ./tmp/main

  run:
    desc: Run the built binary
    deps:
      - build
    cmd: ./tmp/main
    ```
    
that immediatly stop with the watch flag. Without it, it works fine

@andreynering
Copy link
Member Author

Hey @noahfraiture,

I could not reproduce.

  • Which operating system are you using?
  • Can you double-check that you're running a task binary built from this branch?
  • Or maybe could you create a minimal reproducible example?

@noahfraiture
Copy link

Hey @noahfraiture,

I could not reproduce.

* Which operating system are you using?

* Can you double-check that you're running a `task` binary built from this branch?

* Or maybe could you create a minimal reproducible example?

Sure, I have the same issue with this code

package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprint(w, "Pong")
	})
	addr := ":8080"
	log.Printf("Server starting on http://localhost%s", addr)
	http.ListenAndServe(addr, mux)
}

And this task

  run:
    cmd: go run .

I'm on Linux NixOs. I built the task binary from the branch watcher/fix-some-regressions-2202-2199

@andreynering andreynering force-pushed the watcher/fix-some-regressions-2202-2199 branch from de7ecf1 to 8d61133 Compare June 7, 2025 14:40
@andreynering andreynering force-pushed the watcher/fix-some-regressions-2202-2199 branch from 8d61133 to 02332bb Compare June 7, 2025 14:42
@andreynering
Copy link
Member Author

@noahfraiture I wasn't able to reproduce your issue and the program being killed right away, but after some testing I found some other issues related to the watcher.

For now, I'll merge this PR as is as it fixes a couple of issues, but I'll see what we can do from now on.

@andreynering andreynering merged commit 7782bc9 into main Jun 8, 2025
15 checks passed
@andreynering andreynering deleted the watcher/fix-some-regressions-2202-2199 branch June 8, 2025 22:44
@noahfraiture
Copy link

@noahfraiture I wasn't able to reproduce your issue and the program being killed right away, but after some testing I found some other issues related to the watcher.

For now, I'll merge this PR as is as it fixes a couple of issues, but I'll see what we can do from now on.

I seems to be fixed for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: watcher Changes related to the Taskfile watcher.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watch sends interrupt signal right away in v3.43.x Running task with dependencies in watch mode stopped watching for sources of dependencies
3 participants