ilogtail icon indicating copy to clipboard operation
ilogtail copied to clipboard

[FEATURE]: Windows Support for iLogtail

Open yyuuttaaoo opened this issue 2 years ago • 2 comments

Concisely describe the proposed feature Compile and run ilogtail on Windows.

Describe the solution you'd like (if any)

  • Fix windows compilation problems.

  • Make sure unittest pass on Windows.

  • Make sure ilogtail.exe works.

  • Add build solution for windows.

  • Add windows-build check in GitHub workflow. in https://github.com/alibaba/ilogtail/blob/main/.github/workflows/build.yaml Add a section

          - name: Build core on Windows
            if: matrix.runner == 'windows-2019'
            ......
    

yyuuttaaoo avatar Aug 19 '22 02:08 yyuuttaaoo

Resources:

  • Dependencies https://ilogtail-community-edition.oss-cn-shanghai.aliyuncs.com/prebuilt-dependencies/ilogtail-deps.windows-386.zip

  • An initial version of the build script build.bat.txt

  • Known problems to fix

    diff --git a/core/common/util.cpp b/core/common/util.cpp
    index 0843f1b..4c3144f 100644
    --- a/core/common/util.cpp
    +++ b/core/common/util.cpp
    @@ -25,7 +25,6 @@
     #include <execinfo.h>
     #elif defined(_MSC_VER)
     #include <Rpc.h>
    -#include "WinUuid.h"
     #endif
     #include "logger/Logger.h"
     #include "StringTools.h"
    diff --git a/core/observer/network/NetworkConfig.h b/core/observer/network/NetworkConfig.h
    index 3ebd798..2b91f14 100644
    --- a/core/observer/network/NetworkConfig.h
    +++ b/core/observer/network/NetworkConfig.h
    @@ -16,6 +16,8 @@
    
     #pragma once
    
    +#include <numeric>
    +
     #include "common/Flags.h"
     #include "config/Config.h"
     #include "interface/type.h"
    diff --git a/core/plugin/LogtailPlugin.h b/core/plugin/LogtailPlugin.h
    index d427a87..b70ced6 100644
    --- a/core/plugin/LogtailPlugin.h
    +++ b/core/plugin/LogtailPlugin.h
    @@ -17,6 +17,7 @@
     #pragma once
     #include <cstdint>
     #include <cstdlib>
    +#include <numeric>
     #include <ostream>
     #include <json/json.h>
     #include "config/Config.h"
    

yyuuttaaoo avatar Aug 19 '22 02:08 yyuuttaaoo

An updated build.bat and compile guide. There should be enough to complete "Fix windows compilation problems" task and a potential solution for Windows build. Windows编译.pdf build.bat.txt

yyuuttaaoo avatar Sep 04 '22 03:09 yyuuttaaoo

Is there any progress on windows support ?

liuhaoyang avatar Oct 09 '22 07:10 liuhaoyang

Is there any progress on windows support ?

The necessary steps have been provided as above. Interested developers in the community are welcome to claim them and complete the remaining tasks according to the above ideas.

messixukejia avatar Oct 09 '22 07:10 messixukejia

code patch was committed in #556

yyuuttaaoo avatar Dec 08 '22 05:12 yyuuttaaoo

If you want to use ilogtail as a service, you may wrap it by winsw

yyuuttaaoo avatar Mar 08 '23 08:03 yyuuttaaoo