Comments (16)
will look into it
from winflexbison.
I invoked win_bison.exe --update calc.y
without any errors on the latest version
Please provide more details to reproduce
from winflexbison.
If you introduce some updatable code it will fail, e.g.:
%error-verbose
from winflexbison.
Thank you, I have reproduced it.
The input file remain opened (by caret_info global variable) during renaming calc.y to calc.y~ in fixits_run() function.
It seems on Linux it's legitimate operation. Please correct me if I'm wrong.
On windows this situation leads to a Permission denied error.
There are two options:
- Report a defect to upstream bison project with hope it will be fixed there (it seems not really a problem on linux)
- Try to fix it in winflexbison (may be send pull request to bison project afterwards)
from winflexbison.
You can rename files with an open handle normally fine (all open handles will still be valid), on linux you can additionally delete or overwrite the file (all open handles will still be valid, on Windows the delete/overwrite fails).
But concerning the current issue: discussing with upstream seems reasonable, then likely close, copy, reopen.
from winflexbison.
You can rename files with an open handle normally fine (all open handles will still be valid)
Are you sure it's true for windows? Why we are getting Permission denied error?
from winflexbison.
I'm sure that this is true when you rename a file via Windows Explorer which may means that either different ways of doing the rename are needed or that only a different process can rename the file.
from winflexbison.
I was performing debugging and after opening file in win_bison tried to rename it in Windows Explorer. It didn't allow me with error that file is used in win_bison
from winflexbison.
Hm, can you rename the containing folder? if not then my mind has played me a trick and this is only possible for files opened for read (which does work, doesn't it?)
from winflexbison.
I found this article http://blog.httrack.com/blog/2013/10/05/creating-deletable-and-movable-files-on-windows
So windows fopen function locks file in any mode ('r' as well).
from winflexbison.
In bison code I found two "fopen" calls. It makes sense to replace them with function from article.
from winflexbison.
Thank you for sharing the article. I've had a hope that the gnulib fopen module (not checked if bison uses it already) would fix this, but as https://www.gnu.org/software/gnulib/manual/html_node/fopen.html doesn't mention that part i guess not.
So what should be done next?
- investigate if the gnulib module is used, and if not if it would solve the issue (using the fopen module may be easily done upstream)
- work around the issue by manually wrapping fopen as mentioned in the article - in this case likely not replacing the calls in the code but add an extra definition and a
#define fopen fopen_unixlike
from winflexbison.
Rechecked: the current gnulib fopen imnplementation does nothing like the article, it may still be most reasonable to adjust this module, use it and send it upstream to gnulib. Then let upstream bison use the updated module (preventing the need for patching again and again).
What do you think?
Side note: I'm just remembering that we have #17, using those would likely have caught this issue up-front...
from winflexbison.
I haven't found fopen definition in the winflexbison code, it uses system function defined in "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h"
I replaced fopen with fopen_unixlike and it solved the problem.
Will use define you suggested #define fopen fopen_unixlike
from winflexbison.
Side note: I'm just remembering that we have #17, using those would likely have caught this issue up-front...
It seems I fixed the problem with binary mode. If you need something else from me there let me know.
from winflexbison.
When you already define the function I'd suggest to add that part of the gnulib definition "just in case":
#if defined _WIN32 && ! defined __CYGWIN__
if (strcmp (filename, "/dev/null") == 0)
filename = "NUL";
#endif
from winflexbison.
Related Issues (20)
- Bison-3.7.2 HOT 2
- v2.5.23 not working on Windows XP HOT 25
- Crash on invalid input HOT 6
- Visual Studio - win_bison creates tab.h file exceeding compiler limits HOT 8
- Update to bison 3.7.4 HOT 10
- Trouble compiling a *.l file using CMake HOT 7
- %option c++ is not compatible with %option noyywrap - linker error: multiple definition HOT 5
- Install guide lines? HOT 3
- Loss of data conversion in Flex scanner. HOT 5
- Update to Bison 3.8.1 HOT 11
- Missing LICENSE/COPYING file in repository toplevel HOT 6
- Cannot compile Bison input in C++ mode HOT 2
- Visual Studio dependencies and the provided CustomBuildRules HOT 3
- Could this project build with gcc HOT 2
- Runtime error when running multiple flex processes HOT 19
- D language support fixes reported upstream
- Using api.prefix{ ... } breaks yyerror()
- Chocolatey for 2.5.25 (Bison 3.8) HOT 1
- BSD license and GPL license missing from the binary package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winflexbison.