Skip to content
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

Failed to run go build task, env var is not taking into account #22930

Closed
tolusha opened this issue Apr 18, 2024 · 0 comments
Closed

Failed to run go build task, env var is not taking into account #22930

tolusha opened this issue Apr 18, 2024 · 0 comments
Assignees
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. team/A This team is responsible for the Che Operator and all its operands as well as chectl and Hosted Che team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.

Comments

@tolusha
Copy link
Contributor

tolusha commented Apr 18, 2024

Describe the bug

Failed to run go build task from the devfile below:

schemaVersion: 2.2.0
metadata:
  name: go
starterProjects:
  - name: go-starter
    description: A Go project with a simple HTTP server
    git:
      checkoutFrom:
        revision: main
      remotes:
        origin: https://github.com/devfile-samples/devfile-stack-go.git
components:
  - container:
      image: registry.access.redhat.com/ubi9/go-toolset:1.19.13-4.1697647145
      args: ["tail", "-f", "/dev/null"]
      memoryLimit: 1024Mi
      mountSources: true
    name: runtime
commands:
  - exec:
      env:
        - name: GOPATH
          value: /projects/go-starter/.go
        - name: GOCACHE
          value: /projects/go-stater/.cache
      commandLine: echo "GOCACHE=$GOCACHE" && go build main.go
      component: runtime
      group:
        isDefault: true
        kind: build
      workingDir: /projects/go-starter
    id: build

The output:

 *  Executing task: devfile: build 

GOCACHE=/projects/go-stater/.cache
failed to initialize build cache at /opt/app-root/src/.cache/go-build: mkdir /opt/app-root/src/.cache: permission denied

 *  The terminal process failed to launch (exit code: 1). 

Meanwhile, this commands runs successfully:
commandLine: echo "GOCACHE=$GOCACHE" && export GOCACHE=/projects/go-stater/.cache && go build main.go

Che version

next (development version)

Steps to reproduce

  1. Create a workspace from the devfile above
  2. Run build task

Expected behavior

Command run successfully

Runtime

OpenShift

Screenshots

No response

Installation method

chectl/next

Environment

Linux

Eclipse Che Logs

No response

Additional context

No response

@tolusha tolusha added kind/bug Outline of a bug - must adhere to the bug report template. area/editor/vscode Issues related to the Code OSS editor of Che team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs. labels Apr 18, 2024
@svor svor added severity/P1 Has a major impact to usage or development of the system. team/A This team is responsible for the Che Operator and all its operands as well as chectl and Hosted Che labels Apr 18, 2024
@vitaliy-guliy vitaliy-guliy self-assigned this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. team/A This team is responsible for the Che Operator and all its operands as well as chectl and Hosted Che team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants