Skip to content
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

update cmake setup so that the library can be used by SwiftPM cmake build #73

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

tomerd
Copy link
Member

@tomerd tomerd commented Nov 20, 2021

motivation: integrate with SwiftPM

changes:

  • rename the top level project to SwiftSystem instead of swift-system to align with other projects
  • rename System to SystemPackage to align with SwifPM setup
  • update architectures to include arm64

…uild

motivation: integrate with SwiftPM

changes:
* rename the top level project to SwiftSystem instead of swift-system to align with other projects
* rename System to SystemPackage to align with SwifPM setup
* update architectures to include arm64
@tomerd
Copy link
Member Author

tomerd commented Nov 20, 2021

cc @compnerd

@tomerd
Copy link
Member Author

tomerd commented Nov 20, 2021

@swift-ci please test

@tomerd
Copy link
Member Author

tomerd commented Nov 20, 2021

cc @compnerd

@milseman
Copy link
Contributor

@compnerd what do you think of these changes?

Copy link
Collaborator

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I think that this should be fine - I can see this causing some issues for the installers, but we can deal with that subsequently (the manifest needing to be updated).

I'm still unhappy with the change - I don't think that this should be called SystemPackage on anything but macOS - the library name should be libSystem.so or System.dll on non-macOS targets (it has to be different on macOS to avoid the conflict with libSystem). That said, I don't think that we need to hold this up for dealing with the name.

The change to SwiftSystemConfig.cmake.in though is important - it isn't doing what it is supposed to do.

cmake/modules/SwiftSystemConfig.cmake.in Outdated Show resolved Hide resolved
cmake/modules/SwiftSupport.cmake Outdated Show resolved Hide resolved
@milseman
Copy link
Contributor

If we wanted to in the future ship System as a binary with toolchains ala corelibs and Darwin/Glibc overlays, would we have the distinction between source and binary distribution on all platforms?

@tomerd
Copy link
Member Author

tomerd commented Nov 29, 2021

thanks @compnerd

I think that this should be fine - I can see this causing some issues for the installers, but we can deal with that subsequently (the manifest needing to be updated).

👍

by "installers" you mean Windows installers?

I'm still unhappy with the change - I don't think that this should be called SystemPackage on anything but macOS - the library name should be libSystem.so or System.dll on non-macOS targets (it has to be different on macOS to avoid the conflict with libSystem). That said, I don't think that we need to hold this up for dealing with the name.

As you probably know, my goal is to integrate SwiftSystem into SwiftPM and given that the toolchain build uses CMake we need to make that work. I have no strong opinion about how to achieve it other that the current CMake setup does not work in this context so needs to be fixed. Do you a different approach you want to propose as an alternative to this PR and the downstream ones in TSC, SwiftP, LSP, etc?

The change to SwiftSystemConfig.cmake.in though is important - it isn't doing what it is supposed to do.

done, please confirm this is fine now

@tomerd
Copy link
Member Author

tomerd commented Nov 29, 2021

@swift-ci please test

@tomerd tomerd requested a review from compnerd November 29, 2021 20:03
@compnerd
Copy link
Collaborator

thanks @compnerd

I think that this should be fine - I can see this causing some issues for the installers, but we can deal with that subsequently (the manifest needing to be updated).

👍

by "installers" you mean Windows installers?

Yes. There will be changes needed in swift-installer-scripts to update the manifest. But that should happen at the same time as updating the tag.

I'm still unhappy with the change - I don't think that this should be called SystemPackage on anything but macOS - the library name should be libSystem.so or System.dll on non-macOS targets (it has to be different on macOS to avoid the conflict with libSystem). That said, I don't think that we need to hold this up for dealing with the name.

As you probably know, my goal is to integrate SwiftSystem into SwiftPM and given that the toolchain build uses CMake we need to make that work. I have no strong opinion about how to achieve it other that the current CMake setup does not work in this context so needs to be fixed. Do you a different approach you want to propose as an alternative to this PR and the downstream ones in TSC, SwiftP, LSP, etc?

Yes, I understand that. I think that changing the name doesn't need to hold this up for now - this is matching the behaviour in Package.swift. I'm suggesting that the target name be changed much like it is in Foundation:

#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
import SwiftSystem
#else
import System
#endif

The change to SwiftSystemConfig.cmake.in though is important - it isn't doing what it is supposed to do.

done, please confirm this is fine now

@milseman milseman merged commit 5703dc2 into apple:main Nov 30, 2021
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.

3 participants