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

pkg: oonf_api: make patch not working #884

Closed
LudwigKnuepfer opened this issue Mar 14, 2014 · 12 comments
Closed

pkg: oonf_api: make patch not working #884

LudwigKnuepfer opened this issue Mar 14, 2014 · 12 comments
Assignees
Labels
Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@LudwigKnuepfer
Copy link
Member

I followed #630 (comment) and got:

make patch
make: *** No rule to make target '/home/lo/native/RIOT/pkg/oonf_api/oonf_api', needed by '/home/lo/native/RIOT/pkg/oonf_api/oonf_api/Makefile'.  Stop.

After mkdir oonf_api I get:

# Here you apply your patch.
cd "/home/lo/native/RIOT/pkg/oonf_api/oonf_api" && git am "../0001-add-RIOT-support.patch"; cd "/home/lo/native/RIOT/pkg/oonf_api/oonf_api" && git am "../0002-port-tests-to-riot.patch"; cd "/home/lo/native/RIOT/pkg/oonf_api/oonf_api" && git am "../0003-port-example-to-riot.patch";
Applying: add RIOT support
/home/lo/native/RIOT/.git/rebase-apply/patch:202: trailing whitespace.
#ifndef DONT_HAVE_SIN6_SCOPE_ID      
error: Makefile: already exists in index
error: src-api/common/autobuf.c: does not exist in index
error: src-api/common/common_types.h: does not exist in index
error: src-api/common/daemonize.c: does not exist in index
error: src-api/common/netaddr.c: does not exist in index
error: src-api/common/netaddr.h: does not exist in index
error: src-api/rfc5444/rfc5444_print.c: does not exist in index
Patch failed at 0001 add RIOT support
The copy of the patch that failed is found in:
   /home/lo/native/RIOT/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
previous rebase directory /home/lo/native/RIOT/.git/rebase-apply still exists but mbox given.
previous rebase directory /home/lo/native/RIOT/.git/rebase-apply still exists but mbox given.
Makefile:29: recipe for target '/home/lo/native/RIOT/pkg/oonf_api/oonf_api/Makefile' failed
make: *** [/home/lo/native/RIOT/pkg/oonf_api/oonf_api/Makefile] Error 1

Now:

git st
On branch master
Your branch is up-to-date with 'origin/master'.

You are in the middle of an am session.
  (fix conflicts and then run "git am --continue")
  (use "git am --skip" to skip this patch)
  (use "git am --abort" to restore the original branch)

Would be nice to add some kind of error handling..

@LudwigKnuepfer
Copy link
Member Author

While you're at it, you can add this update for #880 :

diff --git a/pkg/oonf_api/0001-add-RIOT-support.patch b/pkg/oonf_api/0001-add-RIOT-support.patch
index 971a8a2..bbfe37d 100644
--- a/pkg/oonf_api/0001-add-RIOT-support.patch
+++ b/pkg/oonf_api/0001-add-RIOT-support.patch
@@ -54,7 +54,7 @@ index 0000000..cf66baa
 +
 +all:
 +      mkdir -p $(BINDIR)
-+      @for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
++      @for i in $(DIRS) ; do $(MAKE) -C $$i || exit 1; done ;
 +
 +clean:
 diff --git a/external/regex/Makefile b/external/regex/Makefile

@benpicco
Copy link
Contributor

Now this is very strange, oonf_api should be checked out and created by git.

I can't reproduce this,

benpicco@rechenknecht2k7:~/riot/RIOT/pkg/oonf_api$ ls
0001-add-RIOT-support.patch  0002-port-tests-to-riot.patch  0003-port-example-to-riot.patch  Makefile  Makefile.include
benpicco@rechenknecht2k7:~/riot/RIOT/pkg/oonf_api$ make patch 
git clone git://olsr.org/oonf_api.git /home/benpicco/riot/RIOT/pkg/oonf_api/oonf_api && \
        cd /home/benpicco/riot/RIOT/pkg/oonf_api/oonf_api && git checkout -b v0.3.0
