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

compilation and build system fixes #21115

Merged
merged 4 commits into from
Aug 20, 2024
Merged

Conversation

Snektron
Copy link
Collaborator

@Snektron Snektron commented Aug 17, 2024

This implements some fixes related to using the build system with only assembly as outputs from the other day.

To do:

  • fix TODOs or turn them into issues
  • Fix objcopy
  • Add test with build system where one the getEmittedBin is not required

@Snektron Snektron changed the title compilation build system fixes compilation and build system fixes Aug 18, 2024
@Snektron Snektron force-pushed the build-system-asm branch 3 times, most recently from db99ec3 to b3f638c Compare August 18, 2024 21:04
A compilation build step for which the binary is not required could not
be compiled previously. There were 2 issues that caused this:

- The compiler communicated only the results of the emitted binary and
  did not properly communicate the result if the binary was not emitted.

  This is fixed by communicating the final hash of the artifact path (the
  hash of the corresponding /o/<hash> directory) and communicating this
  instead of the entire path. This changes the zig build --listen protocol
  to communicate hashes instead of paths, and emit_bin_path is accordingly
  renamed to emit_digest.

- There was an error related to the default llvm object path when
  CacheUse.Whole was selected. I'm not really sure why this didn't manifest
  when the binary is also emitted.

  This was fixed by improving the path handling related to flush() and
  emitLlvmObject().

In general, this commit also improves some of the path handling throughout
the compiler and standard library.
This type is exactly the same as std.Build.Cache.Path, except for
one function which is not used anymore. Therefore we can replace
it without consequences.
These were fixed during the last few commits too. The emit_llvm_no_bin test
is renamed from the issue_12588 test.

Closes ziglang#17484
@Snektron Snektron marked this pull request as ready for review August 19, 2024 19:05
@andrewrk
Copy link
Member

Excellent

@andrewrk andrewrk merged commit dffc8c4 into ziglang:master Aug 20, 2024
10 checks passed
@Snektron Snektron deleted the build-system-asm branch August 20, 2024 05:33
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 this pull request may close these issues.

2 participants