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

Do not remove src dir after compilation #1299

Merged
merged 1 commit into from
Nov 16, 2016

Conversation

PeterDaveHello
Copy link
Collaborator

@PeterDaveHello PeterDaveHello commented Nov 13, 2016

This will help speed up the installation time for the install from source and non-first time
installation as make can use the "cache", this can speed up the build time and test time on
Travis-CI as we'll cache .cache dir.

Ref:

$ time nvm i -s 6.9.1
.
.
.
Now using node v6.9.1 (npm v3.10.8)
real    0m31.914s
user    0m28.116s
sys     0m4.344s

…eeds

This will help speed up the installation time for the non-first time
installation, especially can speed up the build time and test time on
Travis-CI as we'll cache .cache dir.
@PeterDaveHello
Copy link
Collaborator Author

To prove that the change can speed up the build time / CI test time, just send another commit come after the main change, as you'll rebase then merge PRs, it won't hurt at all.

@PeterDaveHello
Copy link
Collaborator Author

PeterDaveHello commented Nov 13, 2016

As you can see, we usually take about more than 2.5 hours to pass per round of CI test:
image

We need only less than one hour now:
image

(and about 1/3 in real elapsed time)

@@ -7,7 +7,6 @@ However, before submitting, please review the following:
- Please include tests. Changes with tests will be merged very quickly.
- Please manually confirm that your changes work in `bash`, `sh`/`dash`, `ksh`, and `zsh`. Fast tests do run in these shells, but it's nice to manually verify also.
- Please maintain consistent whitespace - 2-space indentation, trailing newlines in all files, etc.
- Any time you make a change to your PR, please rebase freshly on top of master. Nobody likes merge commits.
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this. We absolutely will not use Github's rebase, as that destroys history. The rebase must be done on the command line.

Copy link
Collaborator Author

@PeterDaveHello PeterDaveHello Nov 14, 2016

Choose a reason for hiding this comment

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

@ljharb I reverted, but how did you merge the PRs on GitHub? Squash and merge?

Copy link
Member

Choose a reason for hiding this comment

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

I merge them on the command line, and with the "allow edits from maintainers" checkbox, I'm able to rebase PRs for people (and force push to their branch) and then fastforward-merge their PR - whereas Github's "rebase" or "squash" feature severs the connection to the actual git log that's on the PR.

@@ -1883,8 +1883,7 @@ nvm_install_source() {
./configure --prefix="${VERSION_PATH}" $ADDITIONAL_PARAMETERS && \
$make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} && \
command rm -f "${VERSION_PATH}" 2>/dev/null && \
$make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} install && \
command rm -rf "${TMPDIR}"
Copy link
Member

Choose a reason for hiding this comment

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

is this dir cleared by nvm cache clear?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ljharb yes, it'll be cleared by nvm cache clear

Copy link
Member

Choose a reason for hiding this comment

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

I think I'd still like to remove the dir if the installation fails. Can we move this down to line 1906?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ljharb for installation fails, would leave this dir for debug would be even better?

Copy link
Member

Choose a reason for hiding this comment

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

That's never been a problem before - usually the error message is sufficient, and since the majority of users won't have the skills to debug, the ones that will also have the skills to go comment out the rm line (as they do now)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I update it 👍

@ljharb ljharb added the installing node Issues with installing node/io.js versions. label Nov 14, 2016
@PeterDaveHello PeterDaveHello force-pushed the enhance-cache branch 2 times, most recently from 8dac2c3 to 0704ecb Compare November 14, 2016 08:50
@@ -1904,6 +1904,8 @@ nvm_install_source() {
fi

nvm_err "nvm: install ${VERSION} failed!"
# shellcheck disable=SC2031
Copy link
Member

Choose a reason for hiding this comment

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

by my reading of https://github.com/koalaman/shellcheck/wiki/SC2031, this shellcheck error is actually very serious and should not be bypassed.

I think that in order for TMPDIR to be available outside of the if chain, we need to refactor that chain so that it's defined at the function level.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ljharb I move that part out of the if, is that good for you? The function would be still the same.

@PeterDaveHello
Copy link
Collaborator Author

@ljharb anything I need to do here? Since this can totally decrease the CI build time, I hope this can be merged as soon as possible 😄

@ljharb ljharb merged commit 0360829 into nvm-sh:master Nov 16, 2016
@PeterDaveHello PeterDaveHello deleted the enhance-cache branch November 16, 2016 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants