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

AppleAppBuilder doesn't embed test data from subdirectories #52104

Closed
filipnavara opened this issue Apr 30, 2021 · 5 comments · Fixed by #52372
Closed

AppleAppBuilder doesn't embed test data from subdirectories #52104

filipnavara opened this issue Apr 30, 2021 · 5 comments · Fixed by #52372
Assignees
Milestone

Comments

@filipnavara
Copy link
Member

Some test assemblies rely on test data being compiled into the published app. One example is System.Security.Cryptography.X509Certificates which copies several test certificates into the TestData directory.

AppleAppBuilder currently doesn't copy these data into the app bundle so the tests fail to find the data.

Notably, this code doesn't list files in subdirectories:

string[] resources = Directory.GetFiles(workspace)
.Where(f => !excludes.Any(e => f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase)))
.Concat(Directory.GetFiles(binDir, "*.aotdata"))
.ToArray();

Fixing that is relatively easy but CMake still flattens out the resource structure in the output Xcode project.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Security untriaged New issue has not been triaged by the area owner labels Apr 30, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks
See info in area-owners.md if you want to be subscribed.

Issue Details

Some test assemblies rely on test data being compiled into the published app. One example is System.Security.Cryptography.X509Certificates which copies several test certificates into the TestData directory.

AppleAppBuilder currently doesn't copy these data into the app bundle so the tests fail to find the data.

Notably, this code doesn't list files in subdirectories:

string[] resources = Directory.GetFiles(workspace)
.Where(f => !excludes.Any(e => f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase)))
.Concat(Directory.GetFiles(binDir, "*.aotdata"))
.ToArray();

Fixing that is relatively easy but CMake still flattens out the resource structure in the output Xcode project.

Author: filipnavara
Assignees: -
Labels:

area-System.Security, untriaged

Milestone: -

@ghost
Copy link

ghost commented Apr 30, 2021

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

Some test assemblies rely on test data being compiled into the published app. One example is System.Security.Cryptography.X509Certificates which copies several test certificates into the TestData directory.

AppleAppBuilder currently doesn't copy these data into the app bundle so the tests fail to find the data.

Notably, this code doesn't list files in subdirectories:

string[] resources = Directory.GetFiles(workspace)
.Where(f => !excludes.Any(e => f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase)))
.Concat(Directory.GetFiles(binDir, "*.aotdata"))
.ToArray();

Fixing that is relatively easy but CMake still flattens out the resource structure in the output Xcode project.

Author: filipnavara
Assignees: -
Labels:

area-Infrastructure-mono, untriaged

Milestone: -

@directhex
Copy link
Contributor

As best I can determine, CMake isn't entirely to blame here. Xcode flattens all file references in Resources. If you want a directory structure, you need a folder reference, which is handled differently (and obviously means we can't filter the files the way we do in xcode.cs)

Will run some experiments

@directhex
Copy link
Contributor

OK, I've determined that RESOURCE in cmakelists always takes the flattening approach. It seems there's a slightly different MACOSX_PACKAGE_LOCATION which works with subdirectories. Gotta get the syntax right...

@directhex
Copy link
Contributor

Xcode is cursed

@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label May 5, 2021
@ViktorHofer ViktorHofer added this to the 6.0.0 milestone May 5, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 6, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 6, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants