-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
sudo yum install ruby binutils gcc git glibc-static gzip libbsd libcurl libedit libicu libsqlite libstdc++-static libuuid libxml2 tar tzdata ruby -y | ||
cd $(mktemp -d) | ||
wget ${SwiftToolchainUrl} -O swift.tar.gz | ||
gunzip < swift.tar.gz | sudo tar -C / -xv --strip-components 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this wil install the Swift toolchain, which means the host will run the compiler etc which could be a security a risk. we put together https://github.com/swift-server/guides/blob/main/packaging.md to describe different deployment strategies including a tarball, docker or source distribution (which this falls into IIUC). we probably want to update this to reflect these different strategies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the best choice now would be static stdlib linking, if only one Swift binary is deployed per host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
please remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks so much for putting this together @gibbster
comments inline
[retarged to |
hi @gibbster do you want to bring this over the finish line? |
Absolutely. I'll pick this up next week. |
@gibbster nice work, was planning to do this and found you already did. Do you plan to finish it up, or do you want help? |
Thanks @hassila - yes, I must admit I've been dragging my feet on this, so would love some tips. From where I stand I think I need to do two things:
If you have any thoughts on either of these topics I would appreciate the help! |
@gibbster I will try to follow the guide and see if it still works and what feedback I can give - with regard to 2 above, I saw the discussion - maybe a good approach would be to separate concerns a bit and provide information on both
For the first use case for development, I would consider adding something along these lines also: In addition to the AWS console, there is also a command line interface for AWS that can be helpful for day-to-day development with a single instance. It allows for setting up some simple useful shell commands (this example for the awesome fish shell for an Ubuntu instance) for an individual developer, e.g.:
This gives on-demand command line access to the remote host (and one can always put amazon-stop in a cron job if desired...). |
@hassila - do you think building the binary with |
@gibbster |
@hassila I added some updates. Let me know if it addresses the spirit of the static linking request, and if there's any best practices, technical details, screenshots, etc. I should add |
Thanks @gibbster, super! I think the most important point is addressed now - the separation between a build host with toolchain and how to build with a static stdlib and deploying on a host without the toolchain. Basically it is the minimalistic approach of the tar archive outlined at (https://github.com/swift-server/guides/blob/main/docs/packaging.md) which points in the right direction. Some minor structuring nits:
|
@hassila - will do. One question: I see that the baseline branch is now |
@gibbster super. I guess it doesn't matter from which of your forks branch the merge is done, but there was a baseline branch renaming some while ago AFAIU, so perhaps you want to update anyway (I usually fork the repo and do a local feature branch myself when contributing). |
Created a new PR with all the |
Created a guide for AWS