add linux32 to i686 builds (#338)
* add linux32 to i686 builds * Add test. Fix bug with space. * Apply suggestions from code review apply suggestions Co-authored-by: Joe Rickerby <joerick@mac.com> * change uname to platform.machine Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
co-authored by
Joe Rickerby
parent
328a6714e9
commit
3f3effe25d
@@ -109,6 +109,7 @@ def build(options: BuildOptions):
|
||||
container_name = 'cibuildwheel-{}'.format(uuid.uuid4())
|
||||
|
||||
try:
|
||||
shell_cmd = ['linux32', '/bin/bash'] if platform_tag.endswith("i686") else ['/bin/bash']
|
||||
call(['docker', 'create',
|
||||
'--env', 'CIBUILDWHEEL',
|
||||
'--name', container_name,
|
||||
@@ -136,7 +137,7 @@ def build(options: BuildOptions):
|
||||
)
|
||||
|
||||
call(
|
||||
['docker', 'exec', '-i', container_name, '/bin/bash'],
|
||||
['docker', 'exec', '-i', container_name] + shell_cmd,
|
||||
universal_newlines=True,
|
||||
input='''
|
||||
# give xtrace output an extra level of indent inside docker
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
import struct
|
||||
from unittest import TestCase
|
||||
|
||||
import spam
|
||||
@@ -43,3 +45,12 @@ class TestSpam(TestCase):
|
||||
print("=[listdir]2", os.listdir(os.path.join(virtualenv_path, 'bin')))
|
||||
self.assertTrue(path_contains(virtualenv_path, sys.executable))
|
||||
self.assertTrue(path_contains(virtualenv_path, spam.__file__))
|
||||
|
||||
def test_uname(self):
|
||||
if platform.system() == "Windows":
|
||||
return
|
||||
# if we're running in 32-bit Python, check that the machine is i686.
|
||||
# See #336 for more info.
|
||||
bits = struct.calcsize("P") * 8
|
||||
if bits == 32:
|
||||
self.assertEqual(platform.machine(), "i686")
|
||||
|
||||
Reference in New Issue
Block a user