Klone nach '/home/benpicco/riot/RIOT/pkg/oonf_api/oonf_api'...
remote: Counting objects: 6528, done.
remote: Compressing objects: 100% (3976/3976), done.
remote: Total 6528 (delta 5273), reused 3038 (delta 2450)
Empfange Objekte: 100% (6528/6528), 1.63 MiB | 1009.00 KiB/s, done.
Löse Unterschiede auf: 100% (5273/5273), done.
Checking connectivity... done
Gewechselt zu einem neuen Zweig 'v0.3.0'
cd "/home/benpicco/riot/RIOT/pkg/oonf_api/oonf_api" && git am "../0001-add-RIOT-support.patch"; cd "/home/benpicco/riot/RIOT/pkg/oonf_api/oonf_api" && git am "../0002-port-tests-to-riot.patch"; cd "/home/benpicco/riot/RIOT/pkg/oonf_api/oonf_api" && git am "../0003-port-example-to-riot.patch";
Wende an: add RIOT support
Wende an: port tests to riot
Wende an: port example to riot

$ ls
0001-add-RIOT-support.patch  0002-port-tests-to-riot.patch  0003-port-example-to-riot.patch  Makefile  Makefile.include  oonf_api

afterwards I can run make in e.g. RIOT/pkg/oonf_api/oonf_api/examples/rfc5444_reader_writer and a native binary is produced.

I've created #895 to make the make loop abort on error as you suggested. I guess someone has to ack it before I can merge it? (Yay, I've got the power to merge :D)

What error handling do you suggest with git btw? I looks like it tried to apply the patches to an empty folder (and therefore the underlying RIOT git), but this should never happen to begin with.

@LudwigKnuepfer
Copy link
Member Author

Could you try checking out RIOT-OS/master in a fresh dir and repeat it there?

@benpicco
Copy link
Contributor

Yes, when I do

cd /tmp
git clone [email protected]:RIOT-OS/RIOT.git
cd RIOT/pkg/oonf_api/
make patch
cd oonf_api/examples/rfc5444_reader_writer/
make

it builds.

@OlegHahm
Copy link
Member

.-(~)
`--> cd /tmp
.-(/tmp)
`--> git clone [email protected]:RIOT-OS/RIOT.git
Cloning into 'RIOT'...
remote: Reusing existing pack: 19759, done.
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 19769 (delta 3), reused 1 (delta 0)
Receiving objects: 100% (19769/19769), 6.69 MiB | 1.69 MiB/s, done.
Resolving deltas: 100% (11303/11303), done.
Checking connectivity... done.
.-(/tmp)
`--> cd RIOT/pkg/oonf_api/
.-(/tmp/RIOT/pkg/oonf_api)
`--> make patch
make: *** No rule to make target '/tmp/RIOT/pkg/oonf_api/oonf_api', needed by '/tmp/RIOT/pkg/oonf_api/oonf_api/Makefile'.  Stop.

@benpicco
Copy link
Contributor

Ok, when I try to build it with make 4.0 on Arch I get the same error, are you using that version too?
I've build it with Ubuntu 13.10 which still has make 3.81, so I didn't notice that.

benpicco added a commit to benpicco/RIOT that referenced this issue Mar 17, 2014
@benpicco
Copy link
Contributor

Does it build when you change
PKG_NAME=oonf_api in the Makefile to PKG_NAME:=oonf_api ?

benpicco added a commit to benpicco/RIOT that referenced this issue Mar 17, 2014
@LudwigKnuepfer
Copy link
Member Author

No, it doesn't.

@benpicco
Copy link
Contributor

sorry, I was in the wrong terminal…
But removing the / from $(PKG_NAME)/: seems to work, I guess the example Makefile.git will need this as well.

@LudwigKnuepfer
Copy link
Member Author

Yup, could you include it?

@benpicco
Copy link
Contributor

it's in the pull request, can I merge it?

@LudwigKnuepfer
Copy link
Member Author

See discussion over at the PR

kaspar030 pushed a commit to kaspar030/RIOT that referenced this issue Apr 3, 2014
dangnhat pushed a commit to vanhieubk/RIOT that referenced this issue Apr 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

No branches or pull requests

3 participants