diff --git a/README.md b/README.md index 77052da..1440730 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Weave, a state-of-the-art multithreading runtime [![Build Status: Travis](https://img.shields.io/travis/com/mratsim/weave/master?label=Travis%20%28Linux%20x86_64%2FARM64%29)](https://travis-ci.com/mratsim/weave) -[![Build Status: Azure](https://img.shields.io/azure-devops/build/numforge/69bc2700-4fa7-4292-a0b3-331ddb721640/2/master?label=Azure%20%28C%2FC%2B%2B%2C%20Linux%2032-bit%2F64-bit%2C%20Windows%2032-bit%2F64-bit%2C%20MacOS%2064-bit%29)](https://dev.azure.com/numforge/Weave/_build?definitionId=2&branchName=master) +[![Build Status: Azure](https://img.shields.io/azure-devops/build/numforge/69bc2700-4fa7-4292-a0b3-331ddb721640/2/master?label=Azure%20%28C%2FC%2B%2B%2C%20Linux%2064-bit%2C%20Windows%2064-bit%2C%20MacOS%2064-bit%29)](https://dev.azure.com/numforge/Weave/_build?definitionId=2&branchName=master) [![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 20e46b8..4ba8473 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,49 +1,56 @@ strategy: maxParallel: 10 matrix: - # Nim requires enforcing ARCH="x86" and ucpu - # for 32-bit targets as it seems like Azure machines are 64-bit - # TODO: C++ is allowed to fail - # Nim doesn't compile pledges properly in C++ mode - Windows_devel_32bit: - VM: 'windows-latest' - ARCH: x86 - ucpu: i686 - PLATFORM: x86 - CHANNEL: devel - WEAVE_TEST_LANG: c + # TODO: Nim doesn't compile pledges properly in C++ mode + # TODO: Windows 32-bit requires EnterSynchronizationBarrier support in mingw-w64 + # TODO: Linux 32-bit requires gcc -m32 setup + + # Windows_devel_32bit: + # VM: 'windows-latest' + # ARCH: x86 + # UCPU: i686 + # PLATFORM: x86 + # CHANNEL: devel + # TEST_LANG: c Windows_devel_64bit: VM: 'windows-latest' + UCPU: amd64 PLATFORM: x64 CHANNEL: devel - WEAVE_TEST_LANG: c + TEST_LANG: c # Windows_cpp_devel_64bit: # VM: 'windows-latest' + # UCPU: amd64 # PLATFORM: x64 # CHANNEL: devel - # WEAVE_TEST_LANG: cpp + # TEST_LANG: cpp Linux_devel_64bit: VM: 'ubuntu-16.04' + UCPU: amd64 PLATFORM: x64 CHANNEL: devel - WEAVE_TEST_LANG: c + TEST_LANG: c # Linux_cpp_devel_64bit: # VM: 'ubuntu-16.04' + # UCPU: amd64 # PLATFORM: x64 # CHANNEL: devel # WEAVE_TEST_LANG: cpp - Linux_devel_32bit: - VM: 'ubuntu-16.04' - PLATFORM: x86 - ucpu: i686 - CHANNEL: devel - WEAVE_TEST_LANG: c + + # Linux_devel_32bit: + # VM: 'ubuntu-16.04' + # ARCH: x86 + # PLATFORM: x86 + # UCPU: i686 + # CHANNEL: devel + # TEST_LANG: c + MacOS_devel_64bit: VM: 'macOS-10.14' + UCPU: amd64 PLATFORM: x64 CHANNEL: devel - WEAVE_TEST_LANG: c - + TEST_LANG: c pool: vmImage: $(VM) @@ -113,6 +120,9 @@ steps: - bash: | echo "PATH=${PATH}" + gcc -v + echo "UCPU=${UCPU}" + if [ "${CHANNEL}" = stable ]; then BRANCH="v$(curl https://nim-lang.org/channels/stable)" else @@ -126,7 +136,7 @@ steps: git clone --depth 1 https://github.com/nim-lang/csources csources/ pushd csources - make -j $ncpu CC=gcc + make -j $ncpu ucpu=${UCPU} CC=gcc popd rm -rf csources bin/nim c koch @@ -143,34 +153,17 @@ steps: fi popd # exit nim-CHANNEL popd # exit NimBinaries + echo "##vso[task.prependpath]$PWD/NimBinaries/nim-${CHANNEL}/bin" displayName: 'Building Nim' - # Nimble uses findExe which is broken under bash windows - # We need to set PATH in the collector for the next tast - # and also update it within this task with export - - bash: | - echo "##vso[task.prependpath]$PWD/NimBinaries/nim-${CHANNEL}/bin" - displayName: 'Set env variable (Posix)' - condition: ne(variables['Agent.OS'], 'Windows_NT') - bash: | echo "PATH=${PATH}" nimble refresh nimble install cligen synthesis - displayName: 'Building the package dependencies (Posix)' - condition: ne(variables['Agent.OS'], 'Windows_NT') - - - powershell: | - echo "##vso[task.prependpath]$pwd\NimBinaries\nim-$(CHANNEL)\bin" - displayName: 'Set env variable (Windows)' - condition: eq(variables['Agent.OS'], 'Windows_NT') - - powershell: | - echo $Env:Path - nimble refresh - nimble install cligen synthesis - displayName: 'Building the package dependencies (Windows)' - condition: eq(variables['Agent.OS'], 'Windows_NT') + displayName: 'Building the package dependencies' - bash: | echo "PATH=${PATH}" + export ucpu=${UCPU} nimble test displayName: 'Testing the package' diff --git a/weave.nimble b/weave.nimble index 9ff5cdb..62897bb 100644 --- a/weave.nimble +++ b/weave.nimble @@ -17,8 +17,8 @@ proc test(flags, path: string) = # Compilation language is controlled by WEAVE_TEST_LANG var lang = "c" - if existsEnv"WEAVE_TEST_LANG": - lang = getEnv"WEAVE_TEST_LANG" + if existsEnv"TEST_LANG": + lang = getEnv"TEST_LANG" echo "\n========================================================================================" echo "Running [", flags, "] ", path diff --git a/weave/channels/pledges.nim b/weave/channels/pledges.nim index de32040..cbd45e8 100644 --- a/weave/channels/pledges.nim +++ b/weave/channels/pledges.nim @@ -511,7 +511,11 @@ macro delayedUntilMulti*(task: Task, pool: var TLPoolAllocator, pledges: varargs # Sanity checks # ------------------------------------------------------------------------------ -assert sizeof(default(TaskNode)[]) == 40, +when sizeof(pointer) == 8: + let expectedSize = 40 +else: + let expectedSize = 20 +assert sizeof(default(TaskNode)[]) == expectedSize, "TaskNode size was " & $sizeof(default(TaskNode)[]) assert sizeof(ChannelMpscUnboundedBatch[TaskNode]) == 128,