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

xplat: Packaging shasum check #3023

Merged
merged 3 commits into from
May 23, 2017
Merged

Conversation

obastemur
Copy link
Collaborator

No description provided.

@obastemur
Copy link
Collaborator Author

obastemur commented May 23, 2017

No CI?

EDIT: CI showed up a bit late. False alarm

PRINT $ERROR_COLOR "] Corrupted binary package."
PRINT $DEFAULT_COLOR "] Check your network connection."
PRINT $ERROR_COLOR "] If you suspect from anything else \
please reach us at https://github.com/Microsoft/ChakraCore"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

shall we rather use an email address here?

Copy link
Contributor

@dilijev dilijev May 23, 2017

Choose a reason for hiding this comment

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

Could link to https://github.com/Microsoft/ChakraCore#contact-us

ChakraCore@ exists, but is used as the account email and has a small audience, which is why we previously removed it from the list of ways to contact us.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea, thanks

@@ -61,12 +60,13 @@ GET_LATEST()
CHAKRA_VERSION=$(curl -k -s -SL "https://aka.ms/chakracore/version")

if [[ "$CHAKRA_VERSION" == *"Error"* ]]; then
PRINT $ERROR_COLOR "] Download Failed. Do you have an Internet connection?"
PRINT $ERROR_COLOR "] Download Failed. Do you have Internet connection?"
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer error messages with a clear call to action. Probably change this to: Please ensure you are connected to the internet and try again.

If you want to allow the user to manually verify the connection to the download source you could also add and ensure that ${url} is accessible or ensure that ${domain} is accessible -- to avoid confusing the user if they are connected to the internet but this download still fails, which could be caused by aka.ms or azure being offline.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

network check is beyond the scope of this script but thanks anyway.

fi
PRINT $DEFAULT_COLOR "\n] Downloading ChakraCore shasum"
PRINT $SUCCESS_COLOR "] ${SHASUM_NAME}"
___=$(curl -kSL -o "chakracore_s.tar.gz" "${SHASUM_NAME}" 2>&1)
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a confusing name (extension) because the file is just a plaintext checksum, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, file is also tar.gzip

exit 1
fi

PRINT $SUCCESS_COLOR "] Found ChakraCore ${CHAKRA_VERSION//_/.} for ${CURRENT_OS}"
BINARY_NAME="https://aka.ms/chakracore/${BINARY_NAME}_${CHAKRA_VERSION}.tar.gz"
BINARY_NAME="https://aka.ms/chakracore/${BINARY_NAME}_${CHAKRA_VERSION}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the URL no longer include .tar.gz? Or is that added later on in the script (I didn't see it)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

aka.ms no longer supports dots.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, got it. So it's still a .tar.gz file downloaded from a url without dots, and the script saves it with the correct extension.

CHECK_EXT_FAIL()
{
if [[ $? != 0 ]]; then
PRINT $ERROR_COLOR "] Extracting the compressed file is failed."
Copy link
Contributor

Choose a reason for hiding this comment

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

Failed to extract the compressed file

Or better, pass a parameter with the name of the file and print the error message

Failed to extract '${filename}'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea, will add a todo there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually not needed since we show the filename and contents under this line.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay then. At a minimum change is failed to just failed.

if [[ ! $SUM1 =~ $SUM2 ]]; then
PRINT $ERROR_COLOR "] Corrupted binary package."
PRINT $DEFAULT_COLOR "] Check your network connection."
PRINT $ERROR_COLOR "] If you suspect from anything else \
Copy link
Contributor

Choose a reason for hiding this comment

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

Change If you suspect from anything else to If you suspect there is some other problem,

Linux: check if `ld` supports LTO, otherwise build
clang toolchain and use that instead
@obastemur
Copy link
Collaborator Author

cherry picked stale commit into this PR.

Copy link
Contributor

@dilijev dilijev left a comment

Choose a reason for hiding this comment

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

Tried out the script and waiting for it to finish, but it seems to work on my end.

@obastemur
Copy link
Collaborator Author

@jianchun @dilijev Thanks for the review

@chakrabot chakrabot merged commit d768d8d into chakra-core:release/1.5 May 23, 2017
chakrabot pushed a commit that referenced this pull request May 23, 2017
Merge pull request #3023 from obastemur:pkg_fix
chakrabot pushed a commit that referenced this pull request May 23, 2017
Merge pull request #3023 from obastemur:pkg_fix
chakrabot pushed a commit that referenced this pull request May 23, 2017
…um check

Merge pull request #3023 from obastemur:pkg_fix
@dilijev
Copy link
Contributor

dilijev commented Jun 9, 2017

Note: this PR additionally merged #2967 into 1.5 (commit bf578af)

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