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

races between process.exe and libicalss_cxx.a #238

Closed
starius opened this issue Jul 16, 2016 · 6 comments
Closed

races between process.exe and libicalss_cxx.a #238

starius opened this issue Jul 16, 2016 · 6 comments

Comments

@starius
Copy link

starius commented Jul 16, 2016

Following on from dcc40c7 and #219, libical build still fails sometimes when run with make -j 4.

I'm building libical as a part of MXE.
Build script: https://github.com/mxe/mxe/blob/master/src/libical.mk
Patch applied to libical: https://github.com/mxe/mxe/blob/master/src/libical-1-fixes.patch
Version of libical: 2.0.0

When I was rebuilding all MXE packages, libical build failed. It is not reproducible, but I have a log:

[ 91%] Linking CXX executable process.exe
[ 91%] Linking CXX static library ../../bin/libicalss_cxx.a
make[4]: Leaving directory '/home/dell/mxe/tmp-libical-i686-w64-mingw32.static/libical-2.0.0/build'
[ 91%] Built target icalss_cxx
[ 92%] Building C object src/test/CMakeFiles/regression.dir/regression-utils.c.obj
/home/dell/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find ../../bin/libicalss_cxx.a: No such file or directory
collect2: error: ld returned 1 exit status
src/test/CMakeFiles/process.dir/build.make:102: recipe for target 'src/test/process.exe' failed
make[4]: *** [src/test/process.exe] Error 1
make[4]: Leaving directory '/home/dell/mxe/tmp-libical-i686-w64-mingw32.static/libical-2.0.0/build'
CMakeFiles/Makefile2:1013: recipe for target 'src/test/CMakeFiles/process.dir/all' failed
make[3]: *** [src/test/CMakeFiles/process.dir/all] Error 2
make[3]: *** Waiting for unfinished jobs....

Full version: https://gist.github.com/78ee244a0a628f8b23799d66ca5c8d7a

It looks as a race between process.exe and libicalss_cxx.a.

Output of make -nd applied after the failed build:
https://gist.github.com/e948dec593f1ca84533a757e9d110360

The output of make -nd suggests that process.exe does depend on libicalss_cxx.a. I do not know why libicalss_cxx.a did not exist when process.exe was linking.

@winterz
Copy link
Member

winterz commented Jul 18, 2016

I verify this when cross-compiling.
Can you try this patch https://paste.kde.org/pi5x1vwen

@tonytheodore
Copy link

With the patch above, I'm seeing slightly different errors:

Scanning dependencies of target icalss_cxx
[ 78%] Building CXX object src/libicalss/CMakeFiles/icalss_cxx.dir/icalspanlist_cxx.cpp.obj
[ 79%] Linking C static library ../../bin/libicalvcal.a
[ 79%] Linking CXX static library ../../bin/libicalss_cxx.a
[ 79%] Built target icalvcal
Scanning dependencies of target testvcal
Scanning dependencies of target testmime
make[4]: *** No rule to make target `bin/libicalss_cxx.a', needed by `src/test/testvcal.exe'.  Stop.
make[4]: *** Waiting for unfinished jobs....
Scanning dependencies of target parser
Scanning dependencies of target process
Scanning dependencies of target copycluster
make[4]: *** No rule to make target `bin/libicalss_cxx.a', needed by `src/test/testmime.exe'.  Stop.
make[4]: *** Waiting for unfinished jobs....
make[4]: *** No rule to make target `bin/libicalss_cxx.a', needed by `src/test/parser.exe'.  Stop.
make[4]: *** Waiting for unfinished jobs....
make[4]: *** No rule to make target `bin/libicalss_cxx.a', needed by `src/test/process.exe'.  Stop.

Full log https://gist.github.com/tonytheodore/16ddf6df366557ef9b40dba64c582d71

@tonytheodore
Copy link

I do not know why libicalss_cxx.a did not exist when process.exe was linking.

It appears to be built twice:

[ 17%] Linking CXX static library ../../bin/libicalss_cxx.a
...
[ 91%] Linking CXX executable process.exe
[ 91%] Linking CXX static library ../../bin/libicalss_cxx.a

@tonytheodore
Copy link

I believe the cause of the double build is that icalvcal-static is added as a library, then it's output is renamed to icalvcal when not MSVC.

A similar renaming is done for ical, icalss and the _cxx variants.

@winterz
Copy link
Member

winterz commented Sep 5, 2016

in the master branch I just commited 825e25a that might fix this issue. I tested every combination I could think of. Please test.

@winterz
Copy link
Member

winterz commented Nov 27, 2016

no response in almost 3 months. closing. please re-open if you still encounter this problem in master branch.

@winterz winterz closed this as completed Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants