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

continuous integration assets look odd #187

Closed
raulk opened this issue Apr 4, 2022 · 3 comments · Fixed by #195
Closed

continuous integration assets look odd #187

raulk opened this issue Apr 4, 2022 · 3 comments · Fixed by #195

Comments

@raulk
Copy link
Member

raulk commented Apr 4, 2022

The CI pipeline is producing a bundle that's 235MiB in size. After the latest changes to the bundling logic, we're probably publishing the wrong root directory.

image

https://github.com/filecoin-project/builtin-actors/actions/runs/2083018859

@raulk
Copy link
Member Author

raulk commented Apr 4, 2022

It contains the bundles from various builds. This is probably related to two facts:

  1. The OUT_DIR fed to the build script is hash-based and not known outside the build. Thus the CI job is publishing the root output directory.
  2. We are caching the output directory, and the caches are bleeding over between CI builds, thus leading to the accumulation.

@raulk
Copy link
Member Author

raulk commented Apr 6, 2022

Documenting potential solutions after a short investigation.

  1. Bite the bullet and avoid emitting artifacts on OUT_DIR directly (randomized), but some predictable parent of that.
  2. Pass an explicit OUT_DIR through --out-dir.
    • Requires Rust nightly and enabling unstable Cargo features.
    • Tried this locally and I didn't get it to work.
  3. Use cargo build --build-plan to determine the OUT_DIR ahead of time.
  4. Use cargo build --message-format=json.
  5. Capture the out_dir we emit as a cargo:warning.

I guess (4) would be the recommended way, but it feels a bit complex and rather dependent on Cargo tooling breakages/decisions. (5) seems to be the most decoupled and future-proof way.

Proposed solution is to add a bundle $path Makefile target that builds teeing the output into a tmp file. It then grepts it to find the out_dir and copies the bundle from within to $path.


cargo build --message-format=json trace containing the out_dir (cherry-picked from other traces + normal output):

{
	"reason": "build-script-executed",
	"package_id": "fil_builtin_actors_bundle 7.0.5-alpha.1 (path+file:///Users/raul/W/pl/canonical-actors)",
	"linked_libs": [],
	"linked_paths": [],
	"cfgs": [],
	"env": [],
	"out_dir": "/Users/raul/W/pl/canonical-actors/target/debug/build/fil_builtin_actors_bundle-81ea31c1db216196/out"
}

@vmx
Copy link
Contributor

vmx commented Apr 6, 2022

  1. Let the build.rs write a file called out.dir into the CARGO_MANIFEST_DIR which contains the value of OUT_DIR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants