Closed drewcrawford closed 8 years ago
I currently work around with this patch.
It's obviously not a proper solution but it does let me build again with Docker.
Hmm "Jeff" might not be a good default return value here; perhaps "" or "unknown" etc might be a bit more appropriate and less confusing. We may want to also consider reducing the unit test scope for non TTY enabled sessions and skip certain tests when that is the case
Comment by Eugene Gubin (JIRA)
https://github.com/apple/swift-corelibs-foundation/pull/206 I made some improvements. Mentioned workaround in place. I think PR should be tested with and without it.
I think this is resolved in PR #206, now merged. Thanks Eugene Gubin (JIRA User)!
Tested by me
Environment
Linux x86_64 (glibc) swift-2.2-SNAPSHOT-2015-12-31-aAdditional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Foundation | |Labels | Bug | |Assignee | Eugene Gubin (JIRA) | |Priority | Medium | md5: e1a9699af115cfcb14b4871015c130aeIssue Description:
This is a bug in swift-corelibs-foundation; it's a regression new in the dec-31 snapshot. You cannot run buildbot_linux without a TTY attached (for example, in a Docker container).
The root cause is the implementation of NSUserName, which is exercised in a test suite and will crash without a TTY.
The actual root cause is that getlogin(_r) does not work without a TTY due to a glibc bug.
According to the the manpage, getlogin_r call can fail if:
It goes on to explain:
This glibc bug occurs in real-world scenarios:
1. This call is exercised in a test that runs under buildbot_linux
The bug can be reproduced (although it takes awhile) on any system with Docker installed by creating a file called 'Dockerfile' with the following contents and then running "docker build ."
This produces a "fatalError - could not get login name" with errno ENOTTY.
It's not immediately clear how to fix this so I'm pinging the implementor of NSUserName.