I've hit a problem with building go executables when `.gitignore` tup directive is active.
Specifically, it seems `go build` scans repository `.gitignore` files and thus tup considers them as inputs that should be declared.
Example
```
pmoore@Peters-MacBook-Pro:~/tmp $ ls
Tupfile Tupfile.ini go.mod main.go
pmoore@Peters-MacBook-Pro:~/tmp $ cat Tupfile
.gitignore
: |> go build -o %o |> hello-world
pmoore@Peters-MacBook-Pro:~/tmp $ cat Tupfile.ini
pmoore@Peters-MacBook-Pro:~/tmp $ cat go.mod
module
github.com/petemoore/tup-go-gitignorego 1.15
pmoore@Peters-MacBook-Pro:~/tmp $ cat main.go
package main
import "fmt"
func main() {
fmt.Println("Hello World")
}
pmoore@Peters-MacBook-Pro:~/tmp $
```
Without the `.gitignore` directive in Tupfile, all is ok. However, with it, we get:
```
* 0) go build -o hello-world
*** tup messages ***
tup error: Missing input dependency - a file was read from, and was not specified as an input link for the command. This is an issue because the file was created from another command, and without the input link the commands may execute out of order. You should add this file as an input, since it is possible this could randomly break in the future.
- [16] .gitignore
*** Command ran successfully, but failed due to errors processing input dependencies.
[ ] 100%
*** tup: 1 job failed.
```
If I now add `.gitignore` as an order-only input, i.e.
```
pmoore@Peters-MacBook-Pro:~/tmp $ cat Tupfile
.gitignore
: | .gitignore |> go build -o %o |> hello-world
```
then instead I get:
```
* 0) [0.001s] .
tup error: Explicitly named file '.gitignore' in subdir '.' is scheduled to be deleted (possibly the command that created it has been removed).
tup error: Error parsing Tupfile line 2
Line was: ': .gitignore |> go build -o %o |> hello-world'
[ ] 100%
*** tup: 1 job failed.
```
I'm not sure there is a way to prevent `go build` from scanning `.gitignore` files in the repo, so I'm not sure how to overcome this. Any ideas?
Many thanks!
Pete
P.S. I'm aware I could manage the .gitignore file myself, but as of go 1.17, it seems `go build` will scan all .gitignore files in the entire repo, and that then means I would have to manage the .gitignore file in all directories of my repo, which wouldn't be practical. So at the moment I'm stuck with go1.16 which only seems to only scans the .gitignore file of the directory the `go build` is issued in (or the go package(s) that are being built).