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

Remove SLES 11 check #981

Merged
merged 2 commits into from
Nov 13, 2020
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
11 changes: 0 additions & 11 deletions lib/omnibus/software.rb
Original file line number Diff line number Diff line change
Expand Up @@ -720,17 +720,6 @@ def with_standard_compiler_flags(env = {}, opts = {})
"LDFLAGS" => "-L#{install_dir}/embedded/lib",
"CFLAGS" => "-I#{install_dir}/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
}
when "suse"
suse_flags = {
"LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib",
"CFLAGS" => "-I#{install_dir}/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
}
# Enable gcc version 4.8 if it is available
if which("gcc-4.8") && platform_version.satisfies?("< 12")
suse_flags["CC"] = "gcc-4.8"
suse_flags["CXX"] = "g++-4.8"
end
suse_flags
when "windows"
arch_flag = windows_arch_i386? ? "-m32" : "-m64"
opt_flag = windows_arch_i386? ? "-march=i686" : "-march=x86-64"
Expand Down
92 changes: 3 additions & 89 deletions spec/unit/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ module Omnibus
end
end

context "on freebsd 10" do
context "on freebsd" do
before do
stub_ohai(platform: "freebsd", version: "10.4")
stub_ohai(platform: "freebsd", version: "12.1")
end

it "sets the defaults" do
Expand All @@ -245,95 +245,9 @@ module Omnibus
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end

context "with gcc 4.9 installed" do
before do
allow(subject).to receive(:which).and_return("/usr/local/bin/gcc49")
end
end
end

context "on freebsd 10" do
before do
stub_ohai(platform: "freebsd", version: "10.4")
end

it "Clang as the default compiler" do
expect(subject.with_standard_compiler_flags).to eq(
"CC" => "clang",
"CXX" => "clang++",
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LDFLAGS" => "-L/opt/project/embedded/lib",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
end

context "on sles 11" do
before do
# sles identifies as suse
stub_ohai(platform: "suse", version: "11.4")
allow(subject).to receive(:which).with("gcc-4.8").and_return(false)
end
it "sets the defaults" do
expect(subject.with_standard_compiler_flags).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end

context "with gcc 4.8 installed" do

before do
allow(subject).to receive(:which).and_return("/usr/bin/gcc-4.8")
end

it "sets the compiler args" do
expect(subject.with_standard_compiler_flags).to eq(
"CC" => "gcc-4.8",
"CXX" => "g++-4.8",
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
end
end

context "on sles 12" do
before do
# sles identifies as suse
stub_ohai(platform: "suse", version: "12.2")
allow(subject).to receive(:which).with("gcc-4.8").and_return(true)
end

it "sets the defaults" do
expect(subject.with_standard_compiler_flags).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
end

context "on Windows" do
context "on windows" do
let(:win_arch_i386) { true }

before do
Expand Down