Skip to content

cgo doesn't work on windows after upgrade to 3.9.1 #619

@glumia

Description

@glumia
  • Task version: 3.9.1
  • Operating System: windows

Additional requirements:

  • go
  • gcc

Minimal project to reproduce the issue:

.
├── greeting.h
├── main.go
└── Taskfile.yml

greeting.h:

#include <stdio.h>

void greeting() {
   printf("Hello, World!");
}

main.go:

package main

// #cgo CFLAGS: -g
// #include "greeting.h"
import (
	"C"
)

func main() {
	C.greeting()
}

Taskfile.yml:

version: '3'

tasks:
  greeting:
    cmds:
      - go run main.go

task greeting works perfectly fine with version 3.9.0 but fails on 3.9.1 with the following message:

task: [greeting] go run main.go
# command-line-arguments
cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%
task: Failed to run task "greeting": exit status 2

Related to arduino/arduino-cli#1576.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dep: mvdan/shIssues related to the upstream interpreter used by Task.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions