Comments (18)
Hello,
Did you compile FreeTDS or used TINYTDS_SKIP_PORTS
environment variable?
https://github.com/rails-sqlserver/tiny_tds/blob/master/Rakefile#L35
from tiny_tds.
Did you compile and installed it?
Can you verify the way you compiled it generated the proper shared object?
from tiny_tds.
I'm getting
rake-compiler must be configured first to enable cross-compilation
when I run rake. Should I be concerned?
It looks like freetds compiled.
When I do rake ports:freetds
I get:
rake-compiler must be configured first to enable cross-compilation
Activating libiconv 1.13.1 (from ports/x86_64-linux/libiconv/1.13.1)...
Activating freetds 0.91 (from ports/x86_64-linux/freetds/0.91)...
from tiny_tds.
Should the shared object be in ports/x86_64-linux/freetds/0.91/share/
?
If so, it's not.
from tiny_tds.
Oh, I understood you compiled FreeTDS yourself, not that you used the ports.
Seems that FreeTDS needs to be recompiled: relocation R_X86_64_32 against
.rodata' can not be used when making a shared object;`
Can't try right now (don't have a x64 Linux around) but will try later today and see if I can reproduce.
from tiny_tds.
The shared object is in /home/phil/workspace/tiny_tds/ports/x86_64-linux/freetds/0.91/lib/libsybdb.a
but it requires to be recompiled with -fPIC option, dunno why FreeTDS own configure
didn't detect that.
from tiny_tds.
Yes I saw the error but not really sure what that means. I'm not up on compiling stuff on Linux.
So, is there anything else I can do or give you or shall I just hold on until you've managed to reproduce?
Also note, this was done on Ubuntu 11.04.
Thanks for getting back to me so quickly, btw.
from tiny_tds.
Need to be able to reproduce so I can play with FreeTDS compiler flags :-)
You can avoid the waiting if you installed FreeTDS as shared object at system level, but since you're not up compiling stuff, the safest bet is wait (or maybe @metaskills can check this before me)
from tiny_tds.
Ok, got something for you, and is packed of good news and a bit of work, hope you're not scared.
Seems that libtool
, the tool used to compile both libiconv and freetds libraries used by TinyTDS is not properly doing -fPIC
on the static libraries.
It should, by default, but is not. Found a similar issue on Gentoo that you could relate to:
http://www.psicenter.org/wiki/index.php/Gentoo_Info#Unable_to_Emerge_blas-atlas-3.7.11
https://bugs.gentoo.org/show_bug.cgi?id=142924
BTW: PIC stands for Position Independent Code
Anyhow, to solve this:
Open tasks/ports.rake and add recipe.configure_options << "CFLAGS='-fPIC'"
above the recipe.cook
line.
You will end with something like this (diff):
diff --git a/tasks/ports.rake b/tasks/ports.rake
index bb68788..0bc6d2b 100644
--- a/tasks/ports.rake
+++ b/tasks/ports.rake
@@ -28,6 +28,7 @@ namespace :ports do
recipe = $recipes[:libiconv]
checkpoint = "ports/.#{recipe.name}.#{recipe.version}.#{recipe.host}.timestamp"
unless File.exist?(checkpoint)
+ recipe.configure_options << "CFLAGS='-fPIC'"
recipe.cook
touch checkpoint
end
@@ -43,6 +44,7 @@ namespace :ports do
recipe.configure_options << '--sysconfdir="C:/Sites"' if recipe.host != ORIGINAL_HOST
recipe.configure_options << "--disable-odbc"
recipe.configure_options << ENV['TINYTDS_FREETDS_082'] ? "--with-tdsver=8.0" : "--with-tdsver=7.1"
+ recipe.configure_options << "CFLAGS='-fPIC'"
recipe.cook
touch checkpoint
end
Now, before compile, you first need to nuke tmp
and ports
directory.
After that, doing rake compile
should work.
Dunno if this will connect with your SQL Server, but seems that compiles properly :-D
Have a nice day!
from tiny_tds.
Oh awesome! How is the new miniportile doing too?
from tiny_tds.
@metaskills, haven't made too much progress, got distracted with some C code and some crazy ideas (like always)... Oh shiny :-D
from tiny_tds.
@metaskills @luislavena ~ Agreed w.r.t. "ohhhhh shiny..."
I had several people ask me about "rvm.exe" at the conference last week...
from tiny_tds.
@wayneeseguin @metaskills check your inboxes, you will agree on the ohh shiny
re: rvm.exe
and MiniPortile, too many cool things, not so much time :'(
from tiny_tds.
"too many cool things, not so much time :'(" ~ Wait till the babies start popping out ::grin::
from tiny_tds.
@luislavena Thanks! I'll give this a try.
@wayneeseguin Thanks for RVM. It makes my life easier :)
from tiny_tds.
You guys rock! This has fixed my issue. I can now compile and run the tiny_tds tests and in addition my own test (which was giving me invalid date errors) is now passing.
One thing I needed to do was to pass in TDSVER=7.1
into the tiny_tds rake tests and in irb. Setting :tds_version in Client.new seemed to have no effect. Until I did this I was getting TinyTds::Error: Adaptive Server connection failed
errors.
Now back to the sqlserver_adapter and Rails and my new Ubuntu install (which still needs tweaking)...
Many thanks to you all for your assistance. Let me know if there is any further information you need.
Regards,
Phil
from tiny_tds.
You guys rock! This has fixed my issue
Happy to hear that!
One thing I needed to do was to pass in TDSVER=7.1 into the tiny_tds rake tests and in irb. Setting :tds_version in Client.new seemed to have no effect. Until I did this I was getting TinyTds::Error: Adaptive Server connection failed errors.
Strange, since we are defining TDSVER 7.1 as default during compilation:
https://github.com/rails-sqlserver/tiny_tds/blob/master/tasks/ports.rake#L45
I just executed ports/x86_64-linux/freetds/0.91/bin/tsql -C
and this is the result:
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /home/ubuntu/projects/oss/rails-sqlserver/tiny_tds/ports/x86_64-linux/freetds/0.91/etc
MS db-lib source compatibility: no
Sybase binary compatibility: no
Thread safety: yes
iconv library: yes
TDS version: 5.0
iODBC: no
unixodbc: no
SSPI "trusted" logins: no
Kerberos: no
See TDS version...
Seems that it is ignoring the configuration option we added.
@metaskills, leaving this to you to figure out, you have more experience with FreeTDS than myself.
from tiny_tds.
That should finish it :)
from tiny_tds.
Related Issues (20)
- Install fails when FreeTDS installed via Homebrew HOT 5
- FreeTDS & TinyTDS HOT 9
- Guidance on how to use with password-less login with Azure Service Principal or Managed Identity HOT 1
- Ruby 3.2 warning: undefining the allocator of T_DATA class TinyTds::Result HOT 1
- results.each(:symbolize_keys => true) not working HOT 1
- Oracle Enterprise Linux installtion instruction HOT 1
- Unable to connect when upgrade to Rials 6 HOT 3
- Segmentation fault after closing connection and asking for `dead?` HOT 3
- tiny_tds don't compile on ruby 3.1.3 on W10 HOT 2
- Compatibility with OpenSSL v3 HOT 2
- When connection fails, a hanging anonymous inode is left open in the system
- Reading data error
- Prepare tiny_tds gem for Ruby v3.1 on Windows HOT 3
- How to build for use in AWS-LAMBDA HOT 1
- Unable to change debug flags in freetds.conf
- TinyTds::Error: Bad numbytes parameter passed to dbstrcpy HOT 2
- TinyTds::Error: Adaptive Server connection failed - but works via tsql directly HOT 4
- Crashes (SIGABRT) Under Test Automation HOT 6
- Compatibility Inquiry: tiny_tds 2.1.7 with Ruby 3.3.0 HOT 2
- tiny_tds v3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiny_tds.