Skip to content

Commit db16c4e

Browse files
committed
debugging macos CI
1 parent 00013ae commit db16c4e

File tree

4 files changed

+33
-23
lines changed

4 files changed

+33
-23
lines changed

.github/workflows/test-linux.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
defaults:
99
run:
10-
shell: bash
10+
shell: bash -l {0}
1111

1212
jobs:
1313
test:
@@ -18,6 +18,7 @@ jobs:
1818
matrix:
1919
version:
2020
- '1.10'
21+
- '1'
2122
os:
2223
- ubuntu-latest
2324
# - macOS-latest
@@ -31,5 +32,8 @@ jobs:
3132
with:
3233
version: ${{ matrix.version }}
3334
arch: ${{ matrix.arch }}
34-
- uses: julia-actions/julia-buildpkg@latest
35-
- uses: julia-actions/julia-runtest@latest
35+
#- uses: julia-actions/julia-buildpkg@latest
36+
- name: Run package tests
37+
uses: julia-actions/julia-runtest@latest
38+
with:
39+
annotate: true

.github/workflows/test-macos.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
version:
20-
- '1.10'
20+
# - '1.10'
21+
- '1'
2122
os:
2223
# - ubuntu-latest
2324
- macOS-latest
@@ -36,23 +37,17 @@ jobs:
3637
CONDA_BINDIR="`sh .github/workflows/install_root_with_conda.sh | tail -n 1`"
3738
source "$CONDA_BINDIR/activate"
3839
cat >> "$GITHUB_ENV" <<EOF
39-
#LDFLAGS="$LDFLAGS"
40-
#CPPFLAGS="$CPPFLAGS"
41-
#LIBTOOL="$LIBTOOL"
42-
#CXXFLAGS="$CXXFLAGS"
43-
#CPP="$CPP"
4440
PATH="$PATH"
45-
#LD="$LD"
4641
CXX="$CXX"
47-
#CFLAGS="$CFLAGS"
48-
#CC="$CC"
4942
EOF
5043
echo -n "ROOT binary: " 1>&2
5144
which root 1>&2
5245
- name: Build the Julia wrapper library
5346
run: |
5447
cd ..
55-
julia --project=@. -e 'import Pkg; Pkg.add("ROOTprefs"); using ROOTprefs; ROOTprefs._set_preference("no_auto_compile", true); Pkg.add(path="./ROOT.jl"); import ROOT; ROOT.cxxcompile();' 1>&2
48+
#for some reason in auto-compile mode, the compilation logs are not displayed when run in the CI. Use explicit compile call.
49+
julia --project=@. -e 'import Pkg; Pkg.add("ROOTprefs"); using ROOTprefs; ROOTprefs._set_preference("no_auto_compile", true); import ROOT; ROOT.cxxcompile();' 1>&2
50+
#trigger package precompilation
5651
julia --project=@. -e 'import ROOT' 1>&2
5752
#- uses: julia-actions/julia-buildpkg@latest
5853
- name: Setup upterm session
@@ -64,5 +59,7 @@ jobs:
6459
limit-access-to-users: grasph
6560
# If no one connects after 2 minutes, shut down server.
6661
wait-timeout-minutes: 2
67-
- uses: julia-actions/julia-runtest@latest
68-
62+
- name: Run package tests
63+
uses: julia-actions/julia-runtest@latest
64+
with:
65+
annotate: true

src/CxxBuild.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ end
3535
# Build the libroot_julia library for the ROOT libraries installed under rootsys directory.
3636
# Return the full path to libroot_julia or an empty string in case of failure.
3737
#
38-
function build_root_wrapper(rootsys = ROOTprefs.get_ROOTSYS())
38+
function build_root_wrapper(rootsys=ROOTprefs.get_ROOTSYS(); nobuild=false)
3939

4040
rootconfig = joinpath(rootsys, "bin", "root-config")
4141
used_root_version = readchomp(`$rootconfig --version`)
@@ -81,7 +81,7 @@ function build_root_wrapper(rootsys = ROOTprefs.get_ROOTSYS())
8181
end
8282
end
8383

84-
build = true
84+
libready = false
8585

8686
#Check if library is already built and up-to-date. Returns if it's the case.
8787
sigfile = joinpath(scratch, "sig")
@@ -91,12 +91,22 @@ function build_root_wrapper(rootsys = ROOTprefs.get_ROOTSYS())
9191
oldsig = readline(sigfile)
9292
if newsig == oldsig
9393
@info "Library $libpath is already up-to-date."
94-
build = false
94+
libready = true
9595
end
9696
t1 = time()
9797
@info "Time spent to check for modifications in the ROOT-julia library source code that would require a compilation: $(round(t1-t0, digits=2)) s"
9898
end
9999

100+
build = if libready
101+
false
102+
elseif nobuild
103+
libpath = ""
104+
@info "Build skipped as required by the no_auto_compile preference setting."
105+
false
106+
else
107+
true
108+
end
109+
100110
if build
101111
@info "Build command: " * string(cmd)[2:end-1] * " executed in " * pwd() * " directory."
102112

@@ -249,7 +259,7 @@ function check_rootsys()
249259
end
250260

251261

252-
function get_or_build_libroot_julia()
262+
function get_or_build_libroot_julia(;nobuild=false)
253263

254264
if get_use_root_jll() && is_jll_supported()
255265
#prebuilt wrapper used, no build to perform
@@ -286,7 +296,7 @@ function get_or_build_libroot_julia()
286296
end
287297
end
288298

289-
libpath = build_root_wrapper(rootsys)
299+
libpath = build_root_wrapper(rootsys, nobuild=nobuild)
290300

291301
if !isempty(libpath) && rootsys != pref_rootsys
292302
#If build succeeded and ROOTSYS was modified, update LocalPreference.toml

src/ROOT.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ const libroot_julia_from_jll = root_jll_preferred && Internals.CxxBuild.is_jll_s
4646
4747
Path of the shared library containing the C++ code interfacing the Julia ROOT package with the C++ ROOT libraries. This library is provided by the package ROOT_julia_jll included in the dependency, when the C++ ROOT libraries are installed by the Julia package manager from the ROOT_jll package, or built on the fly (at first ROOT module import), if they are installed by another mean.
4848
"""
49-
const libroot_julia_path = ((!libroot_julia_from_jll && Preferences.load_preference("ROOT", "no_auto_compile", false)) ?
50-
"" : Internals.CxxBuild.get_or_build_libroot_julia())
49+
const libroot_julia_path = Internals.CxxBuild.get_or_build_libroot_julia(nobuild=Preferences.load_preference("ROOT", "no_auto_compile", false))
5150

5251
const _libroot_compilation_failed = if isempty(libroot_julia_path) #precompilation failed
5352
# trick to invalidate the precompilation cache
@@ -105,7 +104,7 @@ end
105104
function __init__()
106105
if !ok()
107106
ROOTprefs._set_preference("internal_compilation_failed", nothing)
108-
@warn "The imported ROOT module is empty because the backend library is not compiled. User ROOT.cxxcompile() to compile it. After compilation restart of Julia is required after the compilation."
107+
@warn "The imported ROOT module is empty because its c++ part is not compiled. Use ROOT.cxxcompile() to compile it. After compilation, restart of Julia is required after the compilation."
109108
else
110109
libroot_julia_from_jll && Internals.loadlibdeps()
111110
@initcxx

0 commit comments

Comments
 (0)