Open danwt opened 4 years ago
Looks like we are hitting this check failure:
Key build_username is of invalid type 0
That in turn seems to be prepared here: https://github.com/yugabyte/yugabyte-db/blob/9fa72cd3048bacf35bc8aab7191a702ed0a6271b/build-support/gen_version_info.py#L138
Is it possible that in the docker on Mac environment, the os.getenv("USER") doesn't return a user name string?
That's indeed the case
[root@1364d3aaf253 yugabyte-db]# python
Python 2.7.5 (default, Apr 2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getenv("USER")==None
True
>>>
@danwt --
Possible workarounds in the interim:
1) Perhaps before running the compilation command do a:
export USER=danwt
2) In your local copy of
You can add something like this after the above lines:
if username==None:
username="none"
@mbautin -- if (2) seems reasonable, we could probably even request @danwt to submit a PR for the same that we can then merge?
Hi @danwt, thanks a lot for reporting this issue! Perhaps we could use getpass.getuser()
if the USER
environment variable is not set:
if username is None:
username = getpass.getuser()
And add import getpass
at the top of the script.
Please feel free to submit a pull request with this fix.
(Relevant link: https://stackoverflow.com/questions/842059/is-there-a-portable-way-to-get-the-current-username-in-python)
Thanks for your help!
Jira Link: DB-4889 I'm trying to build and run tests for the first time and had a test fail. My environment is inside a Centos7 docker container with a volume forwarded from MacOS Catalina 10.15.5. I'm using Docker with 8GB memory and used the following setup.
Then saved the image
Create container with volume forwarded
The build reaches 99% and then
Thank you.