Skip to content

Disambiguate PIF target names #3716

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

Merged
merged 2 commits into from
Sep 10, 2021
Merged

Conversation

neonichu
Copy link
Contributor

@neonichu neonichu commented Sep 3, 2021

A product can have the same name as a target in SwiftPM, but since we create a PIF target for each, we need to come up with a unique name for products.

rdar://82744792

@neonichu
Copy link
Contributor Author

neonichu commented Sep 3, 2021

@swift-ci please smoke test

@neonichu
Copy link
Contributor Author

neonichu commented Sep 3, 2021

We may need to transform argument values for cases where the user uses --product $NAME, but I first wanna see if more tests need adjustments and running them locally is pretty slow.

@neonichu
Copy link
Contributor Author

neonichu commented Sep 7, 2021

The tests need adjustments for this change:

/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-main/swiftpm/Tests/XCBuildSupportTests/PIFBuilderTests.swift:444: error: -[XCBuildSupportTests.PIFBuilderTests testExecutableProducts] : XCTAssertEqual failed: ("foo_1EF26F7F_PackageProduct") is not equal to ("foo")

@neonichu neonichu force-pushed the fix-ambigious-targets-in-xcbuild-support branch from 6ea42fa to a72dcb8 Compare September 7, 2021 21:50
@neonichu
Copy link
Contributor Author

neonichu commented Sep 7, 2021

@swift-ci please smoke test

@neonichu
Copy link
Contributor Author

neonichu commented Sep 8, 2021

A couple of the integration tests are still failing.

@neonichu
Copy link
Contributor Author

neonichu commented Sep 8, 2021

The odd thing is that locally, these tests seem to be passing 🤔

@neonichu
Copy link
Contributor Author

neonichu commented Sep 8, 2021

The odd thing is that locally, these tests seem to be passing 🤔

Oh, that's because I have been running them incorrectly. What I did was use the inferior swift-test, but since the tests themselves shell out, they were still using the superior swift-test to actually perform the test.

@neonichu
Copy link
Contributor Author

neonichu commented Sep 8, 2021

Looks like the problem here are the tests themselves? They try to refer to products using --target, but I guess we also need a way to translate the value of --product to its mangled name in the PIF.

There's also a potentially interesting concern of us not generating a PIF target for executable targets, but only for their products, so --target won't work for building an executable target since it won't be represented in the PIF at all.

A product can have the same name as a target in SwiftPM, but since we create a PIF target for each, we need to come up with a unique name for products.

rdar://82744792
@neonichu neonichu force-pushed the fix-ambigious-targets-in-xcbuild-support branch from a72dcb8 to f1b8083 Compare September 9, 2021 19:46
@neonichu
Copy link
Contributor Author

neonichu commented Sep 9, 2021

@swift-ci please smoke test

@neonichu neonichu merged commit 9180312 into main Sep 10, 2021
@neonichu neonichu deleted the fix-ambigious-targets-in-xcbuild-support branch September 10, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants