Skip to content

[Backtracing] Add support for building target executables into libexec. #63978

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 3 commits into from
Mar 1, 2023

Conversation

al45tair
Copy link
Contributor

We're going to add a program, swift-backtrace, that gets built alongside the stdlib and the runtime, and that needs to be installed in libexec/swift alongside the libraries in lib/swift.

It wants to be built with the stdlib/runtime because there's an internal interface between swift-backtrace and the runtime, so the program needs to stay in lock-step with the runtime library.

rdar://105390807

We're going to add a program, `swift-backtrace`, that gets built alongside the
stdlib and the runtime, and that needs to be installed in libexec/swift
alongside the libraries in lib/swift.

It wants to be built with the stdlib/runtime because there's an internal
interface between `swift-backtrace` and the runtime, so the program needs to
stay in lock-step with the runtime library.

rdar://105390807

(This reverts commit f042ca0.)
… targets.

I missed off an `${sdk}` in the target name for the lipo'd output :-(

rdar://105390807
`THIN_INPUT_TARGETS` needed to be reset per-sdk, not just once.

rdar://105390807
@al45tair
Copy link
Contributor Author

al45tair commented Mar 1, 2023

@swift-ci Please test

@al45tair
Copy link
Contributor Author

al45tair commented Mar 1, 2023

The original attempt at this was #63650. Unfortunately there were a couple of bugs that caused the build to fail if we were building for more than one SDK at once, so that one got reverted.

@al45tair al45tair requested a review from MaxDesiatov March 1, 2023 13:05
@al45tair
Copy link
Contributor Author

al45tair commented Mar 1, 2023

69ef2e7 was previously approved as #63650.

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Overall LGTM, but IMO there are a few places that could benefit from added comments that explain the context for these changes.

@al45tair al45tair merged commit 9e3c89d into swiftlang:main Mar 1, 2023
@compnerd
Copy link
Member

compnerd commented Mar 1, 2023

I think that this inadvertently is impacting the Windows builds:

FAILED: bin/swift-reflection-test-windows-x86_64.exe 
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=stdlib\tools\swift-reflection-test\CMakeFiles\swift-reflection-test-windows-x86_64.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- D:\a\swift-build\swift-build\BuildRoot\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lld-link.exe /nologo stdlib\tools\swift-reflection-test\CMakeFiles\swift-reflection-test-windows-x86_64.dir\swift-reflection-test.c.obj stdlib\tools\swift-reflection-test\CMakeFiles\swift-reflection-test-windows-x86_64.dir\overrides.c.obj  /out:bin\swift-reflection-test-windows-x86_64.exe /implib:lib\swift-reflection-test-windows-x86_64.lib /pdb:bin\swift-reflection-test-windows-x86_64.pdb /version:0.0 /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console -LIBPATH:D:\a\swift-build\swift-build\BinaryCache\llvm\.\lib   -LIBPATH:D:\a\swift-build\swift-build\BinaryCache\swift\.\lib\swift\windows   -LIBPATH:C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\Lib\x64   -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100226~1.0\ucrt\x64   -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100226~1.0\um\x64   -LIBPATH:D:\a\swift-build\swift-build\BinaryCache\swift\winsdk_lib_x86_64_symlinks lib\swift\windows\x86_64\swiftRemoteMirror.lib  lib\swift\windows\x86_64\swiftRemoteInspection.lib  swiftRemoteMirror.lib  swiftRemoteInspection.lib  lib\swift\windows\x86_64\swiftSwiftOnoneSupport.lib  lib\swift\windows\x86_64\swiftCore.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "D:\a\swift-build\swift-build\BuildRoot\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lld-link.exe /nologo stdlib\tools\swift-reflection-test\CMakeFiles\swift-reflection-test-windows-x86_64.dir\swift-reflection-test.c.obj stdlib\tools\swift-reflection-test\CMakeFiles\swift-reflection-test-windows-x86_64.dir\overrides.c.obj /out:bin\swift-reflection-test-windows-x86_64.exe /implib:lib\swift-reflection-test-windows-x86_64.lib /pdb:bin\swift-reflection-test-windows-x86_64.pdb /version:0.0 /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console -LIBPATH:D:\a\swift-build\swift-build\BinaryCache\llvm\.\lib -LIBPATH:D:\a\swift-build\swift-build\BinaryCache\swift\.\lib\swift\windows -LIBPATH:C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\Lib\x64 -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100226~1.0\ucrt\x64 -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100226~1.0\um\x64 -LIBPATH:D:\a\swift-build\swift-build\BinaryCache\swift\winsdk_lib_x86_64_symlinks lib\swift\windows\x86_64\swiftRemoteMirror.lib lib\swift\windows\x86_64\swiftRemoteInspection.lib swiftRemoteMirror.lib swiftRemoteInspection.lib lib\swift\windows\x86_64\swiftSwiftOnoneSupport.lib lib\swift\windows\x86_64\swiftCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:bin\swift-reflection-test-windows-x86_64.exe.manifest" failed (exit code 1) with the following output:
lld-link: error: could not open 'swiftRemoteMirror.lib': no such file or directory

@al45tair
Copy link
Contributor Author

al45tair commented Mar 1, 2023

That should be fixed by #64010. Hopefully.

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