purebasic icon indicating copy to clipboard operation
purebasic copied to clipboard

PBCompiler Continuous Integration

Open tajmone opened this issue 4 years ago • 1 comments

It would be really great to be able to automate PB build tests for this repo via Continuous Integration services like Travis CI, Circle CI, etc. This would allow every submitted commit and PR to be tested against the latest PBCompiler on every supported platform, sparing a great deal of time in terms of checking that proposed changes don't break things up.

I had already posted on this issue on the PB Forum a few months ago (see PureBasic Demo and Travis CI), but now that parts of the official PureBasic release package are open to public contributions the need for CI support is even more compelling.

As mentioned on that post, the problem at hand here is of legal nature, i.e. how to make the PBCompiler available to CI services without exposing it to digital theft or improper use. But in the meantime I had some thoughts on how this could be done, and there are a few possible solutions to it, some of which are only possible through the PB Dev Team.

Travis CI and Self-Hosted PBCompiler Copies

The easiest way would be for Fred to legitimately and legally store Zip archives of the PBCompiler somewhere on the web, behind password protected access. Travis CI (like most other CI services) allows the account owner to store secret tokens and env vars which could then be used in the before-install task to download (via cURL) and unpack the PBCompiler for the OS being tested, and then all scripts in the repository would manage to actually compile all the sub-projects and report any errors.

Considering that Travis CI supports Windows Server (32/64 bit), and Linux and macOS (64 bit only), it would provide a good build test covering all three supported OSs.

Of course, only the repository owner would posses the required token or passwords to download the archived PBCompilers, so third parties could not grab them nor exploit them in their own projects.

Dedicated PBCompiler Checker Online

Another (possibly better) solution would be if Faintaise Software could manage to provide a PBCompiler validation online service by setting up a public service offering compiler validation via the Internet using the actual PBCompiler with the --check option enforced.

Since this could only be used to check the exit status of the PBCompiler (and not to grab compiled binaries), it would be a good solution for those wishing to use CI with PB projects on GitHub (or elsewhere for that matter). IMO, this would be a great service for PB users, contributing to PB's status in the collaborative coding scene.

Unlike using a demo version of PB, which limits the length of the compilable code, this solution would be a full fledged compiler validator, always running the latest PB release.

Setting up something like this shouldn't be too hard today with all the new cloud based services that are available, especially using Docker images.

Releasing a Check-Only Free Compiler

Of course, PB Developers could also make available for free on www.purebasic.com a tweaked version of the PBCompiler binaries, acting only as a code checker. If the same download URL for each OS would always grant access to the latest PB checker-compiler for any platform, or if a version based URL scheme was adopted (allowing access to specific versions), end users could then legally and legitimately use those binaries to carry out build validation tests in different manners.

I'm confident that this would require an initial toolchain setup in order to build and deploy the redux versions of PBCompiler, but would then work seamlessly thereafter for all new PB releases.


There are also other possible solutions, but this Issue is about bringing up the need to CI integration and initiate a discussion on it.

tajmone avatar Dec 06 '19 20:12 tajmone

This is a good idea, but will probably take some time to do. Thanks for submitting this !

fantaisie-software avatar Dec 07 '19 14:12 fantaisie-software