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

Simplify obtaining of swift sources #31

Merged
merged 13 commits into from
Dec 11, 2015

Conversation

BrandonMathis
Copy link
Contributor

With hopes of making the install/obtaining of sources process easier. I have collapses all github repo clone commands into a utils/clone_resources.sh command which can be run via a curl command.

Readme updated as well

@@ -0,0 +1,11 @@
#!/usr/env bash

git clone git@github.com:apple/swift.git swift
Copy link

Choose a reason for hiding this comment

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

If the Swift team goes ahead with this approach, please can #29 be changed here too.

@XBeg9
Copy link

XBeg9 commented Dec 3, 2015

+1

@stuarthannig
Copy link

This may need to be taken into consideration as well.

#29

@BrandonMathis
Copy link
Contributor Author

TY @stuarthannig Change has been made.

@Leandros
Copy link

Leandros commented Dec 3, 2015

@BrandonMathis
Copy link
Contributor Author

Hmmm, that would require the installation of quick-secure on users machines, right @Leandros?

@jetpacmonkey
Copy link

He's not recommending the use of quick-secure, he's calling out the bad practice of piping curl to sh.

@jsjohnst
Copy link

jsjohnst commented Dec 3, 2015

👎 * 💯

No offense to @BrandonMathis, but folks who write documentation that tells users to curl pipe into bash need to stop writing documentation until they learn why that is a severe anti-pattern that needs to die.

@davidcelis
Copy link

Agreed. If anything, couldn't utils/build-script take responsibility for cloning down the dependencies that swift needs to build?

@Leandros
Copy link

Leandros commented Dec 3, 2015

He's not recommending the use of quick-secure, he's calling out the bad practice of piping curl to sh.

Exactly.

@LinusU
Copy link

LinusU commented Dec 3, 2015

👎 * 💯

No offense to @BrandonMathis, but folks who write documentation that tells users to curl pipe into bash need to stop writing documentation until they learn why that is a severe anti-pattern that needs to die.

Yes a thousand times! There is nothing worse than seeing that in documentation.

@rootedbox
Copy link

complicates maintenance, and less secure.

@BrandonMathis
Copy link
Contributor Author

Ah Thanks @jetpacmonkey & @jsjohnst that is a pretty good point. Running arbitrary code from a curl command would be very off-putting to many developers!

I do like @davidcelis' suggestion of moving this functionality into utils/build-script but that script seems to server a very specific and single purpose. Perhaps the Readme should just be updated to advise that the utils/clone_repos.sh script locally? That would also greatly simplify maintenance and you would not run the risk of executing a script from remote that may have diverged from what you have cloned locally on your machine.

@gribozavr
Copy link
Contributor

I would prefer the VCS-related functionality to be separate from the build-script. The build script is being executed in automated environments, like CI and build machines, that need to reliably build a given source tree, so it shouldn't have the functionality to download sources from the network.

utils/update-checkout --clone seems the right place for this.

@yurikoles
Copy link

@BrandonMathis, you are on par with @AndreasPrang on commits quantity that you need to fix URL.
Keep going and you will bit him.

@BrandonMathis
Copy link
Contributor Author

Agreed, thx for the suggestion @gribozavr

@wadestuart
Copy link

@Leandros It may make sense to actually provide a curlsh line to drive awareness, the script could be as simple as:

#!/bin/sh
echo "Stop executing random commands you find on the internet.  You could have been owned."

@BrandonMathis
Copy link
Contributor Author

@gribozavr, Moved this into utils/update-checkout --clone. Should settle the security concerns the community has 😄

Thanks for the help all! Excited to see what the future of swift will hold.

📝 Merging this will also close:

@jsjohnst
Copy link

jsjohnst commented Dec 3, 2015

I'm not sure if --clone makes sense being allowed to be with the other options. I think it would make more sense if it was something like

if args.clone:
   # do clone
else:
   # do existing functionality

git clone git@github.com:apple/swift-corelibs-xctest.git
git clone git@github.com:apple/swift-corelibs-foundation.git

./utils/update-checkout --clone
Copy link
Contributor

Choose a reason for hiding this comment

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

One still needs to clone the swift repo, and then cd into it.

Copy link

Choose a reason for hiding this comment

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

👍

@jsjohnst
Copy link

jsjohnst commented Dec 3, 2015

Great catches @gribozavr!

@@ -52,6 +53,21 @@ def update_working_copy(repo_path):
else:
check_call([ "svn", "update" ])

def obtain_additional_swift_sources():

Choose a reason for hiding this comment

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

This is outside the scope of what this script is meant for. This script updates current sources.. At this point you are getting into package management.. There are separate utils for this within swift.

@bawangxx
Copy link

bawangxx commented Dec 4, 2015

很好很强大

@gribozavr
Copy link
Contributor

@BrandonMathis Sorry, just noticed that the readme was updated to include both sets of instructions for both https and ssh access, and that your pull request changes it to use https only.

There are trade-offs between https and ssh. HTTPS is friendlier for people who don't have a github account. Using ssh by default optimizes for the developers with commit access.

Do you think we could also add a --clone-via-ssh option? That way, we can accommodate all members of the community.

@yurikoles
Copy link

I suggest to leave ability to clone whole sources by the script behind some option like '--full' . One may want to simply download this script and execute it standalone.

@@ -16,6 +16,7 @@ from __future__ import print_function
import argparse
import os
import sys
import pdb
Copy link
Contributor

Choose a reason for hiding this comment

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

pdb needed? :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, nice catch :)

@BrandonMathis
Copy link
Contributor Author

@gribozavr, support for cloaning via ssh has been added via a --clone-with-ssh argument. 👍

gribozavr added a commit that referenced this pull request Dec 11, 2015
@gribozavr gribozavr merged commit 5d3fe25 into swiftlang:master Dec 11, 2015
@gribozavr
Copy link
Contributor

Thanks, @BrandonMathis!

@BrandonMathis
Copy link
Contributor Author

Can do @gottesmm 😬👍🏼

slavapestov pushed a commit to slavapestov/swift that referenced this pull request Nov 27, 2018
kateinoigakukun referenced this pull request in kateinoigakukun/swift Jan 24, 2020
* [WASM] Disable mmap test case for WASI OS due to lack of WASI API

* [WASM] Disable simd test case for WASI OS

simd api maybe stable in future https://github.com/WebAssembly/simd

* [WASM] Fix to build pthread pollyfill only when wasi sdk

* [WASM] Implement parsing command line arguments

* [WASM] Run StdlibUnittest in process instead of child proc
kateinoigakukun referenced this pull request in kateinoigakukun/swift Jan 25, 2020
* [WASM] Disable mmap test case for WASI OS due to lack of WASI API

* [WASM] Disable simd test case for WASI OS

simd api maybe stable in future https://github.com/WebAssembly/simd

* [WASM] Fix to build pthread pollyfill only when wasi sdk

* [WASM] Implement parsing command line arguments

* [WASM] Run StdlibUnittest in process instead of child proc
MaxDesiatov pushed a commit to MaxDesiatov/swift that referenced this pull request May 1, 2020
[pull] swiftwasm from apple:master
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.