Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip checking linkname when running PCSP test #691

Merged
merged 1 commit into from
Aug 21, 2024
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: 2 additions & 0 deletions .github/workflows/unit_test-linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
./scripts/test_race.sh

- name: PCSP Test
env:
GOVERSION: ${{ matrix.go-version }}
run: python3 ./scripts/test_pcsp.py


Expand Down
13 changes: 12 additions & 1 deletion scripts/test_pcsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def clear_files():
run_cmd("rm -vrf ./internal/native/sse/traceback_test.go")
run_cmd("rm -vrf ./internal/native/avx2/traceback_test.go")

def check_ge_go_1_23() -> bool:
ver = os.getenv("GOVERSION")
if ver is None:
print("Cannot get go version")
exit(1)
major, minor, _ = ver.split('.')
return int(major) > 1 or int(minor) >= 23

def main():
TRACE_TEST_FILE = "./internal/native/traceback_test.mock_tmpl"
pattern = "*_text_amd64.go"
Expand All @@ -74,9 +82,12 @@ def main():
run_cmd("sed -e 's/{{PACKAGE}}/sse/g' %s > ./internal/native/sse/traceback_test.go" %TRACE_TEST_FILE)
run_cmd("sed -e 's/{{PACKAGE}}/avx2/g' %s > ./internal/native/avx2/traceback_test.go" %TRACE_TEST_FILE)

# check whether we need an extra ldflags
ext_flag = ' -ldflags=-checklinkname=0 ' if check_ge_go_1_23() else ' '

# test the pcsp with Golang
run_cmd("go version")
run_cmd("go test -v -run=TestTraceback ./... > test.log")
run_cmd(f"go test -v{ext_flag}-run=TestTraceback ./... > test.log")
run_cmd("grep -q \"runtime: \" test.log && exit 1 || exit 0")

clear_files()
Expand Down
Loading