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

Predef always fails on Windows with build-dir directive #32

Open
chambm opened this issue Aug 7, 2015 · 4 comments
Open

Predef always fails on Windows with build-dir directive #32

chambm opened this issue Aug 7, 2015 · 4 comments
Assignees
Labels

Comments

@chambm
Copy link

chambm commented Aug 7, 2015

Hi Rene,

I'm trying to use predef in my Boost.Build project but have run into a strange issue. The check programs like "predef_check_as_cpp.exe" are supposed to return 1 when the check is false, right? I created a test case showing some strange issues on Windows:

Jamroot.jam:

import path ;

path-constant BUILD_PATH : build ;

import predef/check/predef : require check : predef-require predef-check ;

project pwiz 
    : requirements 
        [ predef-check "BOOST_COMP_GNUC >= 4.8" : : <cxxflags>-Wno-unused-local-typedefs ]
        [ predef-check "BOOST_COMP_GNUC >= 4.9" : : <cxxflags>-fdiagnostics-color=always ]

    # comment out the next line and predef works on Windows; on Linux it works either way
    : build-dir $(BUILD_PATH)
    : default-build release
    ;

exe predef_test : predef_test.cpp ;

On Windows/MSVC-12, that's causing this:

predef.predef_check_action check\predef\bin\msvc-12.0\debug\threading-multi\3567d106897dec7fe92d032e763161c1.txt

    check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_as_cpp.exe check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_as_cpp.pdb "BOOST_COMP_GNUC >= 4.8" > check\predef\bin\msvc-12.0\debug\threading-multi\3567d106897dec7fe92d032e763161c1.txt

...failed predef.predef_check_action check\predef\bin\msvc-12.0\debug\threading-multi\3567d106897dec7fe92d032e763161c1.txt...
...removing check\predef\bin\msvc-12.0\debug\threading-multi\3567d106897dec7fe92d032e763161c1.txt
...failed updating 1 target...
Performing configuration checks

    - BOOST_COMP_GNUC >= 4.8   : no
...found 1 target...
...updating 1 target...
predef.predef_check_action check\predef\bin\msvc-12.0\debug\threading-multi\150e0cfdde3cea25efb86d81e179ac7a.txt

    check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_as_cpp.exe check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_as_cpp.pdb "BOOST_COMP_GNUC >= 4.9" > check\predef\bin\msvc-12.0\debug\threading-multi\150e0cfdde3cea25efb86d81e179ac7a.txt

...failed predef.predef_check_action check\predef\bin\msvc-12.0\debug\threading-multi\150e0cfdde3cea25efb86d81e179ac7a.txt...
...removing check\predef\bin\msvc-12.0\debug\threading-multi\150e0cfdde3cea25efb86d81e179ac7a.txt
...failed updating 1 target...
    - BOOST_COMP_GNUC >= 4.9   : no
...found 1 target...
...updating 1 target...
config-cache.write C:\pwiz-src\trunk\pwiz\predef-test\build-nt-x86_64\project-cache.jam
...updated 1 target...
...found 16 targets...

You can see it's building as debug even if I build the rest of the project is building as release, and it's also passing the pdb to the check command. If I edit predef.jam to build as release, then it still fails, but this time it fails because the return code is 1. I don't understand that. The predef.jam code is pretty cryptic relative to my Boost.Build skills, so I'm not sure what's going on. If I get rid of the build-dir directive, it builds fine on Windows (although it's still debug). It builds fine either way on Linux.

@grafikrobot grafikrobot added this to the 1.4 milestone Aug 7, 2015
@grafikrobot grafikrobot added the bug label Aug 7, 2015
@grafikrobot grafikrobot self-assigned this Aug 7, 2015
@grafikrobot
Copy link
Member

I was unable to repo this with the latest Predef code (develop) on OSX. I'll try on Windows a bit later. But I suspect I wont be able to repo there either. As I rewrote the BBv2 way this works to only rely on compiling the check programs (i.e. doesn't run exes). Perhaps you could try using the current develop state to see if it resolves the issues for you?

@grafikrobot
Copy link
Member

Finally got around to testing on Windows.. And sadly I get an error irrespective of the build-dir option. So still looking into it.

@grafikrobot
Copy link
Member

OK.. And got to do some more testing on Windows, with all code updated.. And everything works for me on Windows.

@chambm
Copy link
Author

chambm commented Oct 15, 2015

I updated my predef-test to the latest master and I still get the error. It still hinges on whether build-dir is specified or not:

compile-c-c++ check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_cc_3567d106897dec7fe92d032e763161c1.obj
predef_check_cc_as_cpp.cpp
c:\pwiz-src\trunk\pwiz\predef-test\predef\check\predef_check_cc.h(11) : fatal error C1189: #error :  "FAILED"

    call "C:\Users\chambem2\AppData\Local\Temp\b2_msvc_12.0_vcvarsall_x86.cmd" >nul
cl /Zm800 -nologo @"check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_cc_3567d106897dec7fe92d032e763161c1.obj.rsp"

...failed compile-c-c++ check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_cc_3567d106897dec7fe92d032e763161c1.obj...
...failed updating 1 target...
Performing configuration checks

    - BOOST_COMP_GNUC >= 4.8   : no
...found 1 target...
...updating 1 target...
compile-c-c++ check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_cc_150e0cfdde3cea25efb86d81e179ac7a.obj
predef_check_cc_as_cpp.cpp
c:\pwiz-src\trunk\pwiz\predef-test\predef\check\predef_check_cc.h(11) : fatal error C1189: #error :  "FAILED"

    call "C:\Users\chambem2\AppData\Local\Temp\b2_msvc_12.0_vcvarsall_x86.cmd" >nul
cl /Zm800 -nologo @"check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_cc_150e0cfdde3cea25efb86d81e179ac7a.obj.rsp"

...failed compile-c-c++ check\predef\bin\msvc-12.0\debug\threading-multi\predef_check_cc_150e0cfdde3cea25efb86d81e179ac7a.obj...
...failed updating 1 target...
    - BOOST_COMP_GNUC >= 4.9   : no
...found 1 target...
...updating 1 target...

@grafikrobot grafikrobot reopened this Oct 15, 2015
@grafikrobot grafikrobot modified the milestones: boost-1.65.0, 1.4 Jun 4, 2017
chambm pushed a commit to ProteoWizard/pwiz that referenced this issue Mar 13, 2018
…g/predef#32 gets fixed)

Former-commit-id: ad7d037eaacb92a9b551aed713b5e6574837655e
@grafikrobot grafikrobot removed this from the boost-1.65.0 milestone Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants