Opened 12 years ago
Closed 20 months ago
#38379 closed submission (fixed)
New port "databases/sysbench"
Reported by: | alexander.janssen@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ryandesign (Ryan Carsten Schmidt), kurthindenburg (Kurt Hindenburg), sainnhe (Sainnhe Park) | |
Port: | sysbench |
Description
This is a follwup submission to Ticket #26811, where a port for sysbench was requested. I wasn't quite sure if these tickets are somehow monitored and I wasn't able to change ticket type to "submission". Hope I did it right.
I've created a Portfile and a patch against configure.ac and Makefile.am (solves autoconf and libtool issues). It would fit into the databases category.
I currently builds only against MySQL, with mysql55 as the default and options for mysql5 and mysql4. The mysql4 variant is untested though, since the mysql4 port doesn't build on my Lion machine.
This is my first submission and if I did something wonky, like not following best practise or Macports standards, tell me and I try to get it corrected.
Cheers, Alex.
Attachments (3)
Change History (24)
Changed 12 years ago by alexander.janssen@…
Attachment: | sysbench-0.4.12.patch added |
---|
comment:1 follow-up: 2 Changed 12 years ago by cooljeanius (Eric Gallager)
Just quickly running it through port -v lint --nitpick
, it reports the following warnings:
Warning: Line 38 seems to hardcode the version number, consider using ${version} instead Warning: Dependency port:libtool specified multiple times in depends_build Warning: Dependency port:autoconf specified multiple times in depends_build Warning: Dependency port:automake specified multiple times in depends_build Warning: Patchfile sysbench-0.4.12.patch does not follow the source patch naming policy "patch-*.diff"
The multiple dependencies thing is because "use_autoreconf yes
" automatically adds dependencies on autoconf, automake, and libtool for you. Also since this seems to be a benchmark tool I'd consider adding the "benchmarks
" category. Anyway, I'm going to try building it next...
comment:2 follow-up: 3 Changed 12 years ago by alexander.janssen@…
Replying to egall@…:
Just quickly running it through
port -v lint --nitpick
, it reports the following warnings:Warning: Line 38 seems to hardcode the version number, consider using ${version} instead
I think is related to the paths to the includes and libs of the different mysql ports in the variants sections; sysbench's configure tool insists on these and can't find them automatically. Also I wouldn't know how to tell him the correct version of the client libraries to use. Is there a way to do this better?
Is there something like ${port:mysql5:libpath}
?
The multiple dependencies thing is because "
use_autoreconf yes
" automatically adds dependencies on autoconf, automake, and libtool for you. Also since this seems to be a benchmark tool I'd consider adding the "benchmarks
" category.
I had to use use_autoreconf
; something with the supplied libtool
was really funky and I wanted to avoid calling autogen.sh
manually. Allright, so these can be removed from the depends_build
list?
Anyway, I'm going to try building it next...
Thanks!
comment:3 follow-up: 6 Changed 12 years ago by larryv (Lawrence Velázquez)
Replying to alexander.janssen@…:
Replying to egall@…:
Just quickly running it through
port -v lint --nitpick
, it reports the following warnings:Warning: Line 38 seems to hardcode the version number, consider using ${version} insteadI think is related to the paths to the includes and libs of the different mysql ports in the variants sections
No, it’s from the name of the patchfile.
comment:4 follow-up: 5 Changed 12 years ago by larryv (Lawrence Velázquez)
Why are you using the patch to create files? Why aren’t they included in the distribution?
comment:5 Changed 12 years ago by alexander.janssen@…
Replying to larryv@…:
Why are you using the patch to create files? Why aren’t they included in the distribution?
I can't tell why they aren't there and I can't speak for the original author, Alexey Kopytov. However, autoreconf
insists on those files so I created an almost empty NEWS-file and an AUTHORS-file naming Alexey.
Using autogen.sh
wouldn't complain about the missing files, but this is not an option since I'd have to call up glibtoolize
, aclocal
, autoconf
and automake
manually.
comment:6 Changed 12 years ago by alexander.janssen@…
Replying to larryv@…:
Replying to alexander.janssen@…:
Replying to egall@…:
Just quickly running it through
port -v lint --nitpick
, it reports the following warnings:Warning: Line 38 seems to hardcode the version number, consider using ${version} insteadI think is related to the paths to the includes and libs of the different mysql ports in the variants sections
No, it’s from the name of the patchfile.
Ah, allright. Anyway, I still wonder if there's a macro or variable which I could use to derive a lib- and include-path to a certain port instead of hardcoding them.
comment:7 follow-up: 8 Changed 12 years ago by cooljeanius (Eric Gallager)
ok, after building, I have the following comments:
- Since you're patching Makefile.am and configure.ac anyways, you might as well silence the glibtoolize warnings while you're at it, i.e.:
glibtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac
andglibtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
- The +mysql4 and +mysql5 variants should probably conflict with one another
- mysql4 is old and obsolete anyway (I couldn't get it to build on Lion), so you could also just leave out the +mysql4 variant instead
- my port-depcheck.sh script says that
sysbench
doesn't actually link against openssl or zlib; do those really need to be added as dependencies? Although then again I like to add lots of irrelevant dependencies when writing my own ports, so who am I to talk...
Also re-looking over the portfile, all instances of the word "sysbench
" can be replaced with the variable ${name}
comment:8 follow-ups: 9 12 Changed 12 years ago by alexander.janssen@…
Replying to egall@…:
ok, after building, I have the following comments:
Thanks for your review comments!
- Since you're patching Makefile.am and configure.ac anyways, you might as well silence the glibtoolize warnings while you're at it, i.e.:
glibtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.acandglibtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Actually, I tried the AC_CONFIG_MACRO_DIR([m4])
part. It resulted in a situation that it expected a directory named "m4" - if it doesn't exists, it bails out.
If I create the m4 directory, it still bails out for reasons I didn't fully understand yet. Probably because it's empty? I checked on the Internet and the general opinion was "this is autoconf-foo, just don't do it and you're fine."
Adding -I m4
to ACLOCAL_AMFLAGS in Makefile.am results in a situation that libtool
is throwing a lot of error-messages. Log from manual configure:
/bin/sh ../libtool --tag=CC --mode=link gcc -D_THREAD_SAFE -g -O2 -o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/opt/local/lib/mysql55/mysql -lmysqlclient_r -lz -lm ../libtool: line 835: X--tag=CC: command not found ../libtool: line 868: libtool: ignoring unknown tag : command not found ../libtool: line 835: X--mode=link: command not found ../libtool: line 1001: *** Warning: inferring the mode of operation is deprecated.: command not found ../libtool: line 1002: *** Future versions of Libtool will require --mode=MODE be specified.: command not found ../libtool: line 2228: X-D_THREAD_SAFE: command not found ../libtool: line 2228: X-g: command not found ../libtool: line 2228: X-O2: command not found ../libtool: line 1948: X-L/opt/local/lib/mysql55/mysql: No such file or directory ../libtool: line 2397: Xsysbench: command not found ../libtool: line 2402: X/Users/ajanssen/gnuradio/lib: No such file or directory ../libtool: line 2409: Xsysbench: command not found ../libtool: line 2417: mkdir /.libs: No such file or directory
I wasn't able to debug this one, but the Internet is full of people complaining about the same or similar errors - the only working solution I found is running the whole autogen.sh, aclocal, autoconf and automake yadda-yadda - something autoreconf is supposed to do (I guess). So I decided to ignore it completly because it just breaks things. I have the feeling that this is a GNU autotools compability issue. I'm not confident enough to fully debug this.
- The +mysql4 and +mysql5 variants should probably conflict with one another
People might have valid reasons to have several different versions of their client-libs installed. mysql4 and mysql5 can live happily together without getting in the way of each other. Or what do you mean? That those two variants can't be installed side-by-side...? (I assumed that)
- mysql4 is old and obsolete anyway (I couldn't get it to build on Lion), so you could also just leave out the +mysql4 variant instead
I only included it for completeness. I think it just should be fixed in the mysql4 port, but I don't see a point to fix the client libs just to make sysbench work. What do you suggest? Should I remove it and include it later when the mysql4 port builds again? (should check if there's already a ticket opened for mysql4 not building)
- my port-depcheck.sh script says that
sysbench
doesn't actually link against openssl or zlib; do those really need to be added as dependencies? Although then again I like to add lots of irrelevant dependencies when writing my own ports, so who am I to talk...
This is actually kinda odd, I noticed it myseld. The mysql5 port links itself against openssl by default, mysql55 doesn't. Mysql55 has the +openssl
variant. So I think I'll include the openssl dependency for mysql5 only.
Also re-looking over the portfile, all instances of the word "
sysbench
" can be replaced with the variable${name}
Allright.
So, I'll try to fix the things I can solve right now; you want me to submit a new portfile and delete the old attachment?
comment:9 follow-up: 10 Changed 12 years ago by cooljeanius (Eric Gallager)
Replying to alexander.janssen@…:
mysql4 and mysql5 can live happily together without getting in the way of each other.
No they can't; not in MacPorts at least. The MacPorts ports for mysql4 and mysql5 already conflict with one another. mysql4 has this in its portfile:
conflicts mysql5 mysql5-devel
And mysql5 has this in its portfile:
conflicts mysql5-devel mysql4
So the variants here should probably follow suit with these conflicts.
So, I'll try to fix the things I can solve right now; you want me to submit a new portfile and delete the old attachment?
Yeah, submit a new portfile; it's up to you whether you want to replace the old one or not.
comment:10 follow-up: 11 Changed 12 years ago by alexander.janssen@…
Replying to egall@…:
Replying to alexander.janssen@…:
mysql4 and mysql5 can live happily together without getting in the way of each other.
No they can't; not in MacPorts at least. The MacPorts ports for mysql4 and mysql5 already conflict with one another. mysql4 has this in its portfile:
conflicts mysql5 mysql5-develAnd mysql5 has this in its portfile:
conflicts mysql5-devel mysql4So the variants here should probably follow suit with these conflicts.
Hu, I thought these conflicts would be automatically handled. OK, I'll include those.
So, I'll try to fix the things I can solve right now; you want me to submit a new portfile and delete the old attachment?
Yeah, submit a new portfile; it's up to you whether you want to replace the old one or not.
Gimme a day, I'll correct these.
Coming back to the AC_CONFIG_MACRO_DIR([m4])
and ACLOCAL_AMFLAGS
issues; I don't think I can resolve the issues. Do you really need these issues to be resolved?
comment:11 Changed 12 years ago by larryv (Lawrence Velázquez)
Replying to alexander.janssen@…:
Hu, I thought these conflicts would be automatically handled. OK, I'll include those.
If you don’t mark the variants as conflicting, users will be able to select them both. Of course, the installation would proceed to fail because mysql4
and mysql5
conflict, but you should nip the conflict in the bud.
Coming back to the
AC_CONFIG_MACRO_DIR([m4])
andACLOCAL_AMFLAGS
issues; I don't think I can resolve the issues. Do you really need these issues to be resolved?
If they’re just warnings, don’t bother.
comment:12 Changed 12 years ago by larryv (Lawrence Velázquez)
Replying to alexander.janssen@…:
Replying to egall@…:
mysql4 is old and obsolete anyway (I couldn't get it to build on Lion), so you could also just leave out the +mysql4 variant instead
I only included it for completeness. I think it just should be fixed in the mysql4 port, but I don't see a point to fix the client libs just to make sysbench work. What do you suggest? Should I remove it and include it later when the mysql4 port builds again? (should check if there's already a ticket opened for mysql4 not building)
Despite what I said before about conflicting variants, both mysql4
and mysql5
are obsolete; do not create variants for either of them. If it’s plausible that users might want to build SysBench without MySQL support, add a mysql55
variant and declare a dependency on the mysql55
port. You can set it as a default variant if you want (default_variants +mysql55
). If you want to support MySQL 5.1 too, add a mysql51
variant.
The mysql5 port links itself against openssl by default, mysql55 doesn't. Mysql55 has the
+openssl
variant. So I think I'll include the openssl dependency for mysql5 only.
Do not declare dependencies on ports that are not actually used by SysBench. Dependencies of dependencies are handled automatically.
comment:13 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign@… added |
---|
Do create a variant for mysql5 and make it the default variant; it is still the default mysql in MacPorts at this time. Do also offer variants for the newer mysql ports: mysql51, mysql55, mariadb, percona. Do not offer a variant for mysql4; it is obsolete in the extreme and we should be working on removing it from MacPorts, not integrating it further.
Remove "Builds by default against MySQL 5.5." from the description. Users can determine by looking at the output of "port variants" what the default variants are.
The initial revision of any given version of a port should be 0 not 1.
Yes, remove the autoconf, automake and libtool dependencies from depends_build since MacPorts adds them for you automatically when you use use_autoreconf yes
.
Rather than creating AUTHORS and NEWS files with unofficial content, I'd just create empty files. The Tcl touch
command can do that.
Why is Makefile.am being patched to insert a blank line? What does that accomplish?
I would remove comments like "Modified for Macports" from the patch; they add no value.
If sysbench itself does not use openssl or zlib (and they're only used by the mysql libraries) then don't add these dependencies; let the mysql ports do that when needed.
comment:14 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
sourceforge master_sites need to be written to avoid redirects; see wiki:howto/AvoidRedirects
comment:15 Changed 12 years ago by alexander.janssen@…
OK, I cleaned up the portfile and the patch; hope I sorted out all necessary things.
Changes:
- Removed variant mysql4
- Added variants percona and mariadb
- Decided to build sysbench without database support by default (it brings a lot of other benchmarking tools besides database benches)
- Made all variants mutally exclusive
- Changed
master_sites
so that redirects don't need to be followed - Creating empty m4 directory as well as empty NEWS and AUTHORS files with TCL-macros instead of patching them
- Removed unnecessary dependencies on zlib and openssl
- Moved sysbench to the benchmarks category
Plan:
- Add Postgres support later (doesn't compile for some unfortunate i386/x86_64 foobar, needs more debugging)
Unfortunately I don't seem to be able to delete or overwrite the old patch; I renamed the patch to patch-sysbench-0.4.12.diff
(means: Do not use sysbench-0.4.12.patch
). However, the Portfile will be overwritten.
Changed 12 years ago by alexander.janssen@…
Changed 12 years ago by alexander.janssen@…
Attachment: | patch-sysbench-0.4.12.diff added |
---|
comment:16 follow-up: 17 Changed 12 years ago by alexander.janssen@…
Do i need to change anything so that my submission will be accepted? Are there still open issues? I won't be able to make up a target for Postgres at the moment anyway, I might be doing that later.
comment:17 Changed 12 years ago by pixilla (Bradley Giesbrecht)
Replying to alexander.janssen@…:
Do i need to change anything so that my submission will be accepted? Are there still open issues?
Replace percona with mariadb in the mariadb variant block of the Portfile.
comment:19 Changed 9 years ago by kurthindenburg (Kurt Hindenburg)
Are you still interested in this port?
From what I can tell, the homepage is now https://github.com/akopytov/sysbench
Also, I don't understand what you're doing w/ the +universal part
comment:20 Changed 9 years ago by mf2k (Frank Schima)
Keywords: | haspatch removed |
---|---|
Version: | 2.1.3 |
comment:21 Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)
Cc: | sainnhe added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
A sysbench port was added in [04ce1ffd2f0d4d647ea5da0f796534435554ad0a/macports-ports].
Patch for configure.ac and Makefile.am; also adds the mandatory files NEWS and AUTHORS.