-
Notifications
You must be signed in to change notification settings - Fork 122
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
Dependency build automation for Linux #323
Conversation
Do we have to bring in all of these dependencies in uncompressed source form? Surely we could check in just the tarballs (and patches). I don't see why we need to track 3000+ files instead of just a handful. |
yes, I originally had a format just including the .7z files which are used by BAWT instead of the uncompressed source (one of the first steps is to zip all of the source) however I changed this to the uncompressed source format for 2 reasons:
Unless I've made an error here with the files included the PR should not be distributing the Db2 server package. If i've done this by mistake then let me know where and I'll fix it. The instructions say that the builder has to download and install v11.5.7_linuxx64_server_dec.tar.gz themselves as they also have to for PostgreSQL, MySQL and MariaDB - there is definitely no intention to include any of the database installations in HammerDB itself however these will all be needed to be installed separately to do a full build. |
I strongly oppose commit 9df7acf - it should never be accepted. First of all it has 5000+ files. This is surely the wrong approach. Secondly, there is no commit message body, just a title. You can't do such a massive change without any description of the change. The proper way to do "build automation" is to have a shell script or Makefile or whatever that lists every step needed to compile the sources. Over time that script will then evolve. The script might have external references to download some dependencies as pre-built binaries from somewhere. Or it might clone other repositories, or use git submodules, or just install with yum and apt the build dependencies. But you do not include build dependencies in this repository, and you surely should never include them as binary files! |
Regarding 1) - yes, the patch set might be large, but this should give us some motivation to get those patches accepted upstream and then the patch set will diminish in size. There's no reason to check in the upstream sources for version x.y.z -- a tarball (or as Otto suggests - just recording the metdata required to fetch version x.y.z at build time) is preferable. (FWIW, the FreeBSD ports system - home to thousands of "ported" apps - exists as metadata + patches.) Regarding 2) - hammerdb is mostly tcl. We shouldn't care about the composition of our dependencies. And regarding my previous comment about db2 - which I since deleted - I mis-read your description. |
What patches? There is now just one single giant undocumented commit. If say libfoo-1.2.3 was imported as source code in one commit and then on top of that was commit abc123 "Extend libfoo to be compatible with OpenSSL" you could take that commit and send it upstream for libfoo for inclusion with the motivation that it is already used in HammerDB since commit abc123, but now nothing is visible in the giant commit, just one huge blob. |
This is great input and much appreciated, it's definitely worth getting it right from the outset and the key challenge really stems from not having done this at the outset when issue #36 was raised. However, this gives us a good base to work from, as it does work, so shows the final destination of what it should look like on the system doing the build rather than in the git repository. So the initial challenge in deciding how to do this is that a number of the dependencies are modified in some way, and a number of references to git submodules suggested that submodules add complexity and are not the way to go. So HammerDB needs its own versions of these dependencies, and these can and will change over time. e.g they will all change to add Windows build support as well. So, as proposed, how about taking this approach? > The script might have external references to download some dependencies as pre-built binaries from somewhere. This should be straightforward, all the builds are converted to .7z files anyway. I could add the feature to download everything currently added as source as a .7z file from an external location when running the build. BAWT should already support this. The build approach would then be almost identical to what is there now, with just an additional step to do the download. |
As per discussion, pull request has now been updated so the InputLibs directory and all contents have been removed and instead the InputLibs directory is created on first build and all are fetched as .7z files from htttp://www.hammerdb.com instead. |
Merging Pull Request as voted on by TPC-OSS subcommittee on April 5, 2022. |
This Pull request brings all dependencies into the HammerDB GitHub repository and enables build automation for Linux so that a HammerDB distribution can be completely built from source as an alternative to downloading the pre-compiled release packages. Windows support is planned for addition in a subsequent PR.
Build automation is based on a modified version of BAWT by Paul Obermeier http://www.bawt.tcl3d.org/. BAWT is copyrighted by Paul Obermeier and distributed under the 3-clause BSD license.
This feature has been tested on Red Hat 8.X and Ubuntu 20.04.X
The tested and supported architecture is x64.
Required packages
Prior to build it is necessary to install development tools, p7zip compression and Xft font development packages
e.g.
Database packages:
Oracle and ODBC for SQL Server will build without client libraries. Client libraries must be installed for all of Db2, MariaDB, PostgreSQL and MySQL for the HammerDB build to be successful.
For Db2 either the server or client can be installed, for example v11.5.7_linuxx64_server_dec.tar.gz.
HammerDB build auotmation will look for the Db2 installation in the location of the environment variable IBM_DB_DIR set using db2profile. e.g.
Environment variables MARIADB_CONFIG, PG_CONFIG and MYSQL_CONFIG must be set to the location of the respective config commands for each database.
Once all the client libraries are installed, either clone the HammerDB repository:
or download the zipfile and unzip into the HammerDB-master directory.
From here cd to the Bawt-2.1.0 directory eg
/home/hdb/HammerDB-master/Build/Bawt-2.1.0
and run the Linux build command./Build-Linux.sh x64 Setup/HammerDB.bawt update
This will compile all the HammerDB dependencies and create the HammerDB distribution.
In the BawtBuild directory the HammerDB distribution will be built and a tar.gz file installed in the /x64/Release/Distribution
In the InputLibs directory the source is compressed into .7z files for installation and these are updated for each build if changes are detected, the .7z files can also be deleted if preferred and will then be recreated on the next build.
Note that some packages have been modified compared to the originals, this build automation brings all changes into the HammerDB repository.
If a previous build is detected without modified dependency source, packages will not be recompiled.
To reset the build environment, remove the BawtBuild directory under the Build directory. All packages will then be recompiled.