Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
glumia opened this issue Nov 30, 2021 · 2 comments
Closed

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

glumia opened this issue Nov 30, 2021 · 2 comments
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.

Comments

@glumia
Copy link

glumia commented Nov 30, 2021

  • 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.

@andreynering andreynering added bug dep: mvdan/sh Issues related to the upstream interpreter used by Task. labels Nov 30, 2021
@andreynering
Copy link
Member

andreynering commented Nov 30, 2021

Hi @glumia, thanks for opening this issue!

I reported this upstream at mvdan/sh#768.

@andreynering
Copy link
Member

A new release with the fix was just published: https://github.com/go-task/task/releases/tag/v3.9.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.
Projects
None yet
Development

No branches or pull requests

3 participants