From 5293dd347b5d3d9cc07bbd82677806c509888c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Wed, 4 Sep 2024 17:24:24 +0200 Subject: [PATCH 1/5] Try to make `etc/ci_test.sh` work --- .gitignore | 1 + etc/ci_test.sh | 5 +++-- pkg/JuliaInterface/Makefile.in | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3b562e441..2c02947fb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ Manifest.toml /tags *.log /coverage/ +*.gcov /override/ diff --git a/etc/ci_test.sh b/etc/ci_test.sh index 30ad91eed..603e624ec 100755 --- a/etc/ci_test.sh +++ b/etc/ci_test.sh @@ -9,9 +9,10 @@ mkdir -p coverage # cd pkg/JuliaInterface pwd +FORCE_JULIAINTERFACE_COMPILATION=true ${GAP} --nointeract # re-compile JuliaInterface ${GAP} makedoc.g ${GAP} --cover ../../coverage/JuliaInterface.coverage tst/testall.g || AnyFailures=Yes -gcov -o gen/src/.libs src/*.c* +gcov -o gen/src/ src/*.c* cd ../.. # @@ -19,7 +20,7 @@ cd pkg/JuliaExperimental pwd ${GAP} makedoc.g ${GAP} --cover ../../coverage/JuliaExperimental.coverage tst/testall.g || AnyFailures=Yes -gcov -o gen/src/.libs src/*.c* +#gcov -o gen/src/ src/*.c* # there is no src/ folder anymore cd ../.. if [ ${AnyFailures} = Yes ] diff --git a/pkg/JuliaInterface/Makefile.in b/pkg/JuliaInterface/Makefile.in index 3bac32bdb..f75fafb5c 100644 --- a/pkg/JuliaInterface/Makefile.in +++ b/pkg/JuliaInterface/Makefile.in @@ -3,6 +3,7 @@ # KEXT_NAME = JuliaInterface KEXT_SOURCES = src/JuliaInterface.c src/calls.c src/convert.c src/sync.c +KEXT_CFLAGS = -ftest-coverage # include shared GAP package build system GAPPATH = @GAPPATH@ From 9fa33110b00b2bffb25cb59e6ee95c8cccf37b62 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 5 Sep 2024 15:20:02 +0200 Subject: [PATCH 2/5] Apply suggestions from code review --- etc/ci_test.sh | 4 ++-- pkg/JuliaInterface/Makefile.in | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/etc/ci_test.sh b/etc/ci_test.sh index 603e624ec..c52ecaf8a 100755 --- a/etc/ci_test.sh +++ b/etc/ci_test.sh @@ -9,7 +9,8 @@ mkdir -p coverage # cd pkg/JuliaInterface pwd -FORCE_JULIAINTERFACE_COMPILATION=true ${GAP} --nointeract # re-compile JuliaInterface +# Force recompilation of JuliaInterface with coverage instrumentation +CFLAGS=--coverage FORCE_JULIAINTERFACE_COMPILATION=true ${GAP} --nointeract ${GAP} makedoc.g ${GAP} --cover ../../coverage/JuliaInterface.coverage tst/testall.g || AnyFailures=Yes gcov -o gen/src/ src/*.c* @@ -20,7 +21,6 @@ cd pkg/JuliaExperimental pwd ${GAP} makedoc.g ${GAP} --cover ../../coverage/JuliaExperimental.coverage tst/testall.g || AnyFailures=Yes -#gcov -o gen/src/ src/*.c* # there is no src/ folder anymore cd ../.. if [ ${AnyFailures} = Yes ] diff --git a/pkg/JuliaInterface/Makefile.in b/pkg/JuliaInterface/Makefile.in index f75fafb5c..3bac32bdb 100644 --- a/pkg/JuliaInterface/Makefile.in +++ b/pkg/JuliaInterface/Makefile.in @@ -3,7 +3,6 @@ # KEXT_NAME = JuliaInterface KEXT_SOURCES = src/JuliaInterface.c src/calls.c src/convert.c src/sync.c -KEXT_CFLAGS = -ftest-coverage # include shared GAP package build system GAPPATH = @GAPPATH@ From 103e24469745388d017e5e4f6742eadc229db629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 5 Sep 2024 16:30:28 +0200 Subject: [PATCH 3/5] Fixes --- etc/ci_test.sh | 4 +++- src/setup.jl | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/etc/ci_test.sh b/etc/ci_test.sh index c52ecaf8a..0bf5edc9d 100755 --- a/etc/ci_test.sh +++ b/etc/ci_test.sh @@ -10,10 +10,12 @@ mkdir -p coverage cd pkg/JuliaInterface pwd # Force recompilation of JuliaInterface with coverage instrumentation -CFLAGS=--coverage FORCE_JULIAINTERFACE_COMPILATION=true ${GAP} --nointeract +FORCE_JULIAINTERFACE_COMPILATION=true JULIAINTERFACE_WITH_COVERAGE=true ${GAP} --nointeract ${GAP} makedoc.g ${GAP} --cover ../../coverage/JuliaInterface.coverage tst/testall.g || AnyFailures=Yes gcov -o gen/src/ src/*.c* +# Force recompilation of JuliaInterface without coverage instrumentation +FORCE_JULIAINTERFACE_COMPILATION=true ${GAP} --nointeract cd ../.. # diff --git a/src/setup.jl b/src/setup.jl index 38010bd89..0c6fc2b4d 100644 --- a/src/setup.jl +++ b/src/setup.jl @@ -212,13 +212,17 @@ function build_JuliaInterface(sysinfo::Dict{String, String}) # paths involve spaces, but then we likely will haves problem in other # places; in any case, if anybody ever cares about this, we can work on # finding a better solution. - JULIA_CPPFLAGS = filter(c -> c != '\'', cflags()) + JULIA_CFLAGS = filter(c -> c != '\'', cflags()) JULIA_LDFLAGS = filter(c -> c != '\'', ldflags()) JULIA_LIBS = filter(c -> c != '\'', ldlibs()) + if get(ENV, "JULIAINTERFACE_WITH_COVERAGE", "false") == "true" + JULIA_CFLAGS *= " --coverage" + JULIA_LDFLAGS *= " --coverage" + end jipath = joinpath(@__DIR__, "..", "pkg", "JuliaInterface") cd(jipath) do - withenv("CFLAGS" => JULIA_CPPFLAGS, + withenv("CFLAGS" => JULIA_CFLAGS, "LDFLAGS" => JULIA_LDFLAGS * " " * JULIA_LIBS) do run(pipeline(`./configure $(gaproot())`, stdout="build.log")) run(pipeline(`make V=1 -j$(Sys.CPU_THREADS)`, stdout="build.log", append=true)) From 6dbc97648b11eff641c0943049c0789341137ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Fri, 6 Sep 2024 12:05:44 +0200 Subject: [PATCH 4/5] Update env var handling --- etc/ci_test.sh | 2 +- src/julia-config.jl | 8 ++++++++ src/setup.jl | 4 ---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/etc/ci_test.sh b/etc/ci_test.sh index 0bf5edc9d..06fe76d3e 100755 --- a/etc/ci_test.sh +++ b/etc/ci_test.sh @@ -10,7 +10,7 @@ mkdir -p coverage cd pkg/JuliaInterface pwd # Force recompilation of JuliaInterface with coverage instrumentation -FORCE_JULIAINTERFACE_COMPILATION=true JULIAINTERFACE_WITH_COVERAGE=true ${GAP} --nointeract +CFLAGS="--coverage" LDFLAGS="--coverage" FORCE_JULIAINTERFACE_COMPILATION=true ${GAP} --nointeract ${GAP} makedoc.g ${GAP} --cover ../../coverage/JuliaInterface.coverage tst/testall.g || AnyFailures=Yes gcov -o gen/src/ src/*.c* diff --git a/src/julia-config.jl b/src/julia-config.jl index 82a7890fe..ce44e1a17 100755 --- a/src/julia-config.jl +++ b/src/julia-config.jl @@ -37,6 +37,10 @@ function ldflags() elseif !Sys.isapple() fl = fl * " -Wl,--export-dynamic" end + env_var = get(ENV, "LDFLAGS", nothing) + if !isnothing(env_var) + fl = fl * " " * env_var + end return fl end @@ -63,5 +67,9 @@ function cflags() if Sys.isunix() print(flags, " -fPIC") end + env_var = get(ENV, "CFLAGS", nothing) + if !isnothing(env_var) + print(flags, " ", env_var) + end return String(take!(flags)) end diff --git a/src/setup.jl b/src/setup.jl index 0c6fc2b4d..a6a4b2443 100644 --- a/src/setup.jl +++ b/src/setup.jl @@ -215,10 +215,6 @@ function build_JuliaInterface(sysinfo::Dict{String, String}) JULIA_CFLAGS = filter(c -> c != '\'', cflags()) JULIA_LDFLAGS = filter(c -> c != '\'', ldflags()) JULIA_LIBS = filter(c -> c != '\'', ldlibs()) - if get(ENV, "JULIAINTERFACE_WITH_COVERAGE", "false") == "true" - JULIA_CFLAGS *= " --coverage" - JULIA_LDFLAGS *= " --coverage" - end jipath = joinpath(@__DIR__, "..", "pkg", "JuliaInterface") cd(jipath) do From d90e754e2207a55ad37a99555dba558c39d2bb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Fri, 6 Sep 2024 12:06:36 +0200 Subject: [PATCH 5/5] Use make for cleanup --- etc/ci_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/ci_test.sh b/etc/ci_test.sh index 06fe76d3e..895630e4e 100755 --- a/etc/ci_test.sh +++ b/etc/ci_test.sh @@ -14,8 +14,8 @@ CFLAGS="--coverage" LDFLAGS="--coverage" FORCE_JULIAINTERFACE_COMPILATION=true $ ${GAP} makedoc.g ${GAP} --cover ../../coverage/JuliaInterface.coverage tst/testall.g || AnyFailures=Yes gcov -o gen/src/ src/*.c* -# Force recompilation of JuliaInterface without coverage instrumentation -FORCE_JULIAINTERFACE_COMPILATION=true ${GAP} --nointeract +# Remove JuliaInterface with coverage instrumentation +make clean cd ../.. #