Skip to content

When running with the interpreter on Darwin, force the usage of the just built, stdlib when running the frontend. #37771

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

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jun 3, 2021

This is because we currently JIT in process resulting in weirdness around
swift-frontend wanting to link against the host stdlib and the exec swift code
wanting to link against the target stdlib. For now, we work around this by just
saying in that case we will force swift-frontend to use the just built runtime
so we are consistent. The only potential problem is that a bug in the just built
runtime may now cause these tests to fail. But overall, that would suggest a
problem we may want to catch in it of itself, so the work around I think makes
sense until JITing is done in a separate process (which I think is the right fix).

rdar://78768013

@gottesmm gottesmm requested a review from lhames June 3, 2021 19:49
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

@swift-ci smoke test

@shahmishal
Copy link
Member

@swift-ci test Apple Silicon

@gottesmm gottesmm force-pushed the pr-68240f777a82206ee3ac630da53e83f266bb4f48 branch from 5db9c9d to c88b6c8 Compare June 3, 2021 20:06
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

Discovered an interpreter test that did not use target-jit-run (where the fix is).

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

@swift-ci test Apple Silicon

@gottesmm gottesmm force-pushed the pr-68240f777a82206ee3ac630da53e83f266bb4f48 branch 2 times, most recently from 0c982f2 to d2491b5 Compare June 3, 2021 21:01
@gottesmm gottesmm requested a review from benlangmuir June 3, 2021 21:01
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

@swift-ci test apple silicon

…ust built, stdlib when running the frontend.

This is because we currently JIT in process resulting in weirdness around
swift-frontend wanting to link against the host stdlib and the exec swift code
wanting to link against the target stdlib. For now, we work around this by just
saying in that case we will force swift-frontend to use the just built runtime
so we are consistent. The only potential problem is that a bug in the just built
runtime may now cause these tests to fail. But overall, that would suggest a
problem we may want to catch in it of itself, so the work around I think makes
sense until JITing is done in a separate process (which I think is the right fix).

rdar://78768013
@gottesmm gottesmm force-pushed the pr-68240f777a82206ee3ac630da53e83f266bb4f48 branch from d2491b5 to 524c5e0 Compare June 3, 2021 22:08
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

@swift-ci test apple silicon

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

@swift-ci test

Copy link
Contributor

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

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

Two comments, but if the tests pass then feel free to merge as-is.

// RUN: %target-jit-run -interpret %s | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %target-jit-run -interpret %s -Onone -g | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %target-jit-run -interpret %s -Onone -g -- | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %target-jit-run -interpret %s -Onone -g -- a b c | %FileCheck %s -check-prefix=CHECK-THREE
Copy link
Contributor

Choose a reason for hiding this comment

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

These can drop -interpret

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Touche.

@@ -1891,6 +1885,17 @@ if not kIsWindows:
"SIMCTL_CHILD_DYLD_LIBRARY_PATH='{0}' " # Simulator option
.format(all_stdlib_path, libdispatch_path)) + config.target_run

subst_target_jit_prefix = ""
if platform.system() == 'Darwin' and config.target_run:
Copy link
Contributor

Choose a reason for hiding this comment

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

At one point you had a big comment about why this was needed; it would be nice to resurrect that.

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 3, 2021

I'll fix both of these once it lands.

@gottesmm gottesmm merged commit 94eaed5 into swiftlang:main Jun 4, 2021
@gottesmm gottesmm deleted the pr-68240f777a82206ee3ac630da53e83f266bb4f48 branch June 4, 2021 02:09
gottesmm added a commit to gottesmm/swift that referenced this pull request Jun 6, 2021
gottesmm added a commit that referenced this pull request Jun 9, 2021
…bd410a6b620245

Fixes in response to feedback on #37771.
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.

4 participants