From 0ff48e2b6ccaeaa0f143f4dd5c88103e4aa83dc5 Mon Sep 17 00:00:00 2001 From: Julie Date: Sun, 16 Oct 2022 18:54:32 -0400 Subject: [PATCH 1/6] try gnutls --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index 395791d..180f47d 100755 --- a/bin/compile +++ b/bin/compile @@ -140,6 +140,7 @@ build_and_install_freetds() { cat < ".build_options" ./configure \ "--prefix=${APP_TARGET_DIR}" \ + --with-gnutls \ --disable-odbc \ --disable-debug \ "--with-tdsver=${TDS_VERSION}" From 983d776d07a2137f1f74b9c8573a75350a110db8 Mon Sep 17 00:00:00 2001 From: Julie Date: Mon, 17 Oct 2022 09:55:19 -0400 Subject: [PATCH 2/6] Allow GNUTLS to be toggled on and off --- bin/compile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 180f47d..72f74f4 100755 --- a/bin/compile +++ b/bin/compile @@ -56,11 +56,12 @@ load_env_vars() { local env_var; env_var="${1:-}" until [ -z "$env_var" ]; do [ -f "$ENV_DIR/$env_var" ] && export "$env_var=$(cat "$ENV_DIR/$env_var")"; shift ; env_var="${1:-}" ; done } -load_env_vars "FREETDS_VERSION" "FREETDS_ARCHIVE_NAME" "TDS_VERSION" "FREETDS_REBUILD" +load_env_vars "FREETDS_VERSION" "FREETDS_ARCHIVE_NAME" "TDS_VERSION" "FREETDS_REBUILD" "USE_GNUTLS" FREETDS_VERSION="${FREETDS_VERSION:-1.00.109}" FREETDS_ARCHIVE_NAME="${FREETDS_ARCHIVE_NAME:-freetds-${FREETDS_VERSION}}" TDS_VERSION="${TDS_VERSION:-7.3}" # or TDSVER +USE_GNUTLS="${USE_GNUTLS:---with-gnutls}" CACHED_TAR="${CACHE_DIR}/freetds-${FREETDS_VERSION}-heroku.tar.bz2" # Default rebuild to true since I'm having issues linking the library to tiny_tds gem with a cached build. @@ -137,10 +138,14 @@ build_and_install_freetds() { # FreeTDS advises caching the build options as below # adding --disable-odbc making linking easier and we don't need it # adding --disable-debug to speed up compile + + # As of Oct. 2022, heroku-22 stack currently only works with gnutls. + # Allow this to be toggled off in the future with `export USE_GNUTLS=" "` + # See https://github.com/FreeTDS/freetds/issues/336 for some mor information. cat < ".build_options" ./configure \ "--prefix=${APP_TARGET_DIR}" \ - --with-gnutls \ + "${USE_GNUTLS}" \ --disable-odbc \ --disable-debug \ "--with-tdsver=${TDS_VERSION}" From 65b44c14d2bf370f0c1f9aa3bd200c274cb3aa21 Mon Sep 17 00:00:00 2001 From: JewlsIOB <100804512+JewlsIOB@users.noreply.github.com> Date: Mon, 17 Oct 2022 09:58:41 -0400 Subject: [PATCH 3/6] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 308d585..61079f7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Or at least, that's the hope! ## Stack compatibility -This buildpack is tested primarily against the `cedar-18` stack. +This buildpack is tested primarily against the `heroku-22` stack. Allows for usage of [TinyTDS](https://github.com/rails-sqlserver/tiny_tds) on Heroku. @@ -94,6 +94,9 @@ Print TinyTDS build logs to the screen: echo -e "\n\n----------------------- $cmd------------------\n\n"; eval "$cmd"; done ; ) ``` +### Connection Timeout +If you receive connection timeout errors, consider TLS/gnutls. You can set the environment variable heroku config:set USE_GNUTLS=" " and temporarily set `heroku config:set FREETDS_REBUILD=true` to rebuild the code using TLS. See https://github.com/FreeTDS/freetds/issues/336 for some more information + License ------- From 3a7c65eb796d721d5bb2794cd11e32662608fe30 Mon Sep 17 00:00:00 2001 From: JewlsIOB <100804512+JewlsIOB@users.noreply.github.com> Date: Mon, 17 Oct 2022 10:00:03 -0400 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61079f7..56ba814 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ echo -e "\n\n----------------------- $cmd------------------\n\n"; eval "$cmd"; d ``` ### Connection Timeout -If you receive connection timeout errors, consider TLS/gnutls. You can set the environment variable heroku config:set USE_GNUTLS=" " and temporarily set `heroku config:set FREETDS_REBUILD=true` to rebuild the code using TLS. See https://github.com/FreeTDS/freetds/issues/336 for some more information +If you receive connection timeout errors (e.g. "Adaptive Server connection failed"), consider whether TLS/gnutls is interacting poorly with heroku or the server where your mssql server lives. You can set the environment variable `heroku config:set USE_GNUTLS=" "` and temporarily set `heroku config:set FREETDS_REBUILD=true` to rebuild the code using TLS. See https://github.com/FreeTDS/freetds/issues/336 for more information. License ------- From ef710713a3f1cc0ba103ba9cccb5732a8aeee023 Mon Sep 17 00:00:00 2001 From: Julie Date: Wed, 19 Oct 2022 14:01:05 -0400 Subject: [PATCH 5/6] fix typo --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 72f74f4..f53abdb 100755 --- a/bin/compile +++ b/bin/compile @@ -141,7 +141,7 @@ build_and_install_freetds() { # As of Oct. 2022, heroku-22 stack currently only works with gnutls. # Allow this to be toggled off in the future with `export USE_GNUTLS=" "` - # See https://github.com/FreeTDS/freetds/issues/336 for some mor information. + # See https://github.com/FreeTDS/freetds/issues/336 for some more information. cat < ".build_options" ./configure \ "--prefix=${APP_TARGET_DIR}" \ From 4e4dd315c47ece01c7fced73b83b52eaaa06c3e4 Mon Sep 17 00:00:00 2001 From: Julie Date: Wed, 19 Oct 2022 14:02:43 -0400 Subject: [PATCH 6/6] more comments --- bin/compile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index f53abdb..6de00d2 100755 --- a/bin/compile +++ b/bin/compile @@ -141,7 +141,9 @@ build_and_install_freetds() { # As of Oct. 2022, heroku-22 stack currently only works with gnutls. # Allow this to be toggled off in the future with `export USE_GNUTLS=" "` - # See https://github.com/FreeTDS/freetds/issues/336 for some more information. + # See https://github.com/FreeTDS/freetds/issues/336 + # and https://www.freetds.org/userguide/config.html + # for more information. cat < ".build_options" ./configure \ "--prefix=${APP_TARGET_DIR}" \