Skip to content

stdlib: prevent static builds on Darwin #26210

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
Jul 24, 2019

Conversation

compnerd
Copy link
Member

Static builds of the standard library and the SDK overlay are
unsupported post ABI stability. Disallow building of the standard
library and SDK overlay statically for Darwin platforms.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7173aa3aa084c204a65bef519a561b8898602dce

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7173aa3aa084c204a65bef519a561b8898602dce

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f3021edf3e362e739e0a5af1ef0c2f486573538e

@beccadax
Copy link
Contributor

beccadax commented Jul 18, 2019

Funny, I just filed a bug related to this: https://bugs.swift.org/browse/SR-11157

I think it would be better to not error out, though—wouldn't that make it impossible to share a preset that builds static standard libraries for non-Darwin platforms with Darwin?

@compnerd
Copy link
Member Author

Yes, it does make that impossible, but, really, that is already pretty badly broken. The current model doesn't really work (CMake just is not designed that way) - e.g. -install_name being used on ELF and -soname being used for MachO?! We have a ton of hacks in place and we keep piling more on. I think that we need to just change to proper cross-compilation (nearly all the pieces are now in place). At that point, that will have different CMake sub-builds for each one. This is better long term.

Static builds of the standard library and the SDK overlay are
unsupported post ABI stability.  Disallow building of the standard
library and SDK overlay statically for Darwin platforms.
@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 9fb5250

@beccadax
Copy link
Contributor

I think @shahmishal needs to be part of this conversation, because if we can't use the same presets on Darwin and other platforms, that's going to impact the way CI is configured.

@shahmishal
Copy link
Member

@brentdax @compnerd Thanks for bring this to my attention, if we see build failures on CI because we are still using the flag on macOS please let me know and I will update the preset.

@beccadax
Copy link
Contributor

Looking at build-presets.ini, the following apparently-Darwin presets still use this flag:

  • mixin_buildbot_trunk_base
  • buildbot,tools=RA-flto,stdlib=RDA
  • LLDB_Swift_DebugAssert_with_devices
  • LLDB_Swift_ReleaseAssert_with_devices

We should probably remove the flag from these.

@compnerd
Copy link
Member Author

Beyond the update of the presets, the question is, should we even permit building the standard library/SDK overlay for Darwin in static mode?

@beccadax
Copy link
Contributor

beccadax commented Jul 21, 2019

We think not permitting it is fine. There is no supported way to use the static libraries on Darwin. Mishal says that we (should) always use separate presets for Linux, so preset sharing isn't a concern.

@compnerd
Copy link
Member Author

@swift-ci please test macOS platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 9fb5250

@compnerd
Copy link
Member Author

@swift-ci please test macOS platform

@compnerd
Copy link
Member Author

Sounds like all the concerns have been addressed, I'm going to go ahead and merge this. As @shahmishal said, if we run into cases where the preset is using static builds, we will update the preset and sharing is not a concern.

@compnerd compnerd merged commit f26048d into swiftlang:master Jul 24, 2019
@compnerd compnerd deleted the dynamic-only branch July 24, 2019 02:22
@shahmishal
Copy link
Member

#26343

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.

5 participants