-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
build of 0.5.1 fails #922
Comments
RGBDS 0.5.1+ requires Bison ≥ 3.0 (from 2013), which we consider reasonable. Is that fine with you? |
no, that's why i opened pr #923 - there's absolutely no reason for these changes, and you slipped it in like a trojan horse under an innocent title - "enable bison warnings" |
The reason for these changes is to simplify the code ( It was not "slipped in", those changes were in the spirit of the commit to improve reliability. These specific changes are not enabling warnings per se (as I was asking if "this is fine with you" to learn why using Bison ≥ 3.0 may not feasible or practical for you, and hopefully reach a satisfactory compromise between our goals and yours. |
Insert xkcd workflow. |
flex and bison are quite buggy codebases and it's difficult to find versions that work reliable across all packages in my distro, without going for day-long patch orgies. 2.6.2 works for all other packages so i'd like to avoid bumping it just for the sake of a single package. |
Alright. I have to run a couple errands, so I'll handle this in a few hours. I see your use case, and I understand that you may want not to patch RGBDS (though I know a couple of downstream packagers, such as the BSDs, do it for us for other minor reasons). I don't want to hard-revert those changes due to the benefits they provide, but maybe we can look into a |
that could work for %empty, though i guess not for %precedence - as your commit removed the %left operator from everywhere else. what could work is if parse.y is generated from a template (parse.y.in) using e.g. a preprocessor pass or similar on it. |
I'm personally against making the parser file and the build process more complicated for the sake of supporting an eight-year-old However, if we do end up adding a
That would isolate most of the added complexity in the Makefile (or better, in a script called by the Makefile), and the extra " |
the reason why i didn't follow up on this is because "how to do it for windows/cmake" |
If this is such an issue for you, you can build a new version of bison and instead of installing it in your system you can just override the one used in the build process:
|
for a distro author, as opposed to a distro user, this is not as easy as it sounds. |
Which distro is this one that is stuck in such an old version of everything, out of curiosity? It doesn't sound practical at all to use it. |
my distro is called sabotage linux. it's not "stuck in old versions of everything" - for example it has latest LTS kernel, latest openssh, etc - but i prefer to invest work into things that are important, and stability over features. |
Then why not stick with rgbds 0.5.0? Sure it has known bugs and missing features, but so do bison 2 and other old packages. And it's not like a Game Boy assembler is a necessary component for a Linux distro. (Especially since Sabotage Linux "refuses to add Rust", and the rgbds ecosystem is increasingly using Rust, e.g. rgbobj and rsgbgfx.) |
Also a planned RIIR of RGBDS, since a rewrite is more or less needed due to some of RGBASM's architectural decisions. It's a long-term plan, but still worth considering. |
i think you're misunderstanding my motivation. i already have a working patch for 0.5.1, which will be forward-ported as needed. i opened these issues to raise awareness of the issues caused by using a seemingly innocent new feature of some dependency. in the end, it's of course your choice whether you prefer breaking backwards compatibility for the gain of using a new keyword over comments.
that's quite unfortunate. i'd suggest the following the following literature to understand the long-term effects of this move: https://drewdevault.com/2019/03/25/Rust-is-not-a-good-C-replacement.html |
I don't know how far off a Rust rewrite is (that would be @ISSOtm 's project) but I'm considering starting a more gradual transition to C++, for the sake of using some of its features (in particular to unblock #885, but I expect RAII idioms will also make for cleaner code). Not speaking for the other maintainers, but I don't think being written in C adds any inherent value to rgbds, besides allowing well-optimized performance of native code (same as C++, Rust, Zig, Haskell, and many other languages) and being supported on "enough" platforms (anything with an LLVM backend is sufficiently portable here). Drew DeVault may think that "concurrency is generally a bad thing" and that "Yes, Rust is more safe. I don’t really care." but in practice C has been a cause of rgbds issues (use-after-free, buffer overflows, null-terminated strings, having to manually malloc/free, undefined behavior, etc) not a solution to them (yes, C has a spec and only "0.73 new features per year"; I don't really care). (Even he is aware enough of C's issues to be building a new systems language.) |
I think I've spoken loudly enough against Rust in every venue I've been afforded to not be mistaken for a Rust supporter, but I'll go ahead and say this: rewriting RGBDS in C++, Rust, or any other similar language is not inherently harmful. I'm a user, not a maintainer. I've contributed very little code to RGBDS. And from a user's perspective, what matters is that the software (1) works, and works well, (2) is easy to build and update, and (3) can be installed on any platform I use. (1) and (3) are equally true of all those languages. (2) is fine for C++, but more problematic for Rust, because Rust loves being the odd one out and using a build process that is different from the rest of the universe (including fetching packages from the Internet as part of the process!), but I assume skilled Rust devs could wrap this into a build process that is compatible with the world and doesn't require (or use) an active connection to the Internet. So I'd fully support moving to a language the maintainers are comfortable writing in, whatever that may be, as long as the conditions I mentioned above are preserved. In the case of Rust, that probably means writing a simple makefile that wraps |
I think that a transition to C++ is far more realistic (and so, more likely to actually happen) than a complete rewrite in Rust. It would also keep the build system simple, which is crucial, in my opinion. I kinda hate the kind of things that some people do with C++, though. |
I don't plan on doing anything weird with class inheritance or templates (probably no need for templates at all, unless we have like three+ functions which are identical except for types). Feel free to critique PRs for being too C++ featureful if/when I work on that. :P |
i doubt it's been C causing those issues, but programmers using it incorrectly...
i see you already refactored the code to use a struct string, which seems like a good way forward. what i glanced from the PR it seems almost complete and there's probably not a lot left to change - a rewrite using C++ would be a whole lot more work. btw, here's what linus torvalds thinks of C++: http://harmful.cat-v.org/software/c++/linus |
Both C++ and Linus were very different in 2007 than in 2021. By now not even C++ but Rust is even making its way into Linux, at least for device drivers. If you want to complete that PR I'd really appreciate it; it's not like I'm going to be tackling it in the next week or so. Even so, it's basically a tedious reimplementation of what C++ (or any language with a built-in memory-managed (counting RAII) Also the first file I checked in |
The problem is that what there is to change is making it work with the entirety of |
C++ is a bad language for a kernel for the simple fact that the language does memory management without your control. For example, I was once writing a firmware for a microcontroller, and someone decided to start adding C++ stuff. It took myself and another guy a couple of hours to convince him that his However, If you just use C with classes and maybe with operator overloading and things like that... the result tends to be okay. Just avoid the C++ standard library... and almost every other library. I would use |
you're looking in the wrong place, the string+size struct stuff is provided by src/stringptr - and the purpose of strlib is to pull in as little of libc as possible, to keep static binaries small (iirc the only libc funcs called are memcpy and malloc* - and the latter only if a *_new func is used)
that's true, but once C++ is being used, you're automatically attracting C++ "wizards", which will start opening PRs using their favorite feature subset... just as linus points out in that article. |
Sure, but we can simply review out unnecessarily complex code from contributions. (Whether you trust us not to write such code ourselves is left as an exercise to the reader.) As for the possible performance impact of such a decision, we do not have any performance regression tests yet because we haven't figured out how to do those, but please feel free to chime in to #653 if you have any ideas. |
my bison version compiles everything else (an entire linux distro) fine - rgbds is the only program using these bleeding egde features.
The text was updated successfully, but these errors were encountered: