Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,59 +315,6 @@ jobs:
- test-bazel-windows

workflows:
lint:
jobs:
- lint
test-linux:
jobs:
- test-linux
test-linux-arm64:
jobs:
- test-linux-arm64
test-mac-arm64:
jobs:
- test-mac-arm64
test-windows:
jobs:
- test-windows
build-docker-image:
jobs:
- build-docker-image-x64
- publish-docker-image-x64:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
- publish-docker-image-arm64:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
- publish-docker-image-multiplatform:
filters:
tags:
only: /.*/
requires:
- publish-docker-image-x64
- publish-docker-image-arm64

test-bazel7-linux:
jobs:
- test-bazel7-linux
test-bazel-latest-linux:
jobs:
- test-bazel-latest-linux
test-bazel7-mac-arm64:
jobs:
- test-bazel7-mac-arm64
test-bazel-latest-mac-arm64:
jobs:
- test-bazel-latest-mac-arm64
test-bazel7-windows:
jobs:
- test-bazel7-windows
test-bazel-latest-windows:
jobs:
- test-bazel-latest-windows
2 changes: 2 additions & 0 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ def untargz(source_filename, dest_dir):
# See https://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath and http://stackoverflow.com/questions/3555527/python-win32-filename-length-workaround
# In that mode, forward slashes cannot be used as delimiters.
def fix_potentially_long_windows_pathname(pathname):
# DO NOT SUBMIT: testing
#return pathname
if not WINDOWS or MSYS:
return pathname
# Test if emsdk calls fix_potentially_long_windows_pathname() with long
Expand Down
41 changes: 37 additions & 4 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ def listify(x):
return [x]


def copy_emsdk_to(targetdir):
for filename in os.listdir('.'):
if not filename.startswith('.') and not os.path.isdir(filename):
shutil.copy2(filename, os.path.join(targetdir, filename))


def check_call(cmd, **kwargs):
if type(cmd) is not list:
cmd = cmd.split()
Expand Down Expand Up @@ -137,6 +143,35 @@ def setUp(self):
run_emsdk('install latest')
run_emsdk('activate latest')

def test_extrememly_long_filenames(self):
# We have special support for filenames longer than 256 on windows. This
# test installs emsdk in path that exceeds this limit in order to test
# this handling.
longpath = 'very_long_filename_indeed'
while len(longpath) < 256:
longpath = os.path.join(longpath, longpath)

if WINDOWS:
longpath = '\\\\?\\' + os.path.abspath(longpath)

os.makedirs(longpath, exist_ok=True)
copy_emsdk_to(longpath)

emsdk = os.path.join(longpath, 'emsdk')
if WINDOWS:
emsdk += '.bat'
print(emsdk)
self.assertTrue(os.path.exists(emsdk))

check_call([emsdk, 'install', 'latest'])
check_call([emsdk, 'activate', 'latest'])

emcc = os.path.join(longpath, 'upstream', 'emscripten', 'emcc')
print(emcc)
self.assertTrue(os.path.exists(emcc))

check_call([emcc, 'hello_world.c'])

def test_unknown_arch(self):
env = os.environ.copy()
env['EMSDK_ARCH'] = 'mips'
Expand Down Expand Up @@ -236,9 +271,7 @@ def test_update_no_git(self):
print('test non-git update')

temp_dir = tempfile.mkdtemp()
for filename in os.listdir('.'):
if not filename.startswith('.') and not os.path.isdir(filename):
shutil.copy2(filename, os.path.join(temp_dir, filename))
copy_emsdk_to(temp_dir)

olddir = os.getcwd()
try:
Expand Down Expand Up @@ -278,4 +311,4 @@ def test_keep_downloads(self):


if __name__ == '__main__':
unittest.main(verbosity=2)
unittest.main(verbosity=2, failfast=True)