[Tarantool-patches] [PATCH v1.1] evio: workaround for wsl1 so_linger assertion

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Mar 18 00:27:53 MSK 2020


Hi!

> : -----Original Message-----
> : From: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
> : Subject: Re: [PATCH v1.1] evio: workaround for wsl1 so_linger assertion
> : 
> : Hi! Thanks for the patch!
> : 
> : Please, keep branch link in each new email thread.
> 
> Yup, sorry for the omission, I should automate this somehow 
> (because at the moment there are too many manual steps which are 
> easy to forget or to skip. Do you have any advices/scripts here?)

Yeah, I use this:
https://gist.github.com/Gerold103/5471a7ddbeec346c0c845930d5bb9df4
But it is for bash. Don't know whether you use bash on Windows.

> : > @@ -11,6 +11,15 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
> : >  # (see man page for feature_test_macros).
> : >      add_definitions("-D_FILE_OFFSET_BITS=64")
> : >      find_package_message(PLATFORM "Building for Linux"
> : "${CMAKE_SYSTEM_NAME}")
> : > +
> : > +    # There are some subtle differences in Linux kernel calls
> : > +    # implementation under WSL1 (which should go away with WSL2 kernel)
> : > +    # so for a moment we introduce a way to distinguish Linux and
> : > +    # Microsoft/WSL1
> : > +    if (${CMAKE_SYSTEM} MATCHES "Linux-.*-Microsoft")
> : > +        add_definitions("-DTARANTOOL_WSL1_WORKAROUND_ENABLED=1")
> : > +    endif()
> : 
> : To be more consistent I would better call it TARGET_OS_WSL1.
> : Since we already have TARGET_OS_LINUX, TARGET_OS_FREEBSD,
> : TARGET_OS_DEBIAN_FREEBSD, TARGET_OS_NETBSD, TARGET_OS_DARWIN.
> : 
> 
> I did consider introducing the special target, but after some 
> evaluation I've realized that this is not a new target, but rather 
> Linux flavor (with the same abi, binutils, glibc implementation)
> but slightly different syscalls implementation. Which difference 
> after WSL2 release would go away the end of Spring 2020.
> 
> 
> : Besides, it would be consistent with other similar examples
> : such as fio_filename(), load_cfg(), make_pipe(), and so on. They
> : use TARGET_OS_* name.
> 
> And this example of fio_filename() implementation is exactly 
> and indication why WSL is still the same Linux - it is requiring the same
> exactly TARGET_OS_LINUX defined to be correctly implemented under WSL.

As you wish.

> : 
> : > +
> : >  elseif (${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
> : >      set(TARGET_OS_FREEBSD 1)
> : >      set(TARGET_OS_DEBIAN_FREEBSD 1)
> : > @@ -19,6 +28,7 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
> : >      add_definitions("-D_FILE_OFFSET_BITS=64")
> : >      find_package_message(PLATFORM "Building for Debian/kFreeBSD"
> : >          "${CMAKE_SYSTEM_NAME}")
> : > +
> : 
> : Please, omit not necessary diff. This and other new empty lines
> : below.
> :
> 
> Ok, will remove these unnecessary lines added (though they did 
> add some extra readability to the cmake scripts we have here :) ) 

Perhaps, but readability is a subjective thing usually. However
more important is that such unnecessary diff tends to pollute git
blame, and pad out patch size making it harder to review.


More information about the Tarantool-patches mailing list