-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
*WIP* Make-based build system #2
Comments
Comment by ismaell Anyone tried it? |
Comment by ghost I just tried it. Is this meant to replace the existing shell/command script because currently the shell script does a lot more:
Your Makefile appears to only do the last step, and it doesn't copy anything from internal/source to internal/temp, resulting in errors like the following with a fresh checkout:
If I invoke While I understand a Makefile won't do everything listed above, it should at least do steps 2, 4, and 6 in my opinion. I haven't looked at the FreeType stuff in detail, so I'm unsure if that's also a requirement or not. |
Comment by FellippeHeitor We are probably sticking with the default script for now, based on the feedback above. @ismaell: if you have anything else to add to the original pull request that we haven't been able to take into consideration yet, please let me know, or I'l bel closing the request. |
Comment by ismaell @chronokitsune3233 It's meant to ease packaging for the OS. It could complain about dependencies, but it shouldn't build anything external. Why are sources copied from |
Comment by ismaell @FellippeHeitor It has been open for quite some time, wouldn't hurt to keep it open some more. I would like to improve it further. |
Comment by ismaell I never dug into the internals of QB64... Should |
Comment by mkilgore Hey, I saw this and though I'd chime in. I wrote/rewrote the original ./setup_lnx.sh that's in the repo today and I've write a fair amount of Makefiles. It would definitely make sense to replace part of the bulid scripts with a The fact that we don't grab a package for As for making libqb.o a shared object instead, it's not a horrible idea, but it would mean that QB64 executables are not as easily redistributable. Keep in mind that unlike Windows, Linux will not look for All that said, replacing the current build system with |
Comment by ghost @ismaell
A brief summary of the process when compiling using the Linux or OS X
And here's what happens when using an existing
I'd say no, given that QB64 currently appears to use a specially encoded filename for libqb object files. The code for it starts at line 11885 of qb64.bas. If there's a way to remove this dependency, perhaps by loading things at runtime (e.g. |
Comment by ghost @mkilgore For example, we now have a script Fedora also uses In other words, there's some stuff that could be changed since the last version of the script was completed. Maybe it is time to just use a Makefile after all? 😛 |
Comment by mkilgore
That looks great! I'm surprised that it was around back in 2012, ./script_lnx.sh says I wrote it in 2013 (Though that could just be the date of the last update). More wide adoption of /etc/os-release probably happened after I wrote that script, or else I think I would have saw it. That said, while it's probably worth keeping the weird logic in the script as a fallback in the event /etc/os-release doesn't exist, /etc/os-release definitely looks like a much saner way to do things. I would agree the script could use a little updating. That said, I'll be perfectly honestly that I've been a solid Gentoo user for probably 3 or more years now, so I'm a bit out of the loop on what some other distros like Fedora are doing. You would likely know better then I do. I just put a preliminary possible version of the Makefile system in this branch: It ended up being fairly more involved then I expected when first starting, but my build system replaces a decent amount of the logic in qb64.bas that involves the building. The only thing I don't currently have supported is To clarify how my build system works, essentially you specify the name of the program to compile in the EXE variable, and then set the dependencies it has through a bunch of
I also added a convenience flag to the |
Comment by mkilgore @ismaell As far as making it portable, I'm pretty sure mine is already pretty portable, though it definitely needs testing. The idea was that eventually we could just pass If you want to try running it on Windows, you could just copy the I think the harder part will be retrofitting this into qb64.bas. The compilation logic there is a bit screwy, and it generates scripts and then runs them to compile the source, so it's important that we ensure there aren't any weird cases we're not handling. It shouldn't be too bad, but still. |
Comment by mkilgore I had surprisingly quick success getting it to work on "Windows" (Though I'm just testing in Wine). It took me a bit to figure out where qb64.bas was getting all its flags from (./internal/c/makeline_win.txt) but it's not too bad. Right now everything is compiled into the /os/lnx folders, since that was the quickest way to get things working. I also add basic support for OSX, but it's untested. I think the big thing now is looking at converting qb64.bas to use |
Comment by FellippeHeitor @mkilgore Hi, Matt. It's nice to see you around. Given how long ago your last contribution was I didn't even consider bringing you into this PR initially, for which I apologize. Turns out your contribution was solid enough not to require you to step back in for four years :-) Good to have you with us. |
Comment by ismaell @mkilgore It uses features specific to A portable
So you can do something like |
Comment by mkilgore Ah, I see your point. I'm open to doing that, is there a reason for supporting bmake though? There is more GNU specific stuff then just the 'if' lines, and all the platforms QB64 supports have easy access to GNU make. |
Comment by mkilgore That's fair. I guess the way I see it is that we're already likely dependent on GCC anyway, so not having a dependency on GNU make doesn't really get us much. That said, I don't really feel like that's my call to make, so I'm fine with making it more standard make syntax. Your definetely right that it could be cleaned up. I was mostly just focused on duplicating the current functionally correctly. |
Comment by ismaell I will copy here my comments on the commit for completeness: Conditional rules could be rewritten like this: https://gist.github.com/ismaell/48fc527236888456d83a676d6c1ba9ab. But I would prefer to have a Probably @mkilgore Which way would you prefer to go? |
Comment by mkilgore @ismaell The build.mk files in my change already work for every OS, I just haven't moved them out of the With that said, do we have any way to test OSX? It seems like that might be a problem we're going to run into. @FellippeHeitor |
Comment by FellippeHeitor I can provide testing on macOS. I'm on High Sierra. |
Comment by paulwratt
I agree with the process going on here, but for the sake of those systems that dont have a |
Comment by Kroc Agreed with above, removing build.bat would make building a Windows executable a living hell for 99% of Windows developers. |
Comment by mkilgore Obviously, this project fell a bit off the radar. I don't personally do much with QB64 anymore so while IIRC the
I'm not sure I understand this. We distribute GNU |
Comment by FellippeHeitor Agreed and willing to close. Everybody else, thoughts? |
Comment by flukiluke I very much like the idea of using make to build QB64, in principle at least. However, given that this is ultimately a refactor of an already working process, I don't think I'd be able to find the time or motivation to properly check and integrate this (not at this point in time, anyway). |
Comment by ismaell
We could just rely on
It's common practice to provide scripts for that, but also it's possible to embed a path into the executable (see |
Comment by ismaell @flukiluke @FellippeHeitor I'm still interested on pursuing this; a clean buildsystem is a must for building packages. Though, it will take me quite some time to catch up with this and other related stuff. |
Comment by alexmyczko @ismaell how are you progressing? I'm interested in your Makefile to create official debian/ubuntu packages of qb64. which system will you need the makefile in? currently I didn't find a way to set the path for the 'internal' folder to be /usr/share/qb64 (or /usr/share/qb64) and be only read-only. and tell qb64 to use /tmp or ~/.cache for writing or cache files |
Comment by ismaell @alexmyczko not at all; life got in the way. I'll post updates here, I've not dropped the idea yet. |
No work has been done on this by us. I closed the issue due to inactivity, but feel free to keep up the work if you feel like and I'll reopen it. |
please re-open it. and can you drop internal/c/mingw* from future tarball releases (the 2 x 500 mb)? |
I'm pretty sure we're not shipping the compiler in the Linux and macOS packages. @flukiluke did that change? |
i was refering to the source tarball v1.4.tar.gz (or .zip) |
Ah, the source is GitHub's work. They just grab everything and make it available, I don't think we have a way to interfere with that, do we? |
I think github has a way to do that, otherwise it would also be possible move away that stuff that should not be in the release, do the release, move it back in :) It would also be great to drop from the tarball, or just put it to qb64-supplementals. https://en.wikipedia.org/wiki/Bitstream_Cyberbit This will help package qb64 and populate it at to other distributions, see https://repology.org/project/qb64/versions (repology is a central point watching all sorts of distributions for software) |
On 15/Apr/2020 12:39, Fellippe Heitor wrote:
Ah, the source is GitHub's work. They just grab everything and make it
available, I don't think we have a way to interfere with that, do we?
It's not a problem with Github or Git, you're not supposed to use it as
a build distribution tool, and in general the reference source code
should not ever be tracked together with binaries or autogenerated
files.
A typical example is autotools, where the buildsystem is generated from
.am and .ac files, and must be included in the distribution archive, but
should never be in the VCS, not only because it's conceptually wrong,
but also because two versions of autotools will produce a different
result. And the same applies for any other build system.
It's expected that packages be handled as:
1. development source code
2. source code distribution => augmented with 3rd party stuff & buildsys
3. prebuilt binaries => .deb, .rpm, .exe, etc.
Also in general the distribution generation script could prevent from
creating inconsistent releases via sanity checks: e.g. forcing the
release to be properly tagged, Changelog and translations to be
up-to-date, etc.
|
I have a first basic packaging http://sid.ethz.ch/debian/qb64/ still needs some more work, but I guess it's possible... (won't run yet) |
@alexmyczko The package doesn't install any of the QB64 source files? The last time I checked I think they were required to compile .bas files, did it change recently? |
that will be fun to play with..
|
Ok good to know. I tried to package QB64 for Debian some time ago, but the full recompilation on each run was a bit a show stopper. The issue was that QB64 writes the compiled files into the QB64 install directory, which is typically read only in a Debian context. A welcome change to help with the packaging would be to write the files relatively to the .bas file being compiled (or write the files to a temp directory and the final executable along with the .bas file). |
@ebourg that is easy to fix with
|
the embedded libs need be stopped buildling/removed, and that thing with tmpdir needs be fixed, then it's almost ready. sid.ethz.ch/debian/qb64/ for an 1.5 version |
May I suggest that we use |
I believe it can be done. It will be a deep surgery though, I believe. One gotta be extreme cautious. |
i take above pull as ./internal/thing be replaces with /tmp, so giving it another try:
getting rid of setup_lnx.sh or documenting it properly as in, calling this the build target of a Makefile i guess that would also be helpful for macOS on arm64 (M1) |
I'll give this another try next week. |
Thank you to everyone working on this issue, as I look forward to being able to install this package via brew. |
what are the steps to compile natively for windows? the instructions to compile using VS 2019 or better? And if you need to install the G++ compiler for windows and make the compilation. I didn't find the instruction, can you help with that? |
@Spoiledpay: The package includes mingw, a C++ compiler for Windows. If you wish to compile QB64 on windows, run |
@ismaell I'd be fine with |
On 19/Jan/2022 03:42, Alex Myczko wrote:
@ismaell I'd be fine with `Makefile` as well as `CMake`, what's your preference?
I don't have a preference.
|
Issue by ismaell
Sunday Nov 27, 2016 at 19:40 GMT
Originally opened as Galleondragon/qb64#16
A more traditional way to build it. Please comment.
The flags might be outdated, it has been over a year, but it still seems to build.
Something not included is a step to remove
../temp/
from the#include
directives, as it didn't seem appropriate to do it there...NOTE: Sadly I couldn't test the result this time as it's producing a segmentation fault.
ismaell included the following code: https://github.com/Galleondragon/qb64/pull/16/commits
The text was updated successfully, but these errors were encountered: