omnibus 8.0.9 → 8.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,8 +47,8 @@ module Omnibus
47
47
  end
48
48
 
49
49
  describe "#package_name" do
50
- it "includes the name, version, and build iteration" do
51
- expect(subject.package_name).to eq("project-full-name-1.2.3-2.pkg")
50
+ it "includes the name, version, build iteration, and architecture" do
51
+ expect(subject.package_name).to eq("project-full-name-1.2.3-2.x86_64.pkg")
52
52
  end
53
53
  end
54
54
 
@@ -290,8 +290,24 @@ module Omnibus
290
290
 
291
291
  expect(contents).to include('<pkg-ref id="com.getchef.project-full-name"/>')
292
292
  expect(contents).to include('<line choice="com.getchef.project-full-name"/>')
293
+ expect(contents).to include('hostArchitectures="x86_64"')
293
294
  expect(contents).to include("project-full-name-core.pkg")
294
295
  end
296
+
297
+ context "for arm64 builds" do
298
+ before do
299
+ stub_ohai(platform: "mac_os_x", version: "11.0") do |data|
300
+ data["kernel"]["machine"] = "arm64"
301
+ end
302
+ end
303
+
304
+ it "sets the hostArchitectures to include arm64" do
305
+ subject.write_distribution_file
306
+ contents = File.read("#{staging_dir}/Distribution")
307
+
308
+ expect(contents).to include('hostArchitectures="arm64"')
309
+ end
310
+ end
295
311
  end
296
312
 
297
313
  describe "#build_product_pkg" do
@@ -301,7 +317,7 @@ module Omnibus
301
317
  productbuild \\
302
318
  --distribution "#{staging_dir}/Distribution" \\
303
319
  --resources "#{staging_dir}/Resources" \\
304
- "#{package_dir}/project-full-name-1.2.3-2.pkg"
320
+ "#{package_dir}/project-full-name-1.2.3-2.x86_64.pkg"
305
321
  EOH
306
322
 
307
323
  subject.build_product_pkg
@@ -319,7 +335,7 @@ module Omnibus
319
335
  --distribution "#{staging_dir}/Distribution" \\
320
336
  --resources "#{staging_dir}/Resources" \\
321
337
  --sign "My Special Identity" \\
322
- "#{package_dir}/project-full-name-1.2.3-2.pkg"
338
+ "#{package_dir}/project-full-name-1.2.3-2.x86_64.pkg"
323
339
  EOH
324
340
  subject.build_product_pkg
325
341
  end
@@ -541,7 +557,9 @@ module Omnibus
541
557
 
542
558
  context "when is a Mach-O library" do
543
559
  before do
544
- allow(subject).to receive(:is_binary?).with("file").and_return(true)
560
+ allow(File).to receive(:file?).with("file").and_return(true)
561
+ allow(File).to receive(:executable?).with("file").and_return(true)
562
+ allow(File).to receive(:symlink?).with("file").and_return(false)
545
563
  expect(subject).to receive(:shellout!).with("file file").and_return(shellout)
546
564
  allow(shellout).to receive(:stdout)
547
565
  .and_return("file: Mach-O 64-bit dynamically linked shared library x86_64")
@@ -554,7 +572,9 @@ module Omnibus
554
572
 
555
573
  context "when is a Mach-O Bundle" do
556
574
  before do
557
- allow(subject).to receive(:is_binary?).with("file").and_return(true)
575
+ allow(File).to receive(:file?).with("file").and_return(true)
576
+ allow(File).to receive(:executable?).with("file").and_return(true)
577
+ allow(File).to receive(:symlink?).with("file").and_return(false)
558
578
  expect(subject).to receive(:shellout!).with("file file").and_return(shellout)
559
579
  allow(shellout).to receive(:stdout)
560
580
  .and_return("file: Mach-O 64-bit bundle x86_64")
@@ -567,7 +587,9 @@ module Omnibus
567
587
 
568
588
  context "when is not a Mach-O Bundle or Mach-O library" do
569
589
  before do
570
- allow(subject).to receive(:is_binary?).with("file").and_return(true)
590
+ allow(File).to receive(:file?).with("file").and_return(true)
591
+ allow(File).to receive(:executable?).with("file").and_return(true)
592
+ allow(File).to receive(:symlink?).with("file").and_return(false)
571
593
  expect(subject).to receive(:shellout!).with("file file").and_return(shellout)
572
594
  allow(shellout).to receive(:stdout)
573
595
  .and_return("file: ASCII text")
@@ -404,6 +404,16 @@ module Omnibus
404
404
  end
405
405
  end
406
406
 
407
+ describe "#rpm_file" do
408
+ before do
409
+ allow(subject).to receive(:package_name).and_return("package_name.rpm")
410
+ end
411
+
412
+ it "includes the package_name rpm" do
413
+ expect(subject.rpm_file).to eq("#{staging_dir}/RPMS/#{architecture}/package_name.rpm")
414
+ end
415
+ end
416
+
407
417
  describe "#rpm_safe" do
408
418
  it "adds quotes when required" do
409
419
  expect(subject.rpm_safe("file path")).to eq('"file path"')
@@ -235,8 +235,8 @@ module Omnibus
235
235
  end
236
236
  end
237
237
 
238
- context "when on OS X" do
239
- let(:fauxhai_options) { { platform: "mac_os_x", version: "10.15" } }
238
+ context "when on macOS" do
239
+ let(:fauxhai_options) { { platform: "mac_os_x" } }
240
240
  it "returns a generic iteration" do
241
241
  expect(subject.build_iteration).to eq(1)
242
242
  end
@@ -73,9 +73,9 @@ module Omnibus
73
73
  it "sets the defaults" do
74
74
  expect(subject.with_standard_compiler_flags).to eq(
75
75
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
76
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
77
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
78
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
76
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
77
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
78
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
79
79
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
80
80
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
81
81
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -84,9 +84,9 @@ module Omnibus
84
84
  it "overrides LDFLAGS" do
85
85
  expect(subject.with_standard_compiler_flags("LDFLAGS" => "foo")).to eq(
86
86
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
87
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
88
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
89
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
87
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
88
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
89
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
90
90
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
91
91
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
92
92
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -95,9 +95,9 @@ module Omnibus
95
95
  it "overrides CFLAGS" do
96
96
  expect(subject.with_standard_compiler_flags("CFLAGS" => "foo")).to eq(
97
97
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
98
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
99
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
100
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
98
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
99
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
100
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
101
101
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
102
102
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
103
103
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -106,9 +106,9 @@ module Omnibus
106
106
  it "overrides CXXFLAGS" do
107
107
  expect(subject.with_standard_compiler_flags("CXXFLAGS" => "foo")).to eq(
108
108
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
109
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
110
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
111
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
109
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
110
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
111
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
112
112
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
113
113
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
114
114
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -117,9 +117,9 @@ module Omnibus
117
117
  it "overrides CPPFLAGS" do
118
118
  expect(subject.with_standard_compiler_flags("CPPFLAGS" => "foo")).to eq(
119
119
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
120
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
121
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
122
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
120
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
121
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
122
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
123
123
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
124
124
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
125
125
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -129,9 +129,9 @@ module Omnibus
129
129
  expect(subject.with_standard_compiler_flags("numberwang" => 4)).to eq(
130
130
  "numberwang" => 4,
131
131
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
132
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
133
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
134
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
132
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
133
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
134
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
135
135
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
136
136
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
137
137
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -191,14 +191,14 @@ module Omnibus
191
191
  end
192
192
 
193
193
  context "on mac_os_x" do
194
- before { stub_ohai(platform: "mac_os_x", version: "10.13") }
194
+ before { stub_ohai(platform: "mac_os_x", version: "10.15") }
195
195
 
196
196
  it "sets the defaults" do
197
197
  expect(subject.with_standard_compiler_flags).to eq(
198
198
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
199
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
200
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
201
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
199
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
200
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
201
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
202
202
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
203
203
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
204
204
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -235,9 +235,9 @@ module Omnibus
235
235
  it "sets the defaults" do
236
236
  expect(subject.with_standard_compiler_flags).to eq(
237
237
  "CC" => "clang",
238
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
239
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
240
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
238
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
239
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
240
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
241
241
  "CXX" => "clang++",
242
242
  "LDFLAGS" => "-L/opt/project/embedded/lib",
243
243
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.9
4
+ version: 8.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-25 00:00:00.000000000 Z
11
+ date: 2022-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -93,6 +93,9 @@ dependencies:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '15'
96
+ - - "<"
97
+ - !ruby/object:Gem::Version
98
+ version: '18'
96
99
  type: :runtime
97
100
  prerelease: false
98
101
  version_requirements: !ruby/object:Gem::Requirement
@@ -100,6 +103,9 @@ dependencies:
100
103
  - - ">="
101
104
  - !ruby/object:Gem::Version
102
105
  version: '15'
106
+ - - "<"
107
+ - !ruby/object:Gem::Version
108
+ version: '18'
103
109
  - !ruby/object:Gem::Dependency
104
110
  name: ruby-progressbar
105
111
  requirement: !ruby/object:Gem::Requirement
@@ -148,6 +154,26 @@ dependencies:
148
154
  - - "~>"
149
155
  - !ruby/object:Gem::Version
150
156
  version: '1.0'
157
+ - !ruby/object:Gem::Dependency
158
+ name: contracts
159
+ requirement: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - ">="
162
+ - !ruby/object:Gem::Version
163
+ version: 0.16.0
164
+ - - "<"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.17.0
167
+ type: :runtime
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: 0.16.0
174
+ - - "<"
175
+ - !ruby/object:Gem::Version
176
+ version: 0.17.0
151
177
  - !ruby/object:Gem::Dependency
152
178
  name: mixlib-versioning
153
179
  requirement: !ruby/object:Gem::Requirement
@@ -196,28 +222,28 @@ dependencies:
196
222
  requirements:
197
223
  - - "~>"
198
224
  - !ruby/object:Gem::Version
199
- version: '0.5'
225
+ version: '2.0'
200
226
  type: :development
201
227
  prerelease: false
202
228
  version_requirements: !ruby/object:Gem::Requirement
203
229
  requirements:
204
230
  - - "~>"
205
231
  - !ruby/object:Gem::Version
206
- version: '0.5'
232
+ version: '2.0'
207
233
  - !ruby/object:Gem::Dependency
208
234
  name: chefstyle
209
235
  requirement: !ruby/object:Gem::Requirement
210
236
  requirements:
211
237
  - - '='
212
238
  - !ruby/object:Gem::Version
213
- version: 1.5.2
239
+ version: 1.7.5
214
240
  type: :development
215
241
  prerelease: false
216
242
  version_requirements: !ruby/object:Gem::Requirement
217
243
  requirements:
218
244
  - - '='
219
245
  - !ruby/object:Gem::Version
220
- version: 1.5.2
246
+ version: 1.7.5
221
247
  - !ruby/object:Gem::Dependency
222
248
  name: fauxhai-ng
223
249
  requirement: !ruby/object:Gem::Requirement
@@ -553,7 +579,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
553
579
  - !ruby/object:Gem::Version
554
580
  version: '0'
555
581
  requirements: []
556
- rubygems_version: 3.0.3
582
+ rubygems_version: 3.1.4
557
583
  signing_key:
558
584
  specification_version: 4
559
585
  summary: Omnibus is a framework for building self-installing, full-stack software