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

Get bazel functioning on AppVeyor #467

Open
philipcraig opened this issue Dec 13, 2018 · 6 comments
Open

Get bazel functioning on AppVeyor #467

philipcraig opened this issue Dec 13, 2018 · 6 comments
Assignees

Comments

@philipcraig
Copy link
Contributor

No description provided.

@philipcraig philipcraig self-assigned this Dec 13, 2018
@philipcraig
Copy link
Contributor Author

The story so far. On Windows, bazel ffig builds fail.
e.g.
bazel build --verbose_failures //:Shape.net.src produces:

INFO: Invocation ID: 78291982-5704-4d99-af80-f6284f2862dd
Loading:
Loading: 0 packages loaded
Analyzing: target //:Shape.net.src (0 packages loaded, 0 targets configured)
INFO: Analysed target //:Shape.net.src (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
[0 / 2] [-----] Executing genrule //:Shape.net.src
[1 / 2] Executing genrule //:Shape.net.src; 1s local
ERROR: C:/work/ffig/BUILD:47:1: Executing genrule //:Shape.net.src failed (Exit 1): bash.exe failed: error executing command
  cd C:/users/philip/_bazel_philip/qj5frnln/execroot/__main__
  SET PATH=C:\tools\msys64\usr\bin;C:\tools\msys64\bin
  C:/tools/msys64/usr/bin/bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/ffig_py.exe -i tests/input/Shape.h -m Shape -o bazel-out/x64_windows-fastbuild/genfiles -b cs.tmpl --cflag=-Itests/input --cflag=-Iffig/include --cflag=-std=c++14 --cflag=-DShape_c_EXPORTS
Execution platform: @bazel_tools//platforms:host_platform

The errors in the above are related to not finding libclang.dll (as the path to LLVM has been removed from the path) and then (if this is manually corrected) not finding the <cmath> include file, as Visual Studio is also not being set by Bazel in the above. I suspect that on Linux/Darwin, gcc/clang have the location of their include files encoded into their binaries, so that they can always be found, whereas Windows doesn't.

Investigations continue into why bazel is shortening the path so much on Windows and how this can be cirvumvented

@jbcoe
Copy link
Collaborator

jbcoe commented Dec 13, 2018

Nice work!

@philipcraig
Copy link
Contributor Author

Also looked into what successful bazel windows builds (the one that ships with bazel) look like.
bazel print_action //examples/cpp:hello-lib outputs a bunch of things. The main thing I notice is that Bazel knows which steps are doing C++ things (mnemonic: "CppCompile"), so sets up the PATH and INCLUDE variables correctly. Wonder if ffig bazel windows version needs to mark its tasks that use libClang as cpp tasks in some way.

@philipcraig
Copy link
Contributor Author

Now also wondering if all this is because (at least) ffig.bzl has hard-coded Linux specific things

@jbcoe
Copy link
Collaborator

jbcoe commented Dec 17, 2018

Which are the hard-coded Linux things?

@philipcraig
Copy link
Contributor Author

Hi, to backtrack a little, perhaps the bazel task that runs FFIG.py should become a C++ Bazel task. This is so that the Bazel will set up the correct C++ environment on Windows, bringing the INCLUDE dir in. This could be done via something like here https://stackoverflow.com/q/52769846/105050, making the call to FFIG.py use the cc_common API.

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

2 participants