Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

parallel make fixes the 3rd #4178

Closed
wants to merge 4 commits into from

5 participants

@wsnipex
Collaborator

parallel building on (at least) linux still fails, even after ad81556

@T-nelson: this disables the ffmpeg binary again

@wsnipex
Collaborator

jenkins build this please

@MartijnKaijser MartijnKaijser added this to the Pending for inclusion milestone
@wsnipex
Collaborator

thanks @elupus, I completely failed to notice the dvdpcodecs target, updated and seems to work fine.
The thing I'm not totally sure about is the main.a target as this one is much harder to hit(main.d not found)

@wsnipex
Collaborator

jenkins build this please

@wsnipex
Collaborator

jenkins build this please
@koying this should fix the android arm breakage

@koying
Collaborator

Okido. Thanks

Makefile.in
@@ -546,8 +538,7 @@ else
$(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
endif
-xbmc/main/main.a: force
- $(MAKE) -C xbmc/main
+xbmc/main/main.o xbmc/main/main.a: xbmc/main

Drop this, and cherry-pick t-nelson/xbmc@63acfda

@wsnipex Collaborator
wsnipex added a note

doesn't work, we still need a rule for xbmc/main/main.a

@elupus Collaborator
elupus added a note

he meant revert the removal of the rule too. Ie the 3 lines above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Trent Nelson and others added some commits
Trent Nelson [buildsys] Fix parallel build, race creating deps
We use some object files in the toplevel makefile, to indicate when
libs/bins need rebuilt, which are also built deeper down in the
hierarchy.  Provide explicit targets for them so make observes only
one build target.  This will save us from race conditions, since our
compile commands are multi-stage (dep creation), and potentially
recompiling objects with wrong flags.
048e2d6
@wsnipex wsnipex [make] fix ffmpeg libs target dependencies fb76971
@wsnipex wsnipex [buildsys] fix xbmc/main/main.a target 0754dcd
@wsnipex
Collaborator

jenkins build this please

@wsnipex
Collaborator

stupid vbox, hung up again...

jenkins build this please

Makefile.in
@@ -509,6 +512,12 @@ ifneq (@USE_LIBXBMC@,1)
MAINOBJS+=xbmc/main/main.o
endif
+xbmc/xbmc.o: xbmc/xbmc.a
+
+xbmc/android/activity/android_main.o: xbmc/android/activity/activity.a
+
+xbmc/main/main.o xbmc/main/main.a: xbmc/main
+
@elupus Collaborator
elupus added a note

This is still wrong. Should be dependent on xbmc/main/main.a

@elupus Collaborator
elupus added a note

I think this is the only working one after some thoughs. We must depend on phony dir targets, since the .o file can not depend on the .a file due to .a file always being newer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@elupus elupus commented on the diff
Makefile.in
@@ -535,9 +544,6 @@ else
$(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
endif
-xbmc/main/main.a: force
- $(MAKE) -C xbmc/main
-
@elupus Collaborator
elupus added a note

This rule should still remain.

@wsnipex Collaborator
wsnipex added a note

hmm, we have xbmc/main already in DIRS.
would keeping this rule be the same as we had before with ffmpeg?

@elupus Collaborator
elupus added a note

I can't see anything actually defining DIRS as targets thou.

Yeah I don't see how it works either. *DIRS are only used for clean targets AFAICT.

Hrm... Actually, I wonder if we get lucky at the fact that the FS/mount options update the dir's mtime to that of the most recently modified file within it...

@elupus Collaborator
elupus added a note

that wouldn't help. something must have triggered a make -C xbmc/main, otherwise we wouldn't have any main.a file?

@wsnipex Collaborator
wsnipex added a note

tbh I just assumed this was some automake magic/implicit rule when I noticed that xbmc/main was being called twice sometimes, which produced the "cannot stat main.d".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Makefile.in
@@ -509,6 +512,12 @@ ifneq (@USE_LIBXBMC@,1)
MAINOBJS+=xbmc/main/main.o
endif
+xbmc/xbmc.o: xbmc/xbmc.a
+
+xbmc/android/activity/android_main.o: xbmc/android/activity/activity.a
+
@elupus Collaborator
elupus added a note

This won't work now that i think about it. the .a file will be newer than the .o file. Which will cause the .o file to be rebuilt using implicit rules.

@wsnipex Collaborator
wsnipex added a note

is this related?
make -C tools/TexturePacker/
make[1]: Entering directory `/home/jenkins/workspace/XBMC-Android-ARM/tools/TexturePacker'
make -C /home/jenkins/workspace/XBMC-Android-ARM/lib/libsquish/ libsquish-native.so
xbmc/android/activity/android_main.cpp:23:37: fatal error: android_native_app_glue.h: No such file or directory
#include
^

@elupus Collaborator
elupus added a note

Yea i think so. We must have those object files depend on PHONY dir targets. So indeed "xbmc/main" "xbmc/android/activity" "xbmc".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@wsnipex
Collaborator

next round:
jenkins build this please

@elupus
Collaborator

Strange.. that worked :). I still couldn't find what rule it is that makes the DIRS targets actually make that subdir.

@t-nelson

Closing in favor of #4193

@t-nelson t-nelson closed this
@wsnipex wsnipex deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 11, 2014
  1. @wsnipex

    [buildsys] Fix parallel build, race creating deps

    Trent Nelson authored wsnipex committed
    We use some object files in the toplevel makefile, to indicate when
    libs/bins need rebuilt, which are also built deeper down in the
    hierarchy.  Provide explicit targets for them so make observes only
    one build target.  This will save us from race conditions, since our
    compile commands are multi-stage (dep creation), and potentially
    recompiling objects with wrong flags.
  2. @wsnipex
  3. @wsnipex
  4. @wsnipex
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 11 deletions.
  1. +18 −11 Makefile.in
View
29 Makefile.in
@@ -272,7 +272,8 @@ SKIN_DIRS+=$(TOUCHED_MEDIA)
endif
DIRS= $(BIN_DIRS) $(EC_DIRS) $(XBMCTEX_DIRS) $(DVDPCODECS_DIRS) $(PAPCODECS_DIRS) \
- $(LIB_DIRS) $(SS_DIRS) $(VIS_DIRS) $(LIBADDON_DIRS) $(SKIN_DIRS) xbmc/main
+ $(LIB_DIRS) $(SS_DIRS) $(VIS_DIRS) $(LIBADDON_DIRS) $(SKIN_DIRS) \
+ xbmc/main xbmc/android/activity xbmc
LIBS=@LIBS@
CFLAGS=@CFLAGS@
@@ -489,14 +490,17 @@ DYNOBJSXBMC+= xbmc/freebsd/freebsd.a
endif
ifeq (@USE_STATIC_FFMPEG@,1)
-DYNOBJSXBMC += lib/ffmpeg/libavcodec/libavcodec.a \
- lib/ffmpeg/libavfilter/libavfilter.a \
- lib/ffmpeg/libswresample/libswresample.a \
- lib/ffmpeg/libavformat/libavformat.a \
- lib/ffmpeg/libavutil/libavutil.a \
- lib/ffmpeg/libpostproc/libpostproc.a \
- lib/ffmpeg/libswscale/libswscale.a
+FFMPEGOBJS = lib/ffmpeg/libavcodec/libavcodec.a \
+ lib/ffmpeg/libavfilter/libavfilter.a \
+ lib/ffmpeg/libswresample/libswresample.a \
+ lib/ffmpeg/libavformat/libavformat.a \
+ lib/ffmpeg/libavutil/libavutil.a \
+ lib/ffmpeg/libpostproc/libpostproc.a \
+ lib/ffmpeg/libswscale/libswscale.a
+DYNOBJSXBMC+= $(FFMPEGOBJS)
LIBS+= @GNUTLS_ALL_LIBS@ @VORBISENC_ALL_LIBS@
+
+$(FFMPEGOBJS): dvdpcodecs
endif
OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
@@ -509,6 +513,12 @@ ifneq (@USE_LIBXBMC@,1)
MAINOBJS+=xbmc/main/main.o
endif
+xbmc/xbmc.o xbmc/xbmc.a: xbmc
+
+xbmc/android/activity/android_main.o xbmc/android/activity/activity.a: xbmc/android/activity
+
+xbmc/main/main.o xbmc/main/main.a: xbmc/main
+
# sync these entries manually with tools/depends/target/xbmc-addon-bindings/Makefile
BINDINGS =xbmc/addons/include/xbmc_addon_cpp_dll.h
BINDINGS+=xbmc/addons/include/xbmc_addon_dll.h
@@ -535,9 +545,6 @@ else
$(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
endif
-xbmc/main/main.a: force
- $(MAKE) -C xbmc/main
-
@elupus Collaborator
elupus added a note

This rule should still remain.

@wsnipex Collaborator
wsnipex added a note

hmm, we have xbmc/main already in DIRS.
would keeping this rule be the same as we had before with ffmpeg?

@elupus Collaborator
elupus added a note

I can't see anything actually defining DIRS as targets thou.

Yeah I don't see how it works either. *DIRS are only used for clean targets AFAICT.

Hrm... Actually, I wonder if we get lucky at the fact that the FS/mount options update the dir's mtime to that of the most recently modified file within it...

@elupus Collaborator
elupus added a note

that wouldn't help. something must have triggered a make -C xbmc/main, otherwise we wouldn't have any main.a file?

@wsnipex Collaborator
wsnipex added a note

tbh I just assumed this was some automake magic/implicit rule when I noticed that xbmc/main was being called twice sometimes, which produced the "cannot stat main.d".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS) xbmc/main/main.a
ifeq ($(findstring osx,@ARCH@), osx)
Something went wrong with that request. Please try again.