omnibus 6.1.4 → 7.0.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -4
  3. data/README.md +54 -12
  4. data/Rakefile +1 -1
  5. data/bin/omnibus +1 -1
  6. data/lib/omnibus.rb +2 -2
  7. data/lib/omnibus/build_version.rb +1 -1
  8. data/lib/omnibus/build_version_dsl.rb +6 -7
  9. data/lib/omnibus/builder.rb +10 -9
  10. data/lib/omnibus/changelog_printer.rb +7 -4
  11. data/lib/omnibus/cleaner.rb +4 -1
  12. data/lib/omnibus/cli.rb +2 -2
  13. data/lib/omnibus/cli/changelog.rb +25 -25
  14. data/lib/omnibus/compressor.rb +2 -2
  15. data/lib/omnibus/compressors/base.rb +2 -2
  16. data/lib/omnibus/compressors/dmg.rb +3 -4
  17. data/lib/omnibus/compressors/tgz.rb +2 -2
  18. data/lib/omnibus/config.rb +13 -3
  19. data/lib/omnibus/core_extensions/open_uri.rb +1 -1
  20. data/lib/omnibus/digestable.rb +2 -2
  21. data/lib/omnibus/download_helpers.rb +6 -2
  22. data/lib/omnibus/fetchers/file_fetcher.rb +1 -1
  23. data/lib/omnibus/fetchers/git_fetcher.rb +1 -0
  24. data/lib/omnibus/fetchers/net_fetcher.rb +3 -4
  25. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  26. data/lib/omnibus/file_syncer.rb +1 -1
  27. data/lib/omnibus/generator.rb +2 -2
  28. data/lib/omnibus/generator_files/README.md.erb +20 -16
  29. data/lib/omnibus/generator_files/config/software/preparation.rb.erb +1 -1
  30. data/lib/omnibus/generator_files/omnibus.rb.erb +5 -4
  31. data/lib/omnibus/git_cache.rb +2 -2
  32. data/lib/omnibus/health_check.rb +3 -1
  33. data/lib/omnibus/licensing.rb +5 -6
  34. data/lib/omnibus/logger.rb +3 -2
  35. data/lib/omnibus/manifest.rb +2 -2
  36. data/lib/omnibus/metadata.rb +3 -3
  37. data/lib/omnibus/ohai.rb +1 -1
  38. data/lib/omnibus/package.rb +1 -1
  39. data/lib/omnibus/packager.rb +1 -0
  40. data/lib/omnibus/packagers/appx.rb +1 -2
  41. data/lib/omnibus/packagers/base.rb +2 -1
  42. data/lib/omnibus/packagers/bff.rb +6 -8
  43. data/lib/omnibus/packagers/deb.rb +7 -10
  44. data/lib/omnibus/packagers/ips.rb +3 -6
  45. data/lib/omnibus/packagers/makeself.rb +1 -2
  46. data/lib/omnibus/packagers/msi.rb +13 -12
  47. data/lib/omnibus/packagers/pkg.rb +125 -9
  48. data/lib/omnibus/packagers/rpm.rb +11 -12
  49. data/lib/omnibus/packagers/solaris.rb +5 -5
  50. data/lib/omnibus/packagers/windows_base.rb +7 -6
  51. data/lib/omnibus/project.rb +3 -2
  52. data/lib/omnibus/publisher.rb +2 -2
  53. data/lib/omnibus/publishers/artifactory_publisher.rb +2 -2
  54. data/lib/omnibus/publishers/s3_publisher.rb +6 -4
  55. data/lib/omnibus/s3_cache.rb +4 -2
  56. data/lib/omnibus/s3_helpers.rb +7 -7
  57. data/lib/omnibus/software.rb +68 -32
  58. data/lib/omnibus/templating.rb +2 -2
  59. data/lib/omnibus/thread_pool.rb +0 -2
  60. data/lib/omnibus/util.rb +4 -3
  61. data/lib/omnibus/version.rb +1 -1
  62. data/lib/omnibus/whitelist.rb +27 -1
  63. data/omnibus.gemspec +8 -9
  64. data/resources/ips/doc-transform.erb +1 -0
  65. data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
  66. data/resources/rpm/signing.erb +7 -10
  67. data/spec/functional/builder_spec.rb +2 -1
  68. data/spec/functional/fetchers/file_fetcher_spec.rb +4 -4
  69. data/spec/functional/fetchers/git_fetcher_spec.rb +4 -4
  70. data/spec/functional/fetchers/net_fetcher_spec.rb +5 -6
  71. data/spec/functional/fetchers/path_fetcher_spec.rb +4 -4
  72. data/spec/functional/licensing_spec.rb +5 -5
  73. data/spec/support/examples.rb +3 -4
  74. data/spec/support/path_helpers.rb +2 -2
  75. data/spec/unit/builder_spec.rb +9 -9
  76. data/spec/unit/changelogprinter_spec.rb +8 -6
  77. data/spec/unit/compressor_spec.rb +3 -3
  78. data/spec/unit/fetchers/net_fetcher_spec.rb +16 -17
  79. data/spec/unit/health_check_spec.rb +2 -6
  80. data/spec/unit/library_spec.rb +2 -1
  81. data/spec/unit/manifest_diff_spec.rb +2 -2
  82. data/spec/unit/manifest_spec.rb +1 -1
  83. data/spec/unit/metadata_spec.rb +9 -11
  84. data/spec/unit/omnibus_spec.rb +1 -1
  85. data/spec/unit/packagers/bff_spec.rb +2 -2
  86. data/spec/unit/packagers/ips_spec.rb +1 -0
  87. data/spec/unit/packagers/msi_spec.rb +2 -2
  88. data/spec/unit/packagers/pkg_spec.rb +354 -0
  89. data/spec/unit/packagers/pkgsrc_spec.rb +1 -1
  90. data/spec/unit/packagers/solaris_spec.rb +7 -7
  91. data/spec/unit/project_spec.rb +2 -2
  92. data/spec/unit/publisher_spec.rb +1 -2
  93. data/spec/unit/publishers/artifactory_publisher_spec.rb +2 -4
  94. data/spec/unit/publishers/s3_publisher_spec.rb +2 -4
  95. data/spec/unit/s3_cacher_spec.rb +19 -6
  96. data/spec/unit/s3_helpers_spec.rb +22 -3
  97. data/spec/unit/software_spec.rb +72 -42
  98. data/spec/unit/util_spec.rb +1 -2
  99. metadata +18 -18
@@ -70,7 +70,7 @@ module Omnibus
70
70
  expect(subject).to receive(:shellout!)
71
71
  .with "cd #{project.install_dir} && find . -type l -or -type f | sort >> #{staging_dir}/packlist"
72
72
  subject.write_packlist
73
- expect(File.read("#{staging_dir}/packlist")).to match(/@pkgdir \/opt\/project/)
73
+ expect(File.read("#{staging_dir}/packlist")).to match(%r{@pkgdir /opt/project})
74
74
  end
75
75
  end
76
76
  end
@@ -139,11 +139,11 @@ module Omnibus
139
139
 
140
140
  it "uses the correct commands" do
141
141
  expect(subject).to receive(:shellout!)
142
- .with("cd /opt && find project -print > #{File.join(staging_dir, 'files')}")
142
+ .with("cd /opt && find project -print > #{File.join(staging_dir, "files")}")
143
143
  expect(subject).to receive(:shellout!)
144
- .with("cd /opt && pkgproto < #{File.join(staging_dir, 'files.clean')} > #{File.join(staging_dir, 'Prototype.files')}")
144
+ .with("cd /opt && pkgproto < #{File.join(staging_dir, "files.clean")} > #{File.join(staging_dir, "Prototype.files")}")
145
145
  expect(subject).to receive(:shellout!)
146
- .with("awk '{ $5 = \"root\"; $6 = \"root\"; print }' < #{File.join(staging_dir, 'Prototype.files')} >> #{File.join(staging_dir, 'Prototype')}")
146
+ .with("awk '{ $5 = \"root\"; $6 = \"root\"; print }' < #{File.join(staging_dir, "Prototype.files")} >> #{File.join(staging_dir, "Prototype")}")
147
147
  subject.write_prototype_file
148
148
  end
149
149
 
@@ -158,11 +158,11 @@ module Omnibus
158
158
  describe "#create_solaris_file" do
159
159
  it "uses the correct commands" do
160
160
  expect(subject).to receive(:shellout!)
161
- .with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, 'Prototype')}")
161
+ .with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, "Prototype")}")
162
162
  expect(subject).to receive(:shellout!)
163
163
  .with("pkgchk -vd #{staging_dir} project")
164
164
  expect(subject).to receive(:shellout!)
165
- .with("pkgtrans #{staging_dir} #{File.join(package_dir, 'project-1.2.3-1.i386.solaris')} project")
165
+ .with("pkgtrans #{staging_dir} #{File.join(package_dir, "project-1.2.3-1.i386.solaris")} project")
166
166
 
167
167
  subject.create_solaris_file
168
168
  end
@@ -207,11 +207,11 @@ module Omnibus
207
207
 
208
208
  it "uses the correct commands" do
209
209
  expect(subject).to receive(:shellout!)
210
- .with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, 'Prototype')}")
210
+ .with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, "Prototype")}")
211
211
  expect(subject).to receive(:shellout!)
212
212
  .with("pkgchk -vd #{staging_dir} project")
213
213
  expect(subject).to receive(:shellout!)
214
- .with("pkgtrans #{staging_dir} #{File.join(package_dir, 'project-1.2.3-1.i386.solaris')} project")
214
+ .with("pkgtrans #{staging_dir} #{File.join(package_dir, "project-1.2.3-1.i386.solaris")} project")
215
215
 
216
216
  subject.create_solaris_file
217
217
  end
@@ -202,7 +202,7 @@ module Omnibus
202
202
  end
203
203
 
204
204
  describe "#build_iteration" do
205
- let(:fauxhai_options) { Hash.new }
205
+ let(:fauxhai_options) { {} }
206
206
 
207
207
  before { stub_ohai(fauxhai_options) }
208
208
 
@@ -340,7 +340,7 @@ module Omnibus
340
340
  subject.compress(:tgz)
341
341
 
342
342
  expect(Compressor).to receive(:for_current_system)
343
- .with([:dmg, :tgz])
343
+ .with(%i{dmg tgz})
344
344
  .and_call_original
345
345
 
346
346
  subject.compressor
@@ -133,8 +133,7 @@ module Omnibus
133
133
  license: "Apache-2.0",
134
134
  },
135
135
  },
136
- }
137
- )
136
+ })
138
137
  end
139
138
 
140
139
  before do
@@ -10,8 +10,7 @@ module Omnibus
10
10
  path: "/path/to/files/chef.deb",
11
11
  name: "chef.deb",
12
12
  content: "BINARY",
13
- validate!: true
14
- )
13
+ validate!: true)
15
14
  end
16
15
 
17
16
  let(:metadata) do
@@ -90,8 +89,7 @@ module Omnibus
90
89
  license: "Apache-2.0",
91
90
  },
92
91
  },
93
- }
94
- )
92
+ })
95
93
  end
96
94
 
97
95
  let(:packages) { [package] }
@@ -9,8 +9,7 @@ module Omnibus
9
9
  path: "/path/to/files/chef.deb",
10
10
  name: "chef.deb",
11
11
  content: "BINARY",
12
- validate!: true
13
- )
12
+ validate!: true)
14
13
  end
15
14
 
16
15
  let(:metadata) do
@@ -24,8 +23,7 @@ module Omnibus
24
23
  platform_version: "14.04",
25
24
  arch: "x86_64",
26
25
  sha1: "SHA1",
27
- md5: "ABCDEF123456"
28
- )
26
+ md5: "ABCDEF123456")
29
27
  end
30
28
 
31
29
  let(:packages) { [package] }
@@ -7,9 +7,7 @@ module Omnibus
7
7
  name: "ruby",
8
8
  version: "1.9.3",
9
9
  fetcher: double(Fetcher,
10
- checksum: "abcd1234"
11
- )
12
- )
10
+ checksum: "abcd1234"))
13
11
  end
14
12
 
15
13
  let(:python_27) do
@@ -17,9 +15,7 @@ module Omnibus
17
15
  name: "python",
18
16
  version: "2.7",
19
17
  fetcher: double(Fetcher,
20
- checksum: "defg5678"
21
- )
22
- )
18
+ checksum: "defg5678"))
23
19
  end
24
20
 
25
21
  describe ".list" do
@@ -113,10 +109,12 @@ module Omnibus
113
109
  let (:s3_access_key) { nil }
114
110
  let (:s3_secret_key) { nil }
115
111
  let (:s3_profile) { nil }
112
+ let (:s3_iam_role_arn) { nil }
116
113
 
117
114
  before do
118
115
  Config.s3_bucket s3_bucket
119
116
  Config.s3_region s3_region
117
+ Config.s3_iam_role_arn s3_iam_role_arn
120
118
  Config.s3_profile s3_profile
121
119
  Config.s3_access_key s3_access_key
122
120
  Config.s3_secret_key s3_secret_key
@@ -152,6 +150,21 @@ module Omnibus
152
150
  expect(config[:secret_access_key]).to eq(nil)
153
151
  end
154
152
  end
153
+
154
+ context "s3_iam_role_arn is configured" do
155
+ let(:s3_iam_role_arn) { "S3_IAM_ROLE_ARN" }
156
+ let(:s3_profile) { "SHAREDPROFILE" }
157
+ let(:s3_access_key) { "ACCESS_KEY_ID" }
158
+ let(:s3_secret_key) { "SECRET_ACCESS_KEY" }
159
+
160
+ it "sets s3_iam_role_arn only" do
161
+ config = S3Cache.send(:s3_configuration)
162
+ expect(config[:iam_role_arn]).to eq(s3_iam_role_arn)
163
+ expect(config[:profile]).to eq(nil)
164
+ expect(config[:access_key_id]).to eq(nil)
165
+ expect(config[:secret_access_key]).to eq(nil)
166
+ end
167
+ end
155
168
  end
156
169
  end
157
170
  end
@@ -9,12 +9,12 @@ module Omnibus
9
9
  describe "#client" do
10
10
  it "raises an error if it is not overridden" do
11
11
  expect { s3_configuration }.to raise_error(RuntimeError,
12
- "You must override s3_configuration")
12
+ "You must override s3_configuration")
13
13
  end
14
14
 
15
15
  it "raises an error stating that s3_configuration must be overriden" do
16
16
  expect { client }.to raise_error(RuntimeError,
17
- "You must override s3_configuration")
17
+ "You must override s3_configuration")
18
18
  end
19
19
  end
20
20
  end
@@ -40,6 +40,8 @@ module Omnibus
40
40
  let(:instance) { klass.new }
41
41
  let(:key_pair) { { access_key_id: "key_id", secret_access_key: "access_key" } }
42
42
  let(:profile) { "my-profile" }
43
+ let(:iam_role_arn) { "my-iam-role-arn" }
44
+ let(:role_session_name) { "omnibus-assume-role-s3-access" }
43
45
  let(:config) { { bucket_name: "foo", region: "us-east-1" } }
44
46
 
45
47
  it "uses configured key pairs" do
@@ -52,19 +54,36 @@ module Omnibus
52
54
  instance.send(:get_credentials)
53
55
  end
54
56
 
55
- it "preferrs shared credentials profiles over key pairs" do
57
+ it "prefers shared credentials profiles over key pairs" do
56
58
  allow_any_instance_of(klass).to receive(:s3_configuration).and_return(
57
59
  {
58
60
  **config,
59
61
  **key_pair,
62
+ iam_role_arn: nil,
60
63
  profile: profile,
61
64
  }
62
65
  )
63
66
  expect(Aws::Credentials).to_not receive(:new)
67
+ expect(Aws::AssumeRoleCredentials).to_not receive(:new)
64
68
  allow(Aws::SharedCredentials).to receive(:new).with(profile_name: profile)
65
69
  instance.send(:get_credentials)
66
70
  end
67
71
 
72
+ it "prefers AWS IAM role arn over profiles and key pairs" do
73
+ allow_any_instance_of(klass).to receive(:s3_configuration).and_return(
74
+ {
75
+ **config,
76
+ **key_pair,
77
+ profile: profile,
78
+ iam_role_arn: iam_role_arn,
79
+ }
80
+ )
81
+ expect(Aws::Credentials).to_not receive(:new)
82
+ expect(Aws::SharedCredentials).to_not receive(:new)
83
+ allow(Aws::AssumeRoleCredentials).to receive(:new).with(role_arn: iam_role_arn, role_session_name: role_session_name)
84
+ instance.send(:get_credentials)
85
+ end
86
+
68
87
  end
69
88
  end
70
89
  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",
77
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
78
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
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",
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",
88
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
89
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
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",
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",
99
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
100
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
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",
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",
110
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
111
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
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",
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",
121
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
122
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
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",
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",
133
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
134
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
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",
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"
@@ -196,9 +196,9 @@ module Omnibus
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",
200
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
201
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
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",
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"
@@ -240,9 +240,9 @@ module Omnibus
240
240
  it "sets the defaults" do
