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

bal dist pull command is not working properly in github actions on centos #218

Open
NipunaMadhushan opened this issue Feb 10, 2022 · 1 comment
Labels

Comments

@NipunaMadhushan
Copy link
Contributor

NipunaMadhushan commented Feb 10, 2022

Description:
When we are using bal dist pull <dist-version> or bal dist use <dist-version>, the ballerina version won't be changed.

This will only happen in github actions and it works fine in centos virtual environments.

Steps to reproduce:
Install ballerina by the installer on centos container in github actions and use bal dist pull <other-ballerina-version>.
It will show as the version has been changed to .
Then run bal -v command and you will be able to see the previously installed version as ballerina version.

Affected Versions:
All

OS, DB, other environment details and versions:
Centos in github actions

@NipunaMadhushan
Copy link
Contributor Author

While I was running update tool tests, I realised that the other operating systems (ubuntu/macos) has the same HOME env variable which is /home/runner and the USER env variable is runner. When we are using sudo command with bal dist pull, update tool will set the home path to /home/$USER since the HOME will give /root in root directory.
When we are switching the ballerina version in unix systems in github actions, update tool will ovewrite the ballerina-version file in /home/runner/.ballerina directory with new version.

But in centos container which is running on ubuntu runner, it has HOME env variable as /github/home and there is no env variable called USER. Therefore, When we use sudo command at the beginning of bal dist pull, it may be navigated to root and cannot set the path from /home/$USER/.ballerina since USER env variable is null. Then the home path set by update tool will be invalid and ballerina-version file cannot be overwritten by new version.

The issue might be because of we are using a centos container instead of centos runner in github actions.

In the update tool, it gets the path by HOME environment variable (basically $HOME/.ballerina). Since the path is different in centos container, it may be the issue.

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

No branches or pull requests

1 participant