Forráskód Böngészése

Enable linux arm64 build on self hosted runner (#635)

* Update changelog with changes since v0.1.9

Signed-off-by: Sean Young <sean@mess.org>

* Enable linux arm64 build on self hosted runner

Signed-off-by: Sean Young <sean@mess.org>
Sean Young 3 éve
szülő
commit
50585197f0

+ 27 - 0
.github/workflows/build-llvm.yml

@@ -46,6 +46,33 @@ jobs:
         asset_name: llvm13.0-linux-x86-64.tar.xz
         asset_name: llvm13.0-linux-x86-64.tar.xz
         asset_content_type: application/x-xz
         asset_content_type: application/x-xz
 
 
+  linux-arm64:
+    name: Linux arm64
+    runs-on: linux-arm64
+    if: ${{ github.repository_owner == 'hyperledger-labs' }}
+    needs: create
+    steps:
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
+    - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
+        -DLLVM_ENABLE_LIBXML2=Off -DLLVM_ENABLE_ZLIB=Off
+        -DLLVM_ENABLE_PROJECTS='clang;lld'
+        -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
+      working-directory: ./llvm-project/
+    - run: cmake --build . --target install
+      working-directory: ./llvm-project/
+    - run: tar Jcf ./llvm13.0-linux-arm64.tar.xz ./llvm13.0/
+    - name: Upload Release Asset
+      id: upload-release-asset
+      uses: actions/upload-release-asset@v1
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+      with:
+        upload_url: ${{ needs.create.outputs.upload_url }}
+        asset_path: ./llvm13.0-linux-arm64.tar.xz
+        asset_name: llvm13.0-linux-arm64.tar.xz
+        asset_content_type: application/x-xz
+
   mac-arm:
   mac-arm:
     name: Mac Arm
     name: Mac Arm
     needs: create
     needs: create

+ 43 - 3
.github/workflows/release.yml

@@ -6,8 +6,8 @@ on:
 name: Build Release Binaries
 name: Build Release Binaries
 
 
 jobs:
 jobs:
-  linux:
-    name: Linux
+  linux-x86-64:
+    name: Linux x86-64
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
     steps:
     steps:
     - name: Checkout sources
     - name: Checkout sources
@@ -44,7 +44,47 @@ jobs:
       with:
       with:
         repo_token: ${{ secrets.GITHUB_TOKEN }}
         repo_token: ${{ secrets.GITHUB_TOKEN }}
         file: target/release/solang
         file: target/release/solang
-        asset_name: solang-linux
+        asset_name: solang-linux-x86-64
+        tag: ${{ github.ref }}
+
+  linux-arm64:
+    name: Linux arm64
+    runs-on: linux-arm64
+    if: ${{ github.repository_owner == 'hyperledger-labs' }}
+    steps:
+    - name: Checkout sources
+      uses: actions/checkout@v2
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
+    - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
+        -DLLVM_ENABLE_LIBXML2=Off -DLLVM_ENABLE_ZLIB=Off
+        -DLLVM_ENABLE_PROJECTS='clang;lld'
+        -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
+      working-directory: ./llvm-project/
+    - run: cmake --build . --target install
+      working-directory: ./llvm-project/
+    - run: tar Jcf ./llvm13.0-linux-arm64.tar.xz ./llvm13.0/
+    - name: Upload llvm
+      uses: svenstaro/upload-release-action@v2
+      with:
+        repo_token: ${{ secrets.GITHUB_TOKEN }}
+        file: llvm13.0-linux-arm64.tar.xz
+        asset_name: llvm13.0-linux-arm64.tar.xz
+        tag: ${{ github.ref }}
+    - name: Add LLVM to Path
+      run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
+    - name: Rust stable
+      run: rustup default 1.56.1
+    - name: Build
+      run: cargo build --verbose --release
+    - name: Run tests
+      run: cargo test --verbose --release
+    - name: Upload binary
+      uses: svenstaro/upload-release-action@v2
+      with:
+        repo_token: ${{ secrets.GITHUB_TOKEN }}
+        file: target/release/solang
+        asset_name: solang-linux-arm64
         tag: ${{ github.ref }}
         tag: ${{ github.ref }}
 
 
   windows:
   windows:

+ 32 - 11
.github/workflows/test.yml

@@ -30,8 +30,8 @@ jobs:
       - name: Run cargo clippy
       - name: Run cargo clippy
         run: cargo clippy --tests --bins -- -D warnings -D clippy::inconsistent-struct-constructor
         run: cargo clippy --tests --bins -- -D warnings -D clippy::inconsistent-struct-constructor
 
 
-  linux:
-    name: Linux
+  linux-x86-64:
+    name: Linux x86-64
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
     container: ghcr.io/hyperledger-labs/solang:ci
     container: ghcr.io/hyperledger-labs/solang:ci
     steps:
     steps:
@@ -47,7 +47,28 @@ jobs:
       run: cargo test --verbose
       run: cargo test --verbose
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
       with:
       with:
-        name: solang-linux
+        name: solang-linux-x86-64
+        path: ./target/debug/solang
+
+  linux-arm:
+    name: Linux Arm
+    runs-on: linux-arm64
+    if: ${{ github.repository_owner == 'hyperledger-labs' }}
+    container: ghcr.io/hyperledger-labs/solang:ci
+    steps:
+    - name: Checkout sources
+      # Make sure "git describe --tags" works for solang --version
+      # checkout@v2 requires git 2.18 or higher, which is not in our image
+      uses: actions/checkout@v1
+    - name: Rust stable
+      run: rustup default 1.56.1
+    - name: Build
+      run: cargo build --verbose
+    - name: Run tests
+      run: cargo test --verbose
+    - uses: actions/upload-artifact@master
+      with:
+        name: solang-linux-arm64
         path: ./target/debug/solang
         path: ./target/debug/solang
 
 
   windows:
   windows:
@@ -172,7 +193,7 @@ jobs:
     name: Solana Integration test
     name: Solana Integration test
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
     container: ubuntu:20.04
     container: ubuntu:20.04
-    needs: linux
+    needs: linux-x86-64
     services:
     services:
       solana:
       solana:
         image: solanalabs/solana:v1.8.1
         image: solanalabs/solana:v1.8.1
@@ -187,7 +208,7 @@ jobs:
         node-version: '14'
         node-version: '14'
     - uses: actions/download-artifact@master
     - uses: actions/download-artifact@master
       with:
       with:
-        name: solang-linux
+        name: solang-linux-x86-64
         path: bin
         path: bin
     - run: |
     - run: |
         chmod 755 ./bin/solang
         chmod 755 ./bin/solang
@@ -206,7 +227,7 @@ jobs:
   substrate:
   substrate:
     name: Substrate Integration test
     name: Substrate Integration test
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
-    needs: linux
+    needs: linux-x86-64
     steps:
     steps:
     - name: Checkout sources
     - name: Checkout sources
       uses: actions/checkout@v2
       uses: actions/checkout@v2
@@ -219,7 +240,7 @@ jobs:
         node-version: '14'
         node-version: '14'
     - uses: actions/download-artifact@master
     - uses: actions/download-artifact@master
       with:
       with:
-        name: solang-linux
+        name: solang-linux-x86-64
         path: bin
         path: bin
     - run: |
     - run: |
         chmod 755 ./bin/solang
         chmod 755 ./bin/solang
@@ -237,7 +258,7 @@ jobs:
     name: Burrow Integration test
     name: Burrow Integration test
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
     container: ubuntu:20.04
     container: ubuntu:20.04
-    needs: linux
+    needs: linux-x86-64
     services:
     services:
       burrow:
       burrow:
         image: hyperledger/burrow:0.34.4
         image: hyperledger/burrow:0.34.4
@@ -251,7 +272,7 @@ jobs:
         node-version: '14'
         node-version: '14'
     - uses: actions/download-artifact@master
     - uses: actions/download-artifact@master
       with:
       with:
-        name: solang-linux
+        name: solang-linux-x86-64
         path: bin
         path: bin
     - run: |
     - run: |
         chmod 755 ./bin/solang
         chmod 755 ./bin/solang
@@ -270,13 +291,13 @@ jobs:
   vscode:
   vscode:
     name: Visual Code Extension
     name: Visual Code Extension
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
-    needs: linux
+    needs: linux-x86-64
     steps:
     steps:
     - name: Checkout
     - name: Checkout
       uses: actions/checkout@v2
       uses: actions/checkout@v2
     - uses: actions/download-artifact@master
     - uses: actions/download-artifact@master
       with:
       with:
-        name: solang-linux
+        name: solang-linux-x86-64
         path: bin
         path: bin
     - run: |
     - run: |
         chmod 755 ./bin/solang
         chmod 755 ./bin/solang

+ 4 - 1
CHANGELOG.md

@@ -7,10 +7,13 @@ will be documented here.
 ### Added
 ### Added
 - On Solana, the accounts that were passed into the transactions are listed in
 - On Solana, the accounts that were passed into the transactions are listed in
   the `tx.accounts` builtin. There is also a builtin struct `AccountInfo`
   the `tx.accounts` builtin. There is also a builtin struct `AccountInfo`
+- A new common subexpression elimination pass was added, thanks to
+  [LucasSte](https://github.com/hyperledger-labs/solang/pull/550)
+- A graphviz dot file can be generated from the ast, using `--emit ast-dot`
 
 
 ### Changed
 ### Changed
 - Solang now uses LLVM 13.0, based on the [Solana LLVM tree](https://github.com/solana-labs/llvm-project/)
 - Solang now uses LLVM 13.0, based on the [Solana LLVM tree](https://github.com/solana-labs/llvm-project/)
-
+- The ast datastructure has been simplified.
 
 
 ## [0.1.9]
 ## [0.1.9]