Skip to content
Merged
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
2 changes: 1 addition & 1 deletion dist/setup_cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/setup_cpp.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^1.7.2",
"escape-path-with-spaces": "^1.0.0",
"execa": "^5.1.1",
"mri": "^1.2.0",
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/llvm/llvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ export async function activateLLVM(directory: string, versionGiven: string) {
}
}

addEnv("LDFLAGS", `-L${directory}/lib`)
addEnv("CPPFLAGS", `-I${directory}/include`)
addEnv("LDFLAGS", `-L"${directory}/lib"`)
addEnv("CPPFLAGS", `-I"${directory}/include"`)

addEnv("CC", `${directory}/bin/clang`)
addEnv("CXX", `${directory}/bin/clang++`)
Expand Down
4 changes: 3 additions & 1 deletion src/utils/env/addEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { appendFileSync, existsSync, readFileSync } from "fs"
import { error, warning } from "../io/io"
import { execPowershell } from "../exec/powershell"
import { delimiter } from "path"
import { escapeSpace } from "../path/escape_space"

/** An add path function that works locally or inside GitHub Actions */
export function addEnv(name: string, val: string | undefined) {
export function addEnv(name: string, valGiven: string | undefined, shouldEscapeSpace: boolean = false) {
const val = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven
try {
if (isGitHubCI()) {
exportVariable(name, val)
Expand Down
11 changes: 11 additions & 0 deletions src/utils/path/escape_space.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import escape from "escape-path-with-spaces"

/// Escape the spaces in the given path
export function escapeSpace(path: string | undefined): string {
if (path === undefined) {
return ""
}
return escape(path)
}
2 changes: 1 addition & 1 deletion src/utils/tests/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import spawn from "cross-spawn"
import { existsSync } from "fs"

export async function setupTmpDir(testName: string) {
const tempDirectory = path.join(tmpdir(), "setup-cpp", testName)
const tempDirectory = path.join(tmpdir(), "setup cpp temp", testName)
try {
await io.rmRF(tempDirectory)
await io.mkdirP(tempDirectory)
Expand Down