Skip to content

Commit 7bbd7ae

Browse files
authored
Silence unused-command-line-argument warning, not just the error (#1506)
* Silence unused-command-line-argument warning, not just the error The warning is absolutely spammy. We also disable the warning in BinaryBuilder, it's so annoying: https://github.com/JuliaPackaging/BinaryBuilderBase.jl/blob/99594c5cae8f67b9cdc776418744d88e574d4e05/src/Runner.jl#L449. * Revert "Try no cc" This reverts commit 6077bac. * Partially revert "mark cc as optional" This partially reverts commit ec0c61f. Keep `cc` mandatory, only make `gcc_host_compiler_path` optional.
1 parent da9c8a3 commit 7bbd7ae

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

deps/build_local.jl

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,19 @@ hermetic_python_version = parsed_args["hermetic_python_version"]
111111

112112
# Try to guess if `cc` is GCC and get its version number.
113113
cc_is_gcc, gcc_version = let
114-
if isempty(cc)
115-
false, v"0"
114+
io = IOBuffer()
115+
run(pipeline(ignorestatus(`$(cc) --version`); stdout=io))
116+
version_string = String(take!(io))
117+
# Detecing GCC is hard, the name "gcc" may not appear anywhere in the
118+
# version string, but on the second line there should be FSF.
119+
m = match(
120+
r"\([^)]+\) (\d+\.\d+\.\d+).*\n.*Free Software Foundation, Inc\.",
121+
version_string,
122+
)
123+
if !isnothing(m)
124+
true, VersionNumber(m[1])
116125
else
117-
io = IOBuffer()
118-
run(pipeline(ignorestatus(`$(cc) --version`); stdout=io))
119-
version_string = String(take!(io))
120-
# Detecing GCC is hard, the name "gcc" may not appear anywhere in the
121-
# version string, but on the second line there should be FSF.
122-
m = match(
123-
r"\([^)]+\) (\d+\.\d+\.\d+).*\n.*Free Software Foundation, Inc\.",
124-
version_string,
125-
)
126-
if !isnothing(m)
127-
true, VersionNumber(m[1])
128-
else
129-
false, v"0"
130-
end
126+
false, v"0"
131127
end
132128
end
133129

@@ -139,9 +135,7 @@ push!(build_cmd_list, "--repo_env=HERMETIC_PYTHON_VERSION=$(hermetic_python_vers
139135
if !isempty(gcc_host_compiler_path)
140136
push!(build_cmd_list, "--repo_env=GCC_HOST_COMPILER_PATH=$(gcc_host_compiler_path)")
141137
end
142-
if !isempty(cc)
143-
push!(build_cmd_list, "--repo_env=CC=$(cc)")
144-
end
138+
push!(build_cmd_list, "--repo_env=CC=$(cc)")
145139
push!(build_cmd_list, "--check_visibility=false")
146140
push!(build_cmd_list, "--verbose_failures")
147141
push!(build_cmd_list, "--jobs=$(parsed_args["jobs"])")
@@ -176,7 +170,7 @@ else
176170
# Assume the compiler is clang if not GCC. `using_clang` is an option
177171
# introduced by Enzyme-JAX.
178172
push!(build_cmd_list, "--define=using_clang=true")
179-
push!(build_cmd_list, "--copt=-Wno-error=unused-command-line-argument")
173+
push!(build_cmd_list, "--copt=-Wno-unused-command-line-argument")
180174
end
181175
push!(build_cmd_list, "--color=$(parsed_args["color"])")
182176
push!(build_cmd_list, ":libReactantExtra.so")

0 commit comments

Comments
 (0)