Skip to content

[Debugging] Disable DebugDescriptionMacro for windows targets #71685

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 1 commit into from
Feb 19, 2024

Conversation

kastiglione
Copy link
Contributor

@kastiglione kastiglione commented Feb 16, 2024

On windows (PECOFF), the static let properties produced by DebugDescriptionMacro are not constants, and as a result the @_section macro cannot be applied. The error message is:

global variable must be a compile-time constant to use @_section attribute

Until this issue is addressed, DebugDescriptionMacro is disabled for windows targets.

The macro's use of `@_section` currently fails on windows. In reference to the tuple of
bytes, the diagnostic message is:

> global variable must be a compile-time constant to use @_section attribute
@kastiglione kastiglione changed the title dl/Disable macro on windows [Debugging] Disable DebugDescriptionMacro for windows targets Feb 16, 2024
@kastiglione
Copy link
Contributor Author

@swift-ci smoke test

@kastiglione kastiglione merged commit fc23eef into main Feb 19, 2024
@kastiglione kastiglione deleted the dl/Disable-macro-on-windows branch February 19, 2024 23:01
kastiglione added a commit that referenced this pull request Feb 21, 2024
Introduces the first use of `@_DebugDescription` in the standard library, applying it 
to `ObjectIdentifier`. In order to use the DebugDescription macro in the stdlib, the 
following changes are required:

1. Compilation must reference the just built macros (ie `libSwiftMacros.dylib`), not 
those from the SDK. This is addressed by adding an explicit `-external-plugin-path` 
flag that overrides the defaults generated by the compiler (which uses SDK paths, where 
the macro may or may not exist, and may not be the current version).
2. As DebugDescription uses `@_section`, compilation enables the `SymbolLinkageMarkers` 
feature.

Note that the use of DebugDescription is conditionally enabled for the following 
reasons:

1. Use is disabled in freestanding builds, where the stdlib macros are not built.
2. Use is temporarily disabled in Linux builds due to a dynamic loader issue that needs 
further investigation

The dynamic loader error causing issues with Linux CI is:
> swift-plugin-server: error while loading shared libraries: libswiftGlibc.so: cannot 
open shared object file: No such file or directory

This PR depended on #71639, #71588, and #71685.
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