Closed ret2libc closed 5 years ago
For example, I just found out that the acr+make install wasn't working well because it didn't install some required headers. This was not caught by tests before because they were just using the source directory.
which required headers? sdb builds fine in travis without installing anything
On 21 Sep 2018, at 09:46, Riccardo Schirone notifications@github.com wrote:
For example, I just found out that the acr+make install wasn't working well because it didn't install some required headers. This was not caught by tests before because they were just using the source directory.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/radare/sdb/pull/158#issuecomment-423445324, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3-lrqywoyom1stAMWSaw0Cku6UXmbnks5udJlrgaJpZM4Wy05O.
As said, it was running well because you are not installing it. If a user would try to install sdb and use it from the system, it wouldn't work, because src/sdbht.h
was not installed on the system (see the changes in this PR)
@radare ping
Busy at work and irl. Had no time to test and im not convinced on having pkgcondig as dependency at compile time
On 24 Sep 2018, at 14:16, Riccardo Schirone notifications@github.com wrote:
@radare ping
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Also theres the problem of dynamic an dtstic linking
On 24 Sep 2018, at 14:16, Riccardo Schirone notifications@github.com wrote:
@radare ping
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
What problem of static/dynamic linking?
I prefer static linking because this makes sdb self contained and give no room to problems like envvars or different versions of libs mainly because libsdb is not versioned at all and will cause major on problems on many people if they have multiple versions installed. Thats why sdb is embedded inside r2 and why static linking is prefered in the current makefile.
Btw pkgconfig doesnt works much well when having static and dynamic options of the same lib. Its usually better to have two separate pc files instead. Which sucks but cant think of a better solution
On 24 Sep 2018, at 14:58, Riccardo Schirone notifications@github.com wrote:
What problem of static/dynamic linking?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
because libsdb is not versioned at all and will cause major on problems on many people if they have multiple versions installed
That's why in my previous commit about meson I've versioned the dynamic library (https://github.com/radare/sdb/blob/master/meson.build#L61)
Btw pkgconfig doesnt works much well when having static and dynamic options of the same lib. Its usually better to have two separate pc files instead. Which sucks but cant think of a better solution
Again, I don't think these problems apply with sdb, since the pkg-config file is very simple and sdb doesn't have dependencies. Indeed just a:
cc --static $(pkg-config --cflags --static sdb) -o test_hash ./test_hash.c $(pkg-config --libs --static sdb)
works well.
im not convinced on having pkgcondig as dependency at compile time
I see some reasons why this is not really a problem.
Moreover, if it becomes really necessary, we can create a env.sh
script similar to the r2 one to switch between different "install" directories.
@radare ping
Ok I'm trying to keep tests runnable without installing sdb.
ok @radare please consider merging this since it allows to run tests from a not-installed sdb both from makefile and meson (with the BASEDIR var)
what about having sdb.mk or deps.mk and put all the logic of defining flags and path to SDB in only one place? just include it from the shellscripts and the makefiles
So I have considered this fact and the reasons I went ahead with this anyway were:
../../build/
I understand it is handy to just do
make; make tests
but without pkg-config it becomes a big mess and very much "path dependent".