241
241
  expect(subject.with_standard_compiler_flags).to eq(
242
242
  "CC" => "clang",
243
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
244
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
245
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
243
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
244
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
245
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
246
246
  "CXX" => "clang++",
247
247
  "LDFLAGS" => "-L/opt/project/embedded/lib",
248
248
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
@@ -267,9 +267,9 @@ module Omnibus
267
267
  expect(subject.with_standard_compiler_flags).to eq(
268
268
  "CC" => "clang",
269
269
  "CXX" => "clang++",
270
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
271
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
272
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
270
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
271
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
272
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
273
273
  "LDFLAGS" => "-L/opt/project/embedded/lib",
274
274
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
275
275
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
@@ -286,13 +286,13 @@ module Omnibus
286
286
  end
287
287
  it "sets the defaults" do
288
288
  expect(subject.with_standard_compiler_flags).to eq(
289
- "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
290
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
291
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
292
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
293
- "LD_RUN_PATH" => "/opt/project/embedded/lib",
294
- "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
295
- "OMNIBUS_INSTALL_DIR" => "/opt/project"
289
+ "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
290
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
291
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
292
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
293
+ "LD_RUN_PATH" => "/opt/project/embedded/lib",
294
+ "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
295
+ "OMNIBUS_INSTALL_DIR" => "/opt/project"
296
296
  )
297
297
  end
298
298
 
@@ -307,13 +307,13 @@ module Omnibus
307
307
  "CC" => "gcc-4.8",
308
308
  "CXX" => "g++-4.8",
309
309
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
310
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
311
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
312
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
310
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
311
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
312
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
313
313
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
314
314
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
315
315
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
316
- )
316
+ )
317
317
  end
318
318
  end
319
319
  end
@@ -328,9 +328,9 @@ module Omnibus
328
328
  it "sets the defaults" do
329
329
  expect(subject.with_standard_compiler_flags).to eq(
330
330
  "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
331
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
332
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
333
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
331
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
332
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
333
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
334
334
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
335
335
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
336
336
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -547,7 +547,7 @@ module Omnibus
547
547
  describe "#whitelist_file" do
548
548
  it "appends to the whitelist_files array" do
549
549
  expect(subject.whitelist_files.size).to eq(0)
550
- subject.whitelist_file(/foo\/bar/)
550
+ subject.whitelist_file(%r{foo/bar})
551
551
  expect(subject.whitelist_files.size).to eq(1)
552
552
  end
553
553
 
@@ -558,6 +558,36 @@ module Omnibus
558
558
  end
559
559
  end
560
560
 
561
+ describe "#bin_dirs" do
562
+ it "sets bin_dirs" do
563
+ subject.bin_dirs ["my_bin_dir"]
564
+ expect(subject.bin_dirs).to eq(["my_bin_dir"])
565
+ expect(subject.bin_dirs).to be_kind_of(Array)
566
+ end
567
+
568
+ context "bin_dirs is not set" do
569
+ it "returns default values" do
570
+ expect(subject.bin_dirs).to eq(["/opt/project/bin", "/opt/project/embedded/bin"])
571
+ expect(subject.bin_dirs).to be_kind_of(Array)
572
+ end
573
+ end
574
+ end
575
+
576
+ describe "#lib_dirs" do
577
+ it "sets lib_dirs" do
578
+ subject.lib_dirs ["my_lib_dir"]
579
+ expect(subject.lib_dirs).to eq(["my_lib_dir"])
580
+ expect(subject.lib_dirs).to be_kind_of(Array)
581
+ end
582
+
583
+ context "lib_dirs is not set" do
584
+ it "returns default values" do
585
+ expect(subject.lib_dirs).to eq(["/opt/project/embedded/lib"])
586
+ expect(subject.lib_dirs).to be_kind_of(Array)
587
+ end
588
+ end
589
+ end
590
+
561
591
  context "testing repo-level version overrides" do
562
592
  context "without overrides" do
563
593
  it "returns the original values" do
@@ -46,8 +46,7 @@ module Omnibus
46
46
  environment: {
47
47
  "TICKLE_ME" => "elmo",
48
48
  "I_LOVE_YOU" => "barney",
49
- }
50
- )
49
+ })
51
50
  end
52
51
 
53
52
  context "when the command fails" do