You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ri...@apache.org on 2017/11/20 18:45:58 UTC

madlib git commit: Build: Create single binary for all PG10 versions

Repository: madlib
Updated Branches:
  refs/heads/master 7a6f6cd5b -> 5d66df8fd


Build: Create single binary for all PG10 versions

JIRA: MADLIB-1179

Postgresql starting 10.0 is switching to semantic versioning (see
https://www.postgresql.org/support/versioning). Hence, we can build a
single MADlib binary that supports all 10.x PG versions.

Closes #203


Project: http://git-wip-us.apache.org/repos/asf/madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/5d66df8f
Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/5d66df8f
Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/5d66df8f

Branch: refs/heads/master
Commit: 5d66df8fddd0230d1dcfe1e733229c6431f21235
Parents: 7a6f6cd
Author: Rahul Iyer <ri...@apache.org>
Authored: Thu Nov 16 14:29:30 2017 -0800
Committer: Rahul Iyer <ri...@apache.org>
Committed: Mon Nov 20 10:45:34 2017 -0800

----------------------------------------------------------------------
 src/madpack/madpack.py                          |  6 +++++-
 src/ports/postgres/10.0/CMakeLists.txt          | 21 --------------------
 src/ports/postgres/10/CMakeLists.txt            | 21 ++++++++++++++++++++
 .../postgres/cmake/FindPostgreSQL_10.cmake      | 21 ++++++++++++++++++++
 .../postgres/cmake/FindPostgreSQL_10_0.cmake    | 21 --------------------
 src/ports/postgres/cmake/PostgreSQLUtils.cmake  | 14 +++++++++----
 6 files changed, 57 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/5d66df8f/src/madpack/madpack.py
----------------------------------------------------------------------
diff --git a/src/madpack/madpack.py b/src/madpack/madpack.py
index b23009a..aa78a52 100755
--- a/src/madpack/madpack.py
+++ b/src/madpack/madpack.py
@@ -1109,7 +1109,11 @@ def main(argv):
                 else:
                     # only need the first two digits for <= 4.3.4
                     dbver = '.'.join(dbver_split[:2])
-
+            elif portid == 'postgres':
+                if is_rev_gte(dbver_split, get_rev_num('10.0')):
+                    # Postgres starting 10.0 uses semantic versioning. Hence,
+                    # only need first digit for major version.
+                    dbver = str(dbver_split[0])
             if not os.path.isdir(os.path.join(portdir, dbver)):
                 _error("This version is not among the %s versions for which "
                        "MADlib support files have been installed (%s)." %

http://git-wip-us.apache.org/repos/asf/madlib/blob/5d66df8f/src/ports/postgres/10.0/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/ports/postgres/10.0/CMakeLists.txt b/src/ports/postgres/10.0/CMakeLists.txt
deleted file mode 100644
index 9c46780..0000000
--- a/src/ports/postgres/10.0/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# ------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ------------------------------------------------------------------------------
-
-add_current_postgresql_version()
-add_extension_support()

http://git-wip-us.apache.org/repos/asf/madlib/blob/5d66df8f/src/ports/postgres/10/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/ports/postgres/10/CMakeLists.txt b/src/ports/postgres/10/CMakeLists.txt
new file mode 100644
index 0000000..9c46780
--- /dev/null
+++ b/src/ports/postgres/10/CMakeLists.txt
@@ -0,0 +1,21 @@
+# ------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ------------------------------------------------------------------------------
+
+add_current_postgresql_version()
+add_extension_support()

http://git-wip-us.apache.org/repos/asf/madlib/blob/5d66df8f/src/ports/postgres/cmake/FindPostgreSQL_10.cmake
----------------------------------------------------------------------
diff --git a/src/ports/postgres/cmake/FindPostgreSQL_10.cmake b/src/ports/postgres/cmake/FindPostgreSQL_10.cmake
new file mode 100644
index 0000000..43ba0e4
--- /dev/null
+++ b/src/ports/postgres/cmake/FindPostgreSQL_10.cmake
@@ -0,0 +1,21 @@
+# ------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ------------------------------------------------------------------------------
+
+set(_FIND_PACKAGE_FILE "${CMAKE_CURRENT_LIST_FILE}")
+include("${CMAKE_CURRENT_LIST_DIR}/FindPostgreSQL.cmake")

http://git-wip-us.apache.org/repos/asf/madlib/blob/5d66df8f/src/ports/postgres/cmake/FindPostgreSQL_10_0.cmake
----------------------------------------------------------------------
diff --git a/src/ports/postgres/cmake/FindPostgreSQL_10_0.cmake b/src/ports/postgres/cmake/FindPostgreSQL_10_0.cmake
deleted file mode 100644
index 43ba0e4..0000000
--- a/src/ports/postgres/cmake/FindPostgreSQL_10_0.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
-# ------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ------------------------------------------------------------------------------
-
-set(_FIND_PACKAGE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-include("${CMAKE_CURRENT_LIST_DIR}/FindPostgreSQL.cmake")

http://git-wip-us.apache.org/repos/asf/madlib/blob/5d66df8f/src/ports/postgres/cmake/PostgreSQLUtils.cmake
----------------------------------------------------------------------
diff --git a/src/ports/postgres/cmake/PostgreSQLUtils.cmake b/src/ports/postgres/cmake/PostgreSQLUtils.cmake
index 8f71193..30962bb 100644
--- a/src/ports/postgres/cmake/PostgreSQLUtils.cmake
+++ b/src/ports/postgres/cmake/PostgreSQLUtils.cmake
@@ -69,10 +69,9 @@ function(determine_target_versions OUT_VERSIONS)
             if(${PORT_UC} STREQUAL "GREENPLUM")
                 # Starting GPDB 5.0, semantic versioning will be followed,
                 # implying we only need 1 folder for same major versions
-                if(${${PORT_UC}_VERSION_MAJOR} EQUAL 5)
-                    set(VERSION "5")
-                elseif(${${PORT_UC}_VERSION_MAJOR} EQUAL 6)
-                    set(VERSION "6")
+                if(${${PORT_UC}_VERSION_MAJOR} EQUAL 5 OR
+                       ${${PORT_UC}_VERSION_MAJOR} GREATER 5)
+                    set(VERSION ${${PORT_UC}_VERSION_MAJOR})
 
                 # Due to the ABI incompatibility between 4.3.4 and 4.3.5,
                 # MADlib treat 4.3.5+ as DB version that is different from 4.3
@@ -81,6 +80,13 @@ function(determine_target_versions OUT_VERSIONS)
                         ${${PORT_UC}_VERSION_PATCH} GREATER 4)
                     set(VERSION "4.3ORCA")
                 endif()
+            elseif(${PORT_UC} STREQUAL "POSTGRESQL" AND
+                    (${${PORT_UC}_VERSION_MAJOR} EQUAL 10 OR
+                    ${${PORT_UC}_VERSION_PATCH} GREATER 10))
+                # Starting Postgresql 10, semantic versioning will be followed,
+                # implying we only need 1 folder for same major versions
+                set(VERSION ${${PORT_UC}_VERSION_MAJOR})
+
             elseif(${PORT_UC} STREQUAL "HAWQ" AND
                     ${${PORT_UC}_VERSION_MAJOR} EQUAL 2)
                 # Starting HAWQ 2.0, semantic versioning will be followed,