|
33 | 33 | outputFn string |
34 | 34 | buildMode string |
35 | 35 | offline bool |
36 | | - noUpdate bool |
37 | 36 | doVerify bool |
38 | 37 | noDocker bool |
39 | 38 | onlyValidate bool |
@@ -134,12 +133,12 @@ var ( |
134 | 133 | return fmt.Errorf("unsupported app kind for SGX TEE: %s", manifest.Kind) |
135 | 134 | } |
136 | 135 |
|
137 | | - sgxBuild(buildEnv, npa, manifest, deployment, bnd) |
| 136 | + sgxBuild(buildEnv, npa, manifest, deployment, bnd, doVerify) |
138 | 137 | case buildRofl.TEETypeTDX: |
139 | 138 | // TDX. |
140 | 139 | switch manifest.Kind { |
141 | 140 | case buildRofl.AppKindRaw: |
142 | | - err = tdxBuildRaw(buildEnv, tmpDir, npa, manifest, deployment, bnd) |
| 141 | + err = tdxBuildRaw(buildEnv, tmpDir, npa, manifest, deployment, bnd, doVerify) |
143 | 142 | case buildRofl.AppKindContainer: |
144 | 143 | err = tdxBuildContainer(buildEnv, tmpDir, npa, manifest, deployment, bnd) |
145 | 144 | } |
@@ -242,10 +241,10 @@ var ( |
242 | 241 |
|
243 | 242 | // Override the update manifest flag in case the policy does not exist. |
244 | 243 | if deployment.Policy == nil { |
245 | | - noUpdate = true |
| 244 | + roflCommon.NoUpdate = true |
246 | 245 | } |
247 | 246 |
|
248 | | - switch noUpdate { |
| 247 | + switch roflCommon.NoUpdate { |
249 | 248 | case true: |
250 | 249 | // Ask the user to update the manifest manually (if the manifest has changed). |
251 | 250 | if maps.Equal(buildEnclaves, latestManifestEnclaves) { |
@@ -291,6 +290,11 @@ func setupBuildEnv(deployment *buildRofl.Deployment, npa *common.NPASelection) { |
291 | 290 |
|
292 | 291 | // Obtain and configure trust root. |
293 | 292 | trustRoot, err := fetchTrustRoot(npa, deployment.TrustRoot) |
| 293 | + if deployment.Debug && err != nil { |
| 294 | + // Trust root is not mandatory for debug builds. |
| 295 | + fmt.Printf("WARNING: no trust root will be provided during compilation: %v\n", err) |
| 296 | + return |
| 297 | + } |
294 | 298 | cobra.CheckErr(err) |
295 | 299 | os.Setenv("ROFL_CONSENSUS_TRUST_ROOT", trustRoot) |
296 | 300 | } |
@@ -360,18 +364,14 @@ func init() { |
360 | 364 | buildFlags := flag.NewFlagSet("", flag.ContinueOnError) |
361 | 365 | buildFlags.BoolVar(&offline, "offline", false, "do not perform any operations requiring network access") |
362 | 366 | buildFlags.StringVar(&outputFn, "output", "", "output bundle filename") |
363 | | - buildFlags.BoolVar(&noUpdate, "no-update-manifest", false, "do not update the manifest") |
364 | 367 | buildFlags.BoolVar(&doVerify, "verify", false, "verify build against manifest and on-chain state") |
365 | 368 | buildFlags.BoolVar(&noDocker, "no-docker", false, "do not use the Dockerized builder") |
366 | 369 | buildFlags.BoolVar(&onlyValidate, "only-validate", false, "validate without building") |
367 | 370 |
|
368 | 371 | buildFlags.AddFlagSet(roflCommon.DeploymentFlags) |
369 | | - |
370 | | - // TODO: Remove when all the examples, demos and docs are updated. |
371 | | - var dummy bool |
372 | | - buildFlags.BoolVar(&dummy, "update-manifest", true, "not update the manifest") |
373 | | - _ = buildFlags.MarkDeprecated("update-manifest", "the app manifest is now updated by default. Pass --no-update-manifest to prevent updating it.") |
| 372 | + buildFlags.AddFlagSet(roflCommon.NoUpdateFlag) |
| 373 | + buildFlags.AddFlagSet(common.VerboseFlag) |
| 374 | + buildFlags.AddFlagSet(common.ForceFlag) |
374 | 375 |
|
375 | 376 | Cmd.Flags().AddFlagSet(buildFlags) |
376 | | - Cmd.Flags().AddFlagSet(common.ForceFlag) |
377 | 377 | } |
0 commit comments