Page MenuHomePhabricator

Tests: remove warnings when compiling tests if fork is not available
Needs ReviewPublic

Authored by vtorri on Jun 13 2018, 9:15 PM.

Details

Test Plan

compilation

Diff Detail

Repository
rEFL core/efl
Branch
evil_msvc
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6720
Build 6779: arc lint + arc unit
vtorri created this revision.Jun 13 2018, 9:15 PM
vtorri requested review of this revision.Jun 13 2018, 9:15 PM
zmike added a comment.Jun 14 2018, 5:27 AM

I think maybe it would be better to just #ifdef out all the fork-related code there including the variables since you don't want fork in your build?

vtorri updated this revision to Diff 14962.Jun 15 2018, 4:28 AM
lauromoura requested changes to this revision.Jun 15 2018, 6:04 AM

It seems dbus-launch invocation is different from dbus-run-session and can't be used as a drop-in replacement. dbus-launch will start a new bus session and give the code to set the DBUS_SESSION_* variables to this new bus, while 'dbus-run-sesssion' takes a command and runs it on a new shell.

By this gnome patch, we could mimic 'dbus-run-session' by using something like the following script as a the LOG_COMPILER driver:

#!/bin/sh
 
# Spawn DBus
eval `dbus-launch --sh-syntax`
trap "kill $DBUS_SESSION_BUS_PID" EXIT

"$@"
This revision now requires changes to proceed.Jun 15 2018, 6:04 AM
./dbus-session.sh: ligne 7: -- : commande introuvable
kill : utilisation :kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... ou kill -l [sigspec]
FAIL tests/evil/evil_suite.exe (exit status: 127)

with dbus-session.sh being the script given by lauromoura

./dbus-session.sh: ligne 7: -- : commande introuvable
kill : utilisation :kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... ou kill -l [sigspec]
FAIL tests/evil/evil_suite.exe (exit status: 127)

with dbus-session.sh being the script given by lauromoura

Could you change it to echo the value of $DBUS_SESSION_BUS_PID to see what it is trying to trap kill?

lauromoura added inline comments.Jun 15 2018, 2:56 PM
src/Makefile.am
10

This should be the cause: automake passes -- as a prefix to the actual command, thus the '-- not found' errors. As the script receives no '-' arguments, probably we can remove it safely.

Also, what about merging in the changes from D6263 and adapt to keep Linux using dbus-run-session normally and only Windows using the dbus-launch wrapper?

vtorri updated this revision to Diff 15094.Jun 20 2018, 1:44 PM
  • Evil: fix usage of Evil in a program compiled with vc++

hmm, arc diff fucked up this diff, i need help to restore the previous state...

zmike added a comment.Jun 20 2018, 1:48 PM

Try just uploading it again?

vtorri updated this revision to Diff 15154.Jun 22 2018, 1:20 PM
  • Tests: remove warnings when compiling tests if fork is not available and run tests properly on Windows

ok, tests are run now, i have 12 successful tests and 15 which fail

zmike requested changes to this revision.Jun 22 2018, 1:32 PM

This changes the decl of pid which causes compile errors:

In file included from tests/eina/eina_suite.h:23:0,
                 from tests/eina/eina_test_abi.c:23:
tests/eina/../efl_check.h: In function ‘_efl_suite_build_and_run’:
tests/eina/../efl_check.h:310:26: error: ‘pid’ undeclared (first use in this function); did you mean ‘pipe’?
         if (do_fork && (!pid) && can_fork)
This revision now requires changes to proceed.Jun 22 2018, 1:32 PM
zmike added a comment.Jun 22 2018, 1:38 PM

Let's agree to let this run through CI in a dev branch before it eventually gets merged to master...

patch update

ok for CI

zmike added a comment.Jun 22 2018, 1:56 PM

Will push this to a CI branch in a moment...

zmike added a comment.Jun 25 2018, 3:45 AM

@lauromoura I will wait on your review before taking further action with this patch since you were looking into this for some time.

In D6286#109365, @zmike wrote:

@lauromoura I will wait on your review before taking further action with this patch since you were looking into this for some time.

Still getting a bunch of failures due to dbus-launch not working correctly. No matter what flag I use to invoke it, it exits silently with code 0 and no output. According to msys' pacman, I'm using mingw64/mingw-w64-x86_64-dbus 1.12.8-1.

This causes to the DBUS_SESSION_BUS_PID variable not being set, thus breaking the kill call.

Is there anything else I should do to get dbus-launch to work?

(By the way, the code compiles fine with this patch)

From https://cgit.freedesktop.org/dbus/dbus/tree/tools/dbus-launch-win.c

* This version also doesn't print out any information, which is a
* main point of the UNIX one. It should at least support the
* --sh-syntax option, and maybe also a --cmd-syntax to print out the
* variable settings in cmd.exe syntax?
* 
* NOTE (rh): The main task of dbus-launch is (from the man page) to start 
* a session bus and this is archieved by the current implemention. 
* 
* Additional on windows the session bus starting in not integrated 
* into the logon process, so there is no need for any --syntax option. 
* In fact (at least for kde on windows) the session bus is autostarted 
* with the first application requesting a session bus.

Removed the call to dbus-session and it didn't seem to affect anything other than the kill errors.

Added the test-suite.log contents to P222

make check results:

make  check-TESTS
PASS: tests/evil/evil_suite.exe
FAIL: tests/eina/eina_suite.exe
PASS: tests/eo/test_children.exe
PASS: tests/eo/test_access.exe
PASS: tests/eo/test_composite_objects.exe
PASS: tests/eo/test_constructors.exe
FAIL: tests/eo/eo_suite.exe
FAIL: tests/eo/eo_suite_add_fallback.exe
PASS: tests/eo/test_function_overrides.exe
PASS: tests/eo/test_interface.exe
PASS: tests/eo/test_mixin.exe
PASS: tests/eo/test_signals.exe
PASS: tests/efl/efl_suite.exe
FAIL: tests/emile/emile_suite.exe
FAIL: tests/eet/eet_suite.exe
FAIL: tests/eolian/eolian_suite.exe
  SHADERS  lib/ector/gl/shader/ector_gl_shaders.x
PASS: tests/ector/suite/ector_suite.exe
FAIL: tests/ecore/ecore_suite.exe
FAIL: tests/ecore/efl_app_suite.exe
FAIL: tests/evas/evas_suite.exe
FAIL: tests/eldbus/eldbus_suite.exe
FAIL: tests/ecore_con/ecore_con_suite.exe
FAIL: tests/efreet/efreet_suite.exe
FAIL: tests/eio/eio_suite.exe
FAIL: tests/edje/edje_suite.exe
FAIL: tests/elementary/elm_suite.exe
PASS: tests/elementary/efl_ui_suite.exe
FAIL: tests/eina_cxx/eina_cxx_suite.exe
PASS: tests/eo_cxx/eo_cxx_suite.exe
FAIL: tests/ecore_cxx/ecore_cxx_suite.exe
PASS: tests/ecore_cxx/cxx_compile_test.exe
FAIL: tests/eet_cxx/eet_cxx_suite.exe
FAIL: tests/eldbus_cxx/eldbus_cxx_suite.exe
PASS: tests/evas_cxx/cxx_compile_test.exe
PASS: tests/elementary_cxx/cxx_dummy_compile_test.exe
FAIL: tests/eolian_cxx/eolian_cxx_suite.exe`

i use d-bus from win-builds

do you know how your d-bus has been compiled ?

i use d-bus from win-builds

do you know how your d-bus has been compiled ?

I think it's from win-builds. which dbus-launch shows it comes from /opt/windows_64

@lauromoura but you said : "According to msys' pacman, I'm using mingw64/mingw-w64-x86_64-dbus 1.12.8-1." ?!?!?

vtorri updated this revision to Diff 15379.Jun 28 2018, 11:07 PM
  • Evil: fix usage of Evil in a program compiled with vc++
  • Evil: fix usage of Evil in a program compiled with vc++ this should be enough to fix #T5206

Mixed up revisions?

yes

i will open a new ticket instead of trying to fix this mess, arcanist is too complicated for me

zmike added a comment.Jul 5 2018, 12:13 PM

I think you should just be able to push a new revision over this one again

zmike added a comment.Aug 15 2018, 5:16 AM

@vtorri if you are not going to push a new revision over this then you should abandon this revision.

i can't test anything until september, just look at code
i will abandon it and open another one, then, but in september