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

Resumbmit tar feedback changes, include Android build fix #69469

Merged
merged 15 commits into from
Jun 2, 2022

Conversation

carlossanlop
Copy link
Member

@carlossanlop carlossanlop commented May 18, 2022

Submitting the changes approved in this PR: #69107

Addresses: #68230

Include an extra commit addressing the android build failure: The method getgrgid_r is not recognized in Android API level < 24, so the build fails, causing widespread CI failures in PRs and in runtime-extra-platforms. The getgrgid_r method is consumed inside the new Tar APIs to retrieve the group name of the specified group Id. The code checks if getgrgid_r is not available, and then attempt to use getgrgid instead as the fallback, which is not thread-safe, but should be available in older Android API levels.

@ghost
Copy link

ghost commented May 18, 2022

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Submitting the changes approved in this PR: #69107

Addresses: #68230

Include an extra commit addressing the android build failure: The method getgrgid_r is not recognized in Android, so the build fails, causing widespread CI failures in PRs and in runtime-extra-platforms. The getgrgid_r method is consumed inside the new Tar APIs to retrieve the group name of the specified group Id.

An alternative fix would be to check if getgrgid_r is not available, and attempt to use getgrgid instead as the fallback, which is not thread-safe.

Author: carlossanlop
Assignees: carlossanlop
Labels:

area-System.IO

Milestone: 7.0.0

src/native/libs/Common/pal_config.h.in Show resolved Hide resolved
src/native/libs/System.Native/pal_uid.c Show resolved Hide resolved
src/native/libs/System.Native/pal_uid.c Outdated Show resolved Hide resolved
src/native/libs/configure.cmake Outdated Show resolved Hide resolved
@carlossanlop
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@carlossanlop
Copy link
Member Author

carlossanlop commented May 18, 2022

The tests that verify group name in the tar archives will fail in android, so I need to address that before merging.

Edit: As of the latest commit, this is no longer valid. The tests should pass in all platforms because those that don't support the _r method should fallback to the non-_r method.

@steveisok steveisok requested a review from akoeplinger May 18, 2022 01:35
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it LGTM, but we also need to disable the Android tests that are using the unavailable API

src/native/libs/configure.cmake Outdated Show resolved Hide resolved
@danmoseley
Copy link
Member

Does any mono code use getgrgid on Android ? (It should probably be fixed if it does)

@carlossanlop
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

eerhardt
eerhardt previously approved these changes May 18, 2022
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming CI is green. This looks good.

src/native/libs/System.Native/pal_uid.c Outdated Show resolved Hide resolved
@carlossanlop
Copy link
Member Author

carlossanlop commented May 19, 2022

I am 3 distinct tar tests failing in runtime-extra-platforms:

A) net7.0-windows-Release-x64-CoreCLR_release-(Windows.Server.Core.2004.Amd64.Open)windows.10.amd64.server20h2.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-amd64-20200904200251-272704c:

Unrelated to tar. The test successfully copies all the necessary assets, but then fails to establish communication with the docker container after starting it:

2022-05-18T23:39:18.468Z	INFO   	helixio(27)	copy_tree_to	Copying 'C:\h\w\AC8F09AE\w\B2C90998\u\unarchived\many_small_files\9\5.txt' to 'C:\h\w\AC8F09AE\w\B2C90998\e\unarchived\many_small_files\9\5.txt'
2022-05-18T23:39:18.468Z	INFO   	helixio(27)	copy_tree_to	Copying 'C:\h\w\AC8F09AE\w\B2C90998\u\unarchived\many_small_files\9\6.txt' to 'C:\h\w\AC8F09AE\w\B2C90998\e\unarchived\many_small_files\9\6.txt'
2022-05-18T23:39:18.484Z	INFO   	helixio(27)	copy_tree_to	Copying 'C:\h\w\AC8F09AE\w\B2C90998\u\unarchived\many_small_files\9\7.txt' to 'C:\h\w\AC8F09AE\w\B2C90998\e\unarchived\many_small_files\9\7.txt'
2022-05-18T23:39:18.484Z	INFO   	helixio(27)	copy_tree_to	Copying 'C:\h\w\AC8F09AE\w\B2C90998\u\unarchived\many_small_files\9\8.txt' to 'C:\h\w\AC8F09AE\w\B2C90998\e\unarchived\many_small_files\9\8.txt'
2022-05-18T23:39:18.484Z	INFO   	helixio(27)	copy_tree_to	Copying 'C:\h\w\AC8F09AE\w\B2C90998\u\unarchived\many_small_files\9\9.txt' to 'C:\h\w\AC8F09AE\w\B2C90998\e\unarchived\many_small_files\9\9.txt'
2022-05-18T23:39:18.484Z	INFO   	executor(112)	run	Successfully downloaded work item payload
2022-05-18T23:39:18.484Z	INFO   	interval(67)	set_abort_after_timer	Set the timer's abort_after to 960 seconds from now: abort_after = 2022-05-18 23:55:18.484122
2022-05-18T23:39:18.577Z	INFO   	dockerhelper(35)	cleanup	Cleaning up Docker on the machine
2022-05-18T23:39:18.591Z	INFO   	dockerhelper(52)	pull	Pulling image dotnet-buildtools/prereqs:windowsservercore-2004-helix-amd64-20200904200251-272704c from registry mcr.microsoft.com...
2022-05-18T23:39:18.685Z	INFO   	dockerhelper(69)	pull	Pull successful.
2022-05-18T23:39:18.686Z	INFO   	dockerhelper(274)	write_commands_to_file	Generating Docker execution script
2022-05-18T23:39:18.687Z	INFO   	dockerhelper(170)	run	Starting docker container...
2022-05-18T23:39:18.687Z	INFO   	interval(67)	set_abort_after_timer	Set the timer's abort_after to 960 seconds from now: abort_after = 2022-05-18 23:55:18.687487
2022-05-18T23:39:19.720Z	ERROR  	dockerhelper(233)	run	API Error attempting to talk to Docker Server:500 Server Error: Internal Server Error ("CreateComputeSystem 2f74ab29e29394d817342df0834252b05c973211c923f4625757ec064105b9aa: The container operating system does not match the host operating system.

B) net7.0-tvOSSimulator-Release-x64-Mono_Release-OSX.1015.Amd64.Open and
C) net7.0-iOSSimulator-Release-x64-Mono_Release-OSX.1015.Amd64.Open:

All the tests that call the new P/Invoke GetUserName are failing in tvOS and iOS with "No such file or directory" (does not say which errno). I cannot locally build for these platforms, so I'm going to assume we have a similar problem of not having the _r method available on the mobile device, so we need the fallback. I cannot find information that confirms the minimum version where this method is available, but I'll test it with a new commit. Interestingly, I found HAVE_GETPWUID_R checks in mono and coreclr.

Exception messages: System.IO.IOException : No such file or directory   Exception stack traces:    at Interop.Sys.GetUserName(UInt32 uid)
 at System.Formats.Tar.TarWriter.ReadFileFromDiskAndWriteToArchiveStreamAsEntry(String fullPath, String entryName)

@carlossanlop
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@carlossanlop
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical
Copy link
Member

radical commented May 31, 2022

@carlossanlop you can surface files to the wasm app by using <WasmFilesToIncludeInFileSystem Include="..." />. And TargetPath attribute to use a custom path for the wasm side.

@carlossanlop
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

This comment was marked as outdated.

@carlossanlop
Copy link
Member Author

@eerhardt as discussed offline, I removed any new changes related to Browser from this PR and I will address them separately in #69953

@radical thanks for your suggestion. I'll keep it in mind for the PR I will submit for #69953.

@eerhardt
Copy link
Member

I removed any new changes related to Browser from this PR

I'm still seeing "Browser" related changes in this PR. Specifically src\System.Formats.Tar.csproj

@carlossanlop
Copy link
Member Author

I see why. It was part of the previously approved PR. Fixed with the last commit.

@carlossanlop
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once my last 2 comments are resolved, this LGTM

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming CI passes, :shipit:

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

Successfully merging this pull request may close these issues.

10 participants