-
Notifications
You must be signed in to change notification settings - Fork 209
Fix remaining tests for Android #623
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
Conversation
lib/Basic/PlatformUtility.cpp
Outdated
char tmpDirPathBuf[] = "/tmp/fileXXXXXX"; | ||
char *tmpDirPathBuf = nullptr; | ||
if (const char *tmpDir = std::getenv("TMPDIR")) | ||
asprintf(&tmpDirPathBuf, "%s/fileXXXXXX", tmpDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The buffer allocated here needs to be free()
d before we return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
lib/Basic/PlatformUtility.cpp
Outdated
else | ||
tmpDirPath = "/tmp/fileXXXXXX"; | ||
auto tmpDirString = std::string(mkdtemp(tmpDirPath)); | ||
free(tmpDirPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 This may now attempt to free the inline "/tmp/fileXXXXXX"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this last iteration should finally work fine.
@swift-ci please smoke test |
Hmm, I didn't know if the PackageDescription version would make a difference like it did natively on Android, swiftlang/swift-package-manager#2466, guess it does so removed that Android addition for ncurses till the manifest version supports it. |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
Thanks, about the unit tests, I notice that |
Used to build and test llbuild and SPM natively on Android in the Termux app. I can modify lit.cfg to only check the
PREFIX
env var on Android if there's any worry that it might be spuriously set on other platforms.makeTmpDir
is only checked by the unit tests, which I noticed are not run by the CI anymore, maybe because those llbuild test binaries were moved around? I see the following warning on both the linux and mac CI for recent pulls:Running them manually shows that no tests fail after this pull on Android.