Skip to content

Commit

Permalink
Make LLVM build type selectable by host environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Mar 1, 2024
1 parent 6cbd9fa commit 257ea8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ ADD ${HYLO_LLVM_DOWNLOAD_URL}/${HYLO_LLVM_BUILD_RELEASE}/llvm-${LLVM_VERSION}-aa
RUN tar -x --zstd -f /opt/llvm-${LLVM_VERSION}-aarch64-unknown-linux-gnu-MinSizeRel.tar.zst -C /opt

RUN rm /opt/llvm-*.tar.zst
ENV PATH="/opt/llvm-MinSizeRel/bin:$PATH"
11 changes: 7 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo ln -s /opt/llvm-*-$(uname -m)-*-Debug /opt/llvm-Debug && sudo ln -s /opt/llvm-*-$(uname -m)-*-MinSizeRel /opt/llvm-MinSizeRel && sudo PATH=\"/opt/llvm-MinSizeRel/bin:$PATH\" ./Tools/make-pkgconfig.sh /usr/local/lib/pkgconfig/llvm.pc",

"containerEnv": {
"HYLO_LLVM_BUILD_TYPE": "${localEnv:HYLO_LLVM_BUILD_TYPE:MinSizeRel}",
},
"remoteEnv": {
"PATH": "/opt/llvm-${containerEnv:HYLO_LLVM_BUILD_TYPE}/bin:${containerEnv:PATH}"
},
"postCreateCommand": "sudo PATH=/opt/llvm-${localEnv:HYLO_LLVM_BUILD_TYPE:MinSizeRel}/bin:\"$PATH\" .devcontainer/postCreateCommand.sh",
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
uses: devcontainers/[email protected]
with:
runCmd: swift test --parallel -v -c ${{ matrix.configuration }} ${{ matrix.host.test-options }}
env:
HYLO_LLVM_BUILD_TYPE: ${{ matrix.configuration == 'debug' && 'Debug' || 'MinSizeRel' }}

build-native:
name: "Native: ${{ matrix.host.os }}/${{ matrix.configuration }}"
Expand Down

0 comments on commit 257ea8e

Please sign in to comment.