-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Removing hardware folder contents: platforms are downloaded at build time #1823
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
Conversation
This PR is an extension of this one other #1806 |
BTW, can we do this (are we doing this) in a way that preserves history on those files as they move to separate repositories? |
Indeed that's the idea: once we agree at merging this, we'll create two repositories with the relative files for the sam and avr platforms |
Ah sorry you meant porting their history to the other repos? Uhm I'm not sure we can do that, it's probably a snapshot of their current state and a new history |
Maybe this will help: http://stackoverflow.com/questions/10524578/how-to-move-a-file-from-one-git-repository-to-another-while-preserving-history I'll try it asap |
I think it would be a real shame to lose that history (or, at least, to make it much harder to find). It looks like there are relatively straightforward ways to do this. See, for example: http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository/17864475#17864475 |
Cool, thanks! |
This is what I came up with, starting from current ide-1.5.x branch I've used this script to produce them https://gist.github.com/ffissore/8639728 If you're fine with it, I will spread the word to the developers mailing list. |
I've mentioned this to Cristian, but I think we should call these "platforms" or "architectures" rather than "cores". We currently use core to refer to the "cores/arduino" sub-directory of these new repositories, so calling the repository "core" seems confusing and ambiguous. What do you think? Also, the history only seems to go back as far as the 1.5.x IDE (when these files were moved into a sub-directory). Do you have a sense of what's happening to the history before that? |
Regarding the name, my fault: I've named the zip files platform-* but forgot to do the same for the repos Regarding the history: yes, it goes back until 2011. I think its because git applies a folder filter, thus previous folders are ignored. I'll try using multiple folders, specifying the old one, not sure if it will work |
Indeed specifying multiple dirs doesn't work and it won't suffice anyway since the folders have changed name from the first days (once it was only "hardware" then hardware/avr and hardware/sam then hardware/arduino/avr...) The only other alternative I was able to set up is to have a repo with both avr and sam |
Hmm, I feel like it's useful to keep the history accessible via the commit On Tue, Jan 28, 2014 at 7:04 AM, Federico Fissore
|
Just a quick notice to prevent double work: I've figured out a way to keep history, while also splitting into two repositories. The history is quite complicated, so I'm still ironing out some final details, I'll comment with more details in a few hours when I have it completely working. |
I dug a bit into the git filter-branch manpage and found a way to make this work. By doing a two-step filtering, I managed to first sort out all the renaming stuff (geez, the hardware repository has been reorganized a lot) by separating out all platform code into an For the first step, I used some index manipulation based on an example from the Here's the script I used, and the repositories I generated : https://gist.github.com/matthijskooijman/8673439 To double-check that I didn't leave extra files cluttering around, I ran the command The resulting repositories now have history up to 2011 for sam and back to 2005 for avr (that's the first commit in the original repository). |
Impressive work! |
Oh, I was planning to explain that, but I was in a bit of a hurry and forgot :-) In the early commits, there are platform files inside Having said and done all this, I just realized another argument for keeping both the avr and sam bits in the same repositories: It makes development easier. In particular, when a change affects both avr and sam (e.g., added API that needs to be implemented in both), you can then put them in a single pullrequest. Having two repositories increases the overhead wrt to submitting, reviewing and merging changes. Additionally, for API changes this allows adding the API to all platforms in a single commit, whereas otherwise there is additional risk of the APIs for different platforms to fall out of sync. Perhaps a way of looking at this would be that there is the Arduino "provider" (I don't want to say "core", but perhaps "provider" isn't the best term either...) that supports the "avr" and "sam" platforms, so a single repository for the entire Arduino "provider" could make sense. |
But of course my script would still be useful for a single repository, since it nicely collects all history for either platform in the proper subdirectory. It will need a few tweaks, of course. |
My previous comments were all regarding the creating of the new repositories. I also have a few things to say about the actual commits in this pullrequest :-) It seems that most of these commits belong in #1806, so I'll limit myself to talking about the latter two.
|
Agree with the argument, not to mention copying issues filed on the IDE repo but belonging to one or both of these new repos. |
I suppose we could also use things like git submodule or something, but I've read sad/angry comments about it, although I haven't really read them |
Also refactored libastyle download so that it is downloaded only once, despite the target arch Added related .gitignore entries
…repos of arduino platforms, ignoring the published, stable versions
I've force pushed this branch (yep, sorry but it wasn't merging anymore) with a proposal to the "zip and checksum" issue. cd ~ #or wherever you wish to start
mkdir -p hardare/arduino
cd hardware/arduino
git clone [email protected]:matthijskooijman/arduino-platform-avr.git avr
git clone [email protected]:matthijskooijman/arduino-platform-sam.git sam
cd -
cd Arduino/build
ant -DLOCAL_HARDWARE_FOLDER=~/hardware clean run The IDE will NOT download the zip files and will instead use the files from the cloned repos. [0] http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/ |
For the record, doing this is not mandatory. If you want to develop the core files of the IDE (WString, Print and the like) this is a suggested method. If you are an Arduino library developer, these instructions are not for you, you just don't need them. |
Hmm, I'm sure git submodules and subtrees have their quirks, but having everyone manually check out multiple repositories seems even worse. (Also, then you lose information about which version of the platform repositories goes with which version of the main repository.) Are submodules and subtrees really that bad? |
Regarding which versions goes in, we could use git tags (releases) and ship them. Also consider that this multi repo setup is true only for core developers. A library dev won't need to bother. Submodules seem bad because even an experienced user may lose track of her changes and even wipe them out, throwing her work away. Subtrees seem better but still requires the user to use git in a slightly different way: more commands specific to managing the subtrees, something git GUIs may not support. Moreover, [0] http://cogumbreiro.blogspot.it/2013/05/how-to-install-git-subtree-in-ubuntu.html |
This PR is old and no longer maintained. The gathered knowledge will be used for future improvements. For now, it's better to close it as it's piling up the PR stack |
Platform github projects must be created once this pull req is merged