Remove git submodule in favor of CMake commands #817
Conversation
…lone, fetch, and checkout nupic.core repository. This also allows overriding the defaults on the command line via NUPIC_CORE_REMOTE, for the remote repository url, and NUPIC_CORE_COMMITISH, for the specific sha.
Currently running through Numenta internal pipelines to understand impact. |
👍 very nice! thanks @oxtopus |
I've read the code in the PR, and realize that while I'm +1 for the idea to let CMake clone
Here's my 2c:
|
@breznak I understand the use of env vars here, but it confuses me, because aren't we trying to reduce them? Expand a little more:
|
I see, this one would be nice feature. (would need a warning though, |
My intention is not to use env variables, but instead allow the user to I'm a total noob with CMake, so I'm open to suggestions. On Wednesday, April 16, 2014, breznak notifications@github.com wrote:
|
To further clarify, the user need not modify CMakeLists.txt in order to test alternative forks or commits. The idea is the user would run cmake with additional option:
When they're ready to push those changes upstream, then they modify CMakeLists.txt and submit a PR. |
Despite of my preferences to config(which would reduce repetitive typing or using the upper arrow) stated above, this PR would definitely help and improve development productivity in a way I can also adapt to.
Still, a separate file(other than |
+1 |
message(FATAL_ERROR "Unable to fetch ${NUPIC_CORE_REMOTE}") | ||
endif() | ||
endif() | ||
execute_process(COMMAND git checkout ${NUPIC_CORE_COMMITISH} |
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.
Consider use a parameter variable like ${commitish}
instead of ${NUPIC_CORE_COMMITISH}
@utensil Can you provide an example for how I might move the NUPIC_CORE_REMOTE and NUPIC_CORE_COMMITISH into a separate file? Would you approve this PR as-is, assuming that we could follow up with the separate file idea in a different PR? |
I'm OK with current PR as is, we may investigate the idea in another PR. |
+100 |
# checkout git dependency | ||
if (NOT EXISTS ${submodule_dir}) | ||
execute_process(COMMAND git clone ${remote} ${submodule_dir}) | ||
if(NOT EXIT_CODE EQUAL 0) |
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.
You forgot add RESULT_VARIABLE EXIT_CODE
option to execute_process
command.. On the contrary, you will use a empty or wrong value..
Do this:
execute_process(COMMAND git clone ${remote} ${submodule_dir}
RESULT_VARIABLE EXIT_CODE)
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.
Fixed. Thanks!
@@ -1,3 +0,0 @@ | |||
[submodule "nupic.core"] |
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.
Should we keep this file in root yet? How about we delete it once (of course, if Travis get green with this removal)?
The less files the better! 😃
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.
If it's empty, we should remove it. I just wasn't sure if it would cause problems so I left it empty.
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.
Yes, it's empty.. I don't see problems in remove it...
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.
Done!
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.
Good job, bro! This PR is really useful!
Thanks! It already was closed.. hehe |
@@ -29,6 +29,51 @@ | |||
### ### | |||
############################################################################################################################ | |||
|
|||
# This function read variables from a file in the following format: |
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.
Typo: This function reads
@oxtopus We seem to have a Travis problem. The last push did not trigger a Travis-CI build. The only way I know to trigger one is to push another commit. Otherwise, 👍 Looks great! |
I don't know what's up w/ travis and the reported status. https://travis-ci.org/oxtopus/nupic/builds/23225301, which is the latest commit in this branch is green, and #830 is green, which is a superset of this and only differs in Dockerfile, which wouldn't affect the travis build. @rhyolight are there any implications on tooling wrt nupic and nupic.core assuming this is merged? |
…ents, and (hopefully) trigger another travis build to get the status green
@oxtopus We are green and good to go. Before the final merge, are there any README changes that need to be made? Do we need to inform our current users of this at all? |
@rhyolight Nothing needed in the README. I've played through a few scenarios of switching between different SHAs before and after without any problem. The required changes are encapsulated within the changeset, so it will apply cleanly. The only problems someone might encounter is if they were modifying nta/ inline and deviated from the instructions. In which case the merge will fail for them and they will have to resolve the conflict on their own. I will send a heads up to nupic-hackers. |
Remove git submodule in favor of CMake commands
@oxtopus Thanks. Any chance you could add a wiki page with instructions on how to create the appropriate local config files to customize the remote location and committish of |
Sure thing. |
Beautiful, thanks. Matt Taylor On Mon, Apr 21, 2014 at 9:19 AM, Austin Marshall
|
BTW, I changed the wiki name to "NuPIC's-Dependency-on-nupic.core" and Matt Taylor On Mon, Apr 21, 2014 at 9:41 AM, Matthew Taylor matt@numenta.org wrote:
|
👍 for the work and the wiki . Really excellent and helpful, can't wait to test it. |
KUDOs @oxtopus, this is great! The build is rocking with my new neat settings for local devel: Default nupic.core dependencies (override in optional .nupic_modules)NUPIC_CORE_REMOTE = '/home/nupic/nupic.core' PS: nitpicks: I think it should be
and .nupic_config should be in gitignore? Thanks a lot! :) |
On Tue, Apr 22, 2014 at 8:28 PM, Marek Otahal markotahal@gmail.com wrote:
Marek Otahal :o) |
@breznak Oops! You're right re: comment in .nupic_modules and overrides. Will follow up. |
Starting from a clean state:
Then, after building:
Are you seeing something different? |
Hmm, I tried putting a |
Reading the CMakeLists.txt file, it looks like the |
I think you're right. Only place the function is used is https://github.com/numenta/nupic/blob/master/CMakeLists.txt#L600 How'd we miss that? |
See #849 for possible fix. Works for me, at least. |
Fixes #798.
Fixes #634.
Removed nta git submodule, replaced with CMake commands to manually clone, fetch, and checkout nupic.core repository. This also allows overriding the defaults on the command line via NUPIC_CORE_REMOTE, for the remote repository url, and NUPIC_CORE_COMMITISH, for the specific sha.
There are several advantages to this approach:
CMakeLists.txt.nupic_modules
is the ground truth for nupic.core version dependency