Skip to content

Conversation

@sbeu
Copy link
Contributor

@sbeu sbeu commented Apr 20, 2023

This PR fixes the handling of the environment variables under Windows in the case of the program being executed with an Azure Devops agent. The penv library (github.com/snakeice/penv) seems to not work in that scenario.

Typo on variable name (splitedPath)

Remove use of penv library (github.com/snakeice/penv) due to a bug when executed with an Azure Devops agent
@sbeu
Copy link
Contributor Author

sbeu commented Apr 20, 2023

Fixes #136
Only tested under Windows

@viniciussanchez viniciussanchez added the bug Something isn't working label Apr 20, 2023
@sbeu
Copy link
Contributor Author

sbeu commented Apr 24, 2023

@snakeice The bug only occurs when executed by an Azure Devops agent. I don't know exactly how it works, but my guess is that the current user has no PATH env variable, or something like that.

@viniciussanchez viniciussanchez merged commit 94ce8f6 into HashLoad:master Apr 24, 2023
@snakeice
Copy link
Member

Penv is used to set persistent environment, os.Setenv is runtime only.

We use persistent mode to have binary tools installed by the boss and global stuff mapped. I don't know the behavior removing this in general, maybe changing to warning the error already solves it.

@sbeu
Copy link
Contributor Author

sbeu commented Apr 24, 2023

To clarify:

  • Executing as a normal Windows user, in cmd: Everything works
  • Executing as Azure Devops agent: Boss does NOT raise any error or warning. Instead, it just hangs as soon as this line is executed:
    environment, e := penv.Load()

With the modifications I suggested, it works. But I did not test 100%.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants