Skip to content

Commit 0d27319

Browse files
committed
More conda build fixes
- Allow overriding libtiledbvcf path from command line - Use -g and -O0 with debug option - Don't overlink the arrow core library - Bump the pyarrow minimum version to fix test errors - Switch CI to ubuntu-18.04 image
1 parent dcad25c commit 0d27319

4 files changed

Lines changed: 34 additions & 22 deletions

File tree

.azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
ubuntu_16:
12-
imageName: 'ubuntu-16.04'
12+
imageName: 'ubuntu-18.04'
1313
python.version: '3.x'
1414
CXX: g++
1515
BUILD_PYTHON_API: ON
@@ -25,4 +25,4 @@ jobs:
2525
inputs:
2626
versionSpec: '$(python.version)'
2727
architecture: 'x64'
28-
- template: ci/azure-linux_mac.yml
28+
- template: ci/azure-linux_mac.yml

apis/python/conda-env.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- python>=3.4
66
- pybind11=2.3.0
7-
- pyarrow=0.14.1
7+
- pyarrow>=0.16.0
88
- dask>=0.19.0
99
- pip
1010
- pip:

apis/python/setup.py

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@
3939
import subprocess
4040
import sys
4141

42+
TILEDBVCF_DEBUG_BUILD = False
43+
LIBTILEDBVCF_PATH = None
44+
4245
args = sys.argv[:]
4346
for arg in args:
4447
if arg.find('--debug') == 0:
4548
TILEDBVCF_DEBUG_BUILD = True
4649
sys.argv.remove(arg)
47-
else:
48-
TILEDBVCF_DEBUG_BUILD = False
50+
if arg.find('--libtiledbvcf') == 0:
51+
LIBTILEDBVCF_PATH = arg.split('=')[1]
52+
sys.argv.remove(arg)
53+
4954

5055
class get_pybind_include(object):
5156
"""Helper class to determine the pybind11 include path
@@ -81,6 +86,10 @@ class PathConfig(object):
8186

8287
def find_libtiledbvcf():
8388
p = PathConfig()
89+
90+
if LIBTILEDBVCF_PATH:
91+
p.native_lib_install_dirs = [LIBTILEDBVCF_PATH]
92+
8493
libdirs = ['lib']
8594
libnames = ['libtiledbvcf.dylib', 'libtiledbvcf.so']
8695
for root in p.native_lib_install_dirs:
@@ -161,16 +170,17 @@ def find_or_build_libtiledbvcf(setuptools_cmd):
161170
tiledbvcf_ext.include_dirs += [inc_dir]
162171

163172
# Copy native libs into the package dir so they can be found by package_data
164-
native_libs = [os.path.join(lib_dir, f) for f in os.listdir(lib_dir)]
165-
p = PathConfig()
166-
package_data = []
167-
for obj in native_libs:
168-
shutil.copy(obj, p.pkg_src)
169-
package_data.append(os.path.basename(obj))
173+
if LIBTILEDBVCF_PATH is None:
174+
native_libs = [os.path.join(lib_dir, f) for f in os.listdir(lib_dir)]
175+
p = PathConfig()
176+
package_data = []
177+
for obj in native_libs:
178+
shutil.copy(obj, p.pkg_src)
179+
package_data.append(os.path.basename(obj))
170180

171-
# Install shared libraries inside the Python module via package_data.
172-
print('Adding to package_data: {}'.format(package_data))
173-
setuptools_cmd.distribution.package_data.update({'tiledbvcf': package_data})
181+
# Install shared libraries inside the Python module via package_data.
182+
print('Adding to package_data: {}'.format(package_data))
183+
setuptools_cmd.distribution.package_data.update({'tiledbvcf': package_data})
174184

175185

176186
def get_ext_modules():
@@ -195,8 +205,11 @@ class BuildExtCmd(build_ext):
195205

196206
def build_extensions(self):
197207
opts = ['-std=c++11', '-g']
198-
if not TILEDBVCF_DEBUG_BUILD:
199-
opts.append('-O2')
208+
if TILEDBVCF_DEBUG_BUILD:
209+
opts.extend(['-O0'])
210+
else:
211+
opts.extend(['-O2'])
212+
200213
link_opts = []
201214
for ext in self.extensions:
202215
ext.extra_compile_args = opts
@@ -205,6 +218,8 @@ def build_extensions(self):
205218
import pyarrow
206219
ext.include_dirs.append(pyarrow.get_include())
207220
ext.libraries.extend(pyarrow.get_libraries())
221+
# don't overlink the arrow core library
222+
if 'arrow' in ext.libraries: ext.libraries.remove('arrow')
208223
ext.library_dirs.extend(pyarrow.get_library_dirs())
209224

210225
find_or_build_libtiledbvcf(self)

ci/azure-linux_mac.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ steps:
3737
displayName: 'Install dependencies'
3838

3939
- bash: |
40-
# DELETEME work-around for https://github.com/microsoft/azure-pipelines-image-generation/issues/969
41-
sudo chown root.root /
42-
4340
# azure bash does not treat intermediate failure as error
4441
# https://github.com/Microsoft/azure-pipelines-yaml/issues/135
4542
set -e pipefail
@@ -61,12 +58,12 @@ steps:
6158
make check
6259
../test/run-cli-tests.sh . ../test/inputs
6360
64-
sudo make install-libtiledbvcf
61+
make install-libtiledbvcf
6562
6663
displayName: 'Build and test TileDB-VCF'
6764

6865
- bash: |
69-
set -e pipefail
66+
set -ex pipefail
7067
7168
if [[ "$BUILD_PYTHON_API" == "ON" ]]; then
7269
# Add conda to PATH
@@ -119,4 +116,4 @@ steps:
119116
cat $f
120117
done;
121118
condition: failed() # only run this job if the build step failed
122-
displayName: "Print log files (failed build only)"
119+
displayName: "Print log files (failed build only)"

0 commit comments

Comments
 (0)