lexxmark / winflexbison

Main winflexbision repository
GNU General Public License v3.0
412 stars 119 forks source link

v2.5.23 not working on Windows XP #61

Closed a11apurva closed 3 years ago

a11apurva commented 4 years ago

We migrated our entire project to v2.5.23 (Bison-3.7.1) and everything worked wonderfully on Windows 10. However today when I tried on windows-XP I am getting the following error - bison: cannot execute: %1 is not a valid Win32 application.

Win 10 -

$ bison.exe --version
bison (GNU Bison) 3.7.1
Written by Robert Corbett and Richard Stallman.

Win XP -

$ bison.exe --version
bison: cannot execute: %1 is not a valid Win32 application.

Can you please help? I was able to build my project on XP using the Bison executable for Bison-2.4

edit -

$ file bison.exe
bison.exe:      extended DOS executable (.EXE) -- Win32 or NT Portable format
GitMensch commented 4 years ago

Does it work with the current vs2015 artifact? https://ci.appveyor.com/api/buildjobs/vg8v8c5ao4urbjqj/artifacts/build%2Fwin_flex_bison-dev-2015-Win32-Release.zip

a11apurva commented 4 years ago

@GitMensch, I tried, but unfortunately it is threw the same error with this too.

lexxmark commented 4 years ago

As I remember under VS2015 we should explicitly enable XP support in project settings. I believe VS2019 doesn't support XP anymore.

You can try to build bison source code using VS2015 with proper settings but it might not compile because of outdated С++ compiler.

GitMensch commented 4 years ago

I think we should set the cmake up to let the VC2015 environment use the -xp toolset. This way we can provide it (as long as VS2015 builds it the -xp toolset should do the same; and VC2015 is also the minimal version for the gnulib parts that handle VC, so it should be fine).

lexxmark commented 4 years ago

I don't have VS2015 to test it. @GitMensch Could you test it? There is definition of the build flag needed to support XP in VS2015 https://stackoverflow.com/questions/35664861/how-to-target-windows-xp-in-microsoft-visual-studio-c/35666906

lexxmark commented 4 years ago

I have added XP support to appveyor script. The following artifact should support XP https://ci.appveyor.com/api/buildjobs/ri8fcm5b4c0qgc68/artifacts/build%2Fwin_flex_bison-dev-2015-Win32-Release.zip

@a11apurva Please verify.

a11apurva commented 3 years ago

Hi @lexxmark, works as expected.

$ systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 7 Enterprise
OS Version:                6.1.7601 Service Pack 1 Build 7601

$ bison --version
bison (GNU Bison) 3.7.1
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks a lot! Closing the issue.

GitMensch commented 3 years ago

Hm, I think one last piece is missing:

@lexxmark what do you think?

lexxmark commented 3 years ago

Hm, I think one last piece is missing:

Yes that makes sense.

OS Name: Microsoft Windows 7 Enterprise

@a11apurva why did you test on Windows7 system and not WindowsXP?

a11apurva commented 3 years ago

@a11apurva why did you test on Windows7 system and not WindowsXP?

That was such a blunder. Apologies.

Same error on XP still -

$ systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft(R) Windows(R) XP Professional x64 Edition
OS Version:                5.2.3790 Service Pack 2 Build 3790
$ bison --version
bison: cannot execute: %1 is not a valid Win32 application.
GitMensch commented 3 years ago

Please directly cd to the place where the archive was extracted and use win_bison.exe --version - same message?

a11apurva commented 3 years ago

Tried it on another XP system -

winBison1
GitMensch commented 3 years ago

@lexxmark You set the VC var PLATFORMTOOLSET, but this is only honored by msbuild. My guess is that CMAKE_VS_PLATFORM_TOOLSET should be set from this variable.

lexxmark commented 3 years ago

You set the VC var PLATFORMTOOLSET, but this is only honored by msbuild. My guess is that CMAKE_VS_PLATFORM_TOOLSET should be set from this variable.

Can you try this?

lexxmark commented 3 years ago

@a11apurva Please verify that package https://ci.appveyor.com/api/buildjobs/s1nbkybjat8ysfiv/artifacts/build%2Fwin_flex_bison-dev-2015-Win32-Release.zip

a11apurva commented 3 years ago

I haven't tested on XP yet as the machine is down, but it says Bison 3.7.4, is this the correct package?

lexxmark commented 3 years ago

yes, that's correct. I'm migrating to bison 3.7.4 if it works we can rollup windows XP fix for any version we need.

a11apurva commented 3 years ago

I am afraid, still not working on XP -

image

lexxmark commented 3 years ago

It seems I have to manage to enforce Visual Studio to build project with v140_xp toolset.

The only problem still is that appveyor don't supply VS with such a toolset. Have to dig further.

a11apurva commented 3 years ago

We have moved all our systems to win10.

If there are no other takers for the Bison with XP support then you guys can park this for now.

lexxmark commented 3 years ago

OK, I'm going to remove VS2015 support and all XP stuff then.

I think VS2017/VS2019 support would be enough.

GitMensch commented 3 years ago

I initially was thinking that this is a bad idea, but came to the conclusion that this is fine - people can use an older version for old parsers. The question is: what is the latest release that actually has XP support? Maybe we can hand-craft a version and attach it to one of the releases, adding a release note "last with XP support"?

lexxmark commented 3 years ago

@GitMensch Are you talking about winflexbison3? I think the regular winflexbison2 last version has XP support.

Someone who will need XP support will help us determine exact winflexbison3 version supporting XP then. I hope no one needed XP support anymore.

GitMensch commented 3 years ago

I think the regular winflexbison2 last version has XP support.

I've jsut tested that with an old VM (Windows Version 5.1 XP SP3 32bit).

Yes, winflexbison2 last version works, winflexbison 2.5.22 (bison 3.5.0, flex 2.6.4) is the most current one that works, from 2.5.23 I see the same failures as here.

... this does make me wonder: what has changed in between?

lexxmark commented 3 years ago

this does make me wonder: what has changed in between?

My guess is that I just started to create releases by new version of Visual Studio which doesn't support XP any more.