google / vxsig

Automatically generate AV byte signatures from sets of similar binaries.
Apache License 2.0
259 stars 33 forks source link

build error on windows: xargs: command not found #8

Open romanholidaypancakes opened 1 year ago

romanholidaypancakes commented 1 year ago
bazel build -c opt //vxsig:vxsig
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Repository com_google_binexport instantiated at:
  D:/test/vxsig/WORKSPACE:50:13: in <toplevel>
Repository rule http_archive defined at:
  C:/users/user123456/_bazel_admin/4uuzjk7y/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
ERROR: An error occurred during the fetch of repository 'com_google_binexport':
   Traceback (most recent call last):
        File "C:/users/user123456/_bazel_admin/4uuzjk7y/external/bazel_tools/tools/build_defs/repo/http.bzl", line 143, column 10, in _http_archive_impl
                patch(ctx, auth = auth)
        File "C:/users/user123456/_bazel_admin/4uuzjk7y/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 193, column 21, in patch
                fail("Error applying patch command %s:\n%s%s" %
Error in fail: Error applying patch command find . -path ./third_party -prune -o \( -name '*.cc' -o -name '*.h' \) -print0 |xargs -0 -P8 -n1 sed -i.bak 's,^\(#include "\)third_party/\(absl\),\1\2,g':
FIND: ������ʽ����ȷ
/usr/bin/bash: line 1: xargs: command not found
ERROR: D:/test/vxsig/WORKSPACE:50:13: fetching http_archive rule //external:com_google_binexport: Traceback (most recent call last):
        File "C:/users/user123456/_bazel_admin/4uuzjk7y/external/bazel_tools/tools/build_defs/repo/http.bzl", line 143, column 10, in _http_archive_impl
                patch(ctx, auth = auth)
        File "C:/users/user123456/_bazel_admin/4uuzjk7y/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 193, column 21, in patch
                fail("Error applying patch command %s:\n%s%s" %
Error in fail: Error applying patch command find . -path ./third_party -prune -o \( -name '*.cc' -o -name '*.h' \) -print0 |xargs -0 -P8 -n1 sed -i.bak 's,^\(#include "\)third_party/\(absl\),\1\2,g':
FIND: ������ʽ����ȷ
/usr/bin/bash: line 1: xargs: command not found
ERROR: D:/test/vxsig/vxsig/BUILD.bazel:438:10: //vxsig:vxsig depends on @com_google_binexport//:filesystem in repository @com_google_binexport which failed to fetch. no such package '@com_google_binexport//': Error applying patch command find . -path ./third_party -prune -o \( -name '*.cc' -o -name '*.h' \) -print0 |xargs -0 -P8 -n1 sed -i.bak 's,^\(#include "\)third_party/\(absl\),\1\2,g':
FIND: ������ʽ����ȷ
/usr/bin/bash: line 1: xargs: command not found
ERROR: Analysis of target '//vxsig:vxsig' failed; build aborted: Analysis failed
INFO: Elapsed time: 35.611s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (37 packages loaded, 124 targets configured)
cblichmann commented 1 year ago

Hi there! Thanks for the report. I should've included a section on supported OSes in the README. While the code does work on Windows when built with a manually created Visual Studio project, I never updated the Bazel build files for VxSig for that. You could try and replace the patch commands in the WORKSPACE file with something more appropriate on Windows (a Powershell script maybe?). I'm not yet sure how to fix this and not break the Linux build.

romanholidaypancakes commented 1 year ago

maybe it is more appropriate to provide vs project files in windows

cblichmann commented 9 months ago

Bummer, still no compilation on Windows, because the protobuf Bazel build is broken in 23.1:

ERROR: C:/users/win11-devel/_bazel_win11-devel/lnjrh73z/external/protobuf~23.1/src/google/protobuf/compiler/csharp/BUILD.bazel:22:11: Compiling src/google/protobuf/compiler/csharp/csharp_enum.cc [for tool] failed: (Exit 2): cl.exe failed: error executing CppCompile command (from target @@protobuf~23.1//src/google/protobuf/compiler/csharp:csharp) C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\cl.exe ... (remaining 1 argument skipped)
bazel-out/x64_windows-opt-exec-ST-13d3ddad9198/bin/external/protobuf~23.1/src/google/protobuf/compiler/csharp/_virtual_includes/csharp\google/protobuf/compiler/csharp/csharp_enum.h(37): fatal error C1083: Cannot open include file: 'google/protobuf/compiler/csharp/csharp_source_generator_base.h': No such file or directory
Target //vxsig:vxsig failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 176.753s, Critical Path: 17.42s
INFO: 203 processes: 6 internal, 197 local.
ERROR: Build did NOT complete successfully