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

macOS images incorrectly set GOROOT #11331

Closed
7 of 16 tasks
dagood opened this issue Jan 8, 2025 · 3 comments
Closed
7 of 16 tasks

macOS images incorrectly set GOROOT #11331

dagood opened this issue Jan 8, 2025 · 3 comments

Comments

@dagood
Copy link

dagood commented Jan 8, 2025

Description

Borrowing title from:

The same logic applies for macOS. We just ran into the Go tip issue mentioned there:

The problem with hardcoding a GOROOT is that if any other go tool is in use (for example, because one compiled Go tip), the environment variable will override its autodetected GOROOT. The result is that the GOROOT and the go binary will mismatch, leading to obscure errors.

Specific example: trying to call the Go tip's go tool dist test makes Go complain that "dist" doesn't exist, because it's looking in the wrong GOROOT. dist doesn't exist for the preinstalled Go, but it does exist in the just-compiled Go tip.

As a workaround, explicitly unsetting GOROOT in our macOS CI fixes go tool dist test for a Go tip build.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022
  • Windows Server 2025

Image version and build link

Image: macos-14
Version: 20241216.504
https://dev.azure.com/dnceng-public/public/_build/results?buildId=910679&view=logs&j=1fc39dc4-3ae2-57e7-a254-ceccd9c00bb3&t=e8fde53a-663f-5432-3a67-c3eefd0bab24&l=137

Is it regression?

No

@prasanjitsahoo
Copy link
Contributor

HI @dagood , We will look into the issue and keep you posted with updates.

@prasanjitsahoo
Copy link
Contributor

Hi @dagood,

I wanted to clarify that we are not setting up any environment variables for GOROOT, as is typically done on Ubuntu or Windows systems. Could you please provide more details regarding this?

Additionally, we do not hard-code GOROOT, and none of the tools used during the image generation process set this variable either.

@dagood
Copy link
Author

dagood commented Jan 21, 2025

Ah, sorry, I missed that we have a GoTool@0 task in our pipeline. go isn't even in PATH by default! 😄

On that note, it looks like the GitHub Actions setup action handles GOROOT correctly: https://github.com/actions/setup-go/blob/f111f3307d8850f501ac008e886eec1fd1932a34/src/main.ts#L48-L52.

But at first glance, AzDO's task doesn't: https://github.com/microsoft/azure-pipelines-tasks/blob/a5d47e22d167382cf4c16460942cedddb010827a/Tasks/GoToolV0/gotool.ts#L108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants