Skip to content

Commit

Permalink
Packaging: unify tasks for Windows and non-Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
byeongkeunahn committed Dec 25, 2024
1 parent 8393bee commit dd830f6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 35 deletions.
54 changes: 21 additions & 33 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,13 @@
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build-release-amd64-win-submit",
"type": "shell",
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows.cmd > ./target/x86_64-pc-windows-msvc/release/loader.c; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.c",
"problemMatcher": [
"$rustc"
],
},
{
"label": "build-release-amd64-win-rs-submit",
"type": "shell",
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-rs.cmd > ./target/x86_64-pc-windows-msvc/release/loader.rs; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.rs",
"problemMatcher": [
"$rustc"
],
},
{
"label": "build-release-amd64-win-fn-impl-submit",
"type": "shell",
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-fn-impl.cmd > ./target/x86_64-pc-windows-msvc/release/loader.cpp; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.cpp",
"problemMatcher": [
"$rustc"
],
},
{
"label": "build-release-amd64-submit",
"type": "shell",
"command": "mkdir -p ./target/x86_64-unknown-linux-gnu/release; ./release-64bit.sh > ./target/x86_64-unknown-linux-gnu/release/loader.c; code --reuse-window ./target/x86_64-unknown-linux-gnu/release/loader.c",
"windows": {
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows.cmd > ./target/x86_64-pc-windows-msvc/release/loader.c; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.c",
},
"problemMatcher": [
"$rustc"
],
Expand All @@ -39,6 +18,9 @@
"label": "build-release-amd64-short-submit",
"type": "shell",
"command": "mkdir -p ./target/x86_64-unknown-linux-gnu-short/release; ./release.sh --features short > ./target/x86_64-unknown-linux-gnu-short/release/loader.c; code --reuse-window ./target/x86_64-unknown-linux-gnu-short/release/loader.c",
"windows": {
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows.cmd --features short > ./target/x86_64-pc-windows-msvc/release/loader_short.c; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader_short.c",
},
"problemMatcher": [
"$rustc"
],
Expand All @@ -47,14 +29,19 @@
"label": "build-release-amd64-rs-submit",
"type": "shell",
"command": "mkdir -p ./target/x86_64-unknown-linux-gnu/release; ./release-rs.sh > ./target/x86_64-unknown-linux-gnu/release/loader.rs; code --reuse-window ./target/x86_64-unknown-linux-gnu/release/loader.rs",
"windows": {
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-rs.cmd > ./target/x86_64-pc-windows-msvc/release/loader.rs; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.rs",
},
"problemMatcher": [
"$rustc"
],
},
{
"label": "build-release-amd64-rs-short-submit",
"type": "shell",
"command": "mkdir -p ./target/x86_64-unknown-linux-gnu-short/release; ./release-rs.sh --features short > ./target/x86_64-unknown-linux-gnu-short/release/loader.rs; code --reuse-window ./target/x86_64-unknown-linux-gnu-short/release/loader.rs",
"command": "mkdir -p ./target/x86_64-unknown-linux-gnu-short/release; ./release-rs.sh --features short > ./target/x86_64-unknown-linux-gnu-short/release/loader.rs; code --reuse-window ./target/x86_64-unknown-linux-gnu-short/release/loader.rs", "windows": {
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-rs.cmd --features short > ./target/x86_64-pc-windows-msvc/release/loader_short.rs; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader_short.rs",
},
"problemMatcher": [
"$rustc"
],
Expand All @@ -63,6 +50,9 @@
"label": "build-release-amd64-fn-impl-submit",
"type": "shell",
"command": "mkdir -p ./target/x86_64-unknown-linux-gnu/release; ./release-64bit-fn-impl.sh > ./target/x86_64-unknown-linux-gnu/release/loader.cpp; code --reuse-window ./target/x86_64-unknown-linux-gnu/release/loader.cpp",
"windows": {
"command": "mkdir ./target/x86_64-pc-windows-msvc/release; ./release-64bit-windows-fn-impl.cmd > ./target/x86_64-pc-windows-msvc/release/loader.cpp; code --reuse-window ./target/x86_64-pc-windows-msvc/release/loader.cpp",
},
"problemMatcher": [
"$rustc"
],
Expand All @@ -71,6 +61,9 @@
"label": "build-release-i686-submit",
"type": "shell",
"command": "mkdir -p ./target/i686-unknown-linux-gnu/release; ./release-32bit.sh > ./target/i686-unknown-linux-gnu/release/loader.c; code --reuse-window ./target/i686-unknown-linux-gnu/release/loader.c",
"windows": {
"command": "echo 'i686 build is only supported on Linux.'"
},
"problemMatcher": [
"$rustc"
],
Expand All @@ -79,14 +72,9 @@
"label": "build-release-wasm32-submit",
"type": "shell",
"command": "mkdir -p ./target/wasm32-unknown-unknown/release; ./release-wasm32.sh > ./target/wasm32-unknown-unknown/release/loader.js; code --reuse-window ./target/wasm32-unknown-unknown/release/loader.js",
"problemMatcher": [
"$rustc"
],
},
{
"label": "build-release-wasm32-win-submit",
"type": "shell",
"command": "mkdir -p ./target/wasm32-unknown-unknown/release; ./release-wasm32.cmd > ./target/wasm32-unknown-unknown/release/loader.js; code --reuse-window ./target/wasm32-unknown-unknown/release/loader.js",
"windows": {
"command": "mkdir -p ./target/wasm32-unknown-unknown/release; ./release-wasm32.cmd > ./target/wasm32-unknown-unknown/release/loader.js; code --reuse-window ./target/wasm32-unknown-unknown/release/loader.js",
},
"problemMatcher": [
"$rustc"
],
Expand Down
10 changes: 8 additions & 2 deletions scripts/static-pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ def main(args):
elif target in ["x86_64-pc-windows-msvc", "x86_64-pc-windows-gnu"]:
stub = "static-pie-stub-amd64.bin"
if lang == "C":
template = "static-pie-template-amd64.c"
if short:
template = "static-pie-template-amd64-short.c"
else:
template = "static-pie-template-amd64.c"
elif lang == "CFnImpl":
template = "static-pie-template-amd64-fn-impl.cpp"
elif lang == "Rust":
template = "static-pie-template-amd64.rs"
if short:
template = "static-pie-template-amd64-short.rs"
else:
template = "static-pie-template-amd64.rs"
else:
print(f"Language ${lang} is not supported for target ${target}", file=sys.stderr)
exit()
Expand Down

0 comments on commit dd830f6

Please sign in to comment.