Skip to content

bootstrap: enable zlib for LLVM for Windows GNU #139931

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

ognevny
Copy link
Contributor

@ognevny ognevny commented Apr 16, 2025

when compiling target LLVM with opt-dist local on Windows/MinGW, profraw files are being compressed with zlib, so compiling without it will make llvm-profdata complain about lacking of zlib support. this error is shown:

profile uses zlib compression but the profile reader was built without zlib support

example from llvm test suite: https://github.com/llvm/llvm-project/blob/76b5fcbf975547251faaeed8b567ea09d139a607/llvm/test/tools/llvm-profdata/nocompress.test#L15.

implementation of step 3. from https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/experiment.20with.20.60opt-dist.20local.60.20in.20MSYS2/near/512393873

r? Kobzol

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 16, 2025

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@ognevny ognevny force-pushed the bootstrap-llvm-zlib branch from 6d8ed52 to 98837c0 Compare April 16, 2025 16:51
@ognevny
Copy link
Contributor Author

ognevny commented Apr 16, 2025

hm, probably current implementation won't work. IIUC target LLVM is used when rustc is being profiled...

@ognevny
Copy link
Contributor Author

ognevny commented Apr 16, 2025

yeah, that doesn't work
warning: D:/_/B/src/CLANG64/rustc-1.86.0-src/opt-artifacts\rustc-pgo/default_1016764578532249842_0_68.profraw: profile uses zlib compression but the profile reader was built without zlib support

@ognevny ognevny force-pushed the bootstrap-llvm-zlib branch from 98837c0 to bf07190 Compare April 16, 2025 19:19
@ognevny
Copy link
Contributor Author

ognevny commented Apr 17, 2025

now it works, so ready :)

when compiling target LLVM with `opt-dist local` on Windows/MinGW,
profraw files are being compressed with zlib, so compiling without it
will make `llvm-profdata` complain about lacking of zlib support. this
error is shown:

`profile uses zlib compression but the profile reader was built without
zlib support`

example from llvm test suite: https://github.com/llvm/llvm-project/blob/76b5fcbf975547251faaeed8b567ea09d139a607/llvm/test/tools/llvm-profdata/nocompress.test#L15
@ognevny ognevny force-pushed the bootstrap-llvm-zlib branch from bf07190 to bf26963 Compare April 17, 2025 09:53
@Kobzol Kobzol changed the title bootstrap: enable zlib for LLVM when we compile it for profiling bootstrap: enable zlib for LLVM for Windows GNU Apr 17, 2025
@Kobzol
Copy link
Contributor

Kobzol commented Apr 17, 2025

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 17, 2025

📌 Commit bf26963 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 17, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 17, 2025
bootstrap: enable zlib for LLVM for Windows GNU

when compiling target LLVM with `opt-dist local` on Windows/MinGW, profraw files are being compressed with zlib, so compiling without it will make `llvm-profdata` complain about lacking of zlib support. this error is shown:

`profile uses zlib compression but the profile reader was built without zlib support`

example from llvm test suite: https://github.com/llvm/llvm-project/blob/76b5fcbf975547251faaeed8b567ea09d139a607/llvm/test/tools/llvm-profdata/nocompress.test#L15.

implementation of step 3. from https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/experiment.20with.20.60opt-dist.20local.60.20in.20MSYS2/near/512393873

r? Kobzol
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 17, 2025
bootstrap: enable zlib for LLVM for Windows GNU

when compiling target LLVM with `opt-dist local` on Windows/MinGW, profraw files are being compressed with zlib, so compiling without it will make `llvm-profdata` complain about lacking of zlib support. this error is shown:

`profile uses zlib compression but the profile reader was built without zlib support`

example from llvm test suite: https://github.com/llvm/llvm-project/blob/76b5fcbf975547251faaeed8b567ea09d139a607/llvm/test/tools/llvm-profdata/nocompress.test#L15.

implementation of step 3. from https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/experiment.20with.20.60opt-dist.20local.60.20in.20MSYS2/near/512393873

r? Kobzol
@mati865
Copy link
Contributor

mati865 commented Apr 17, 2025

This likely won't work because you need zlib library and headers on CI.
IIRC in the past it used to be enabled for windows-gnu, but when GHA images changed this broke the builds.

@ognevny
Copy link
Contributor Author

ognevny commented Apr 17, 2025

This likely won't work because you need zlib library and headers on CI.

I'm sure that they are installed somewhere else. or they aren't?

@mati865
Copy link
Contributor

mati865 commented Apr 17, 2025

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 17, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#139774 (Fix replacing supertrait aliases in `ReplaceProjectionWith`)
 - rust-lang#139850 (Hide unstable print kinds within emit_unknown_print_request_help in stable channel)
 - rust-lang#139870 (add retries to remove and create dir all)
 - rust-lang#139902 (do not emit `OpaqueCast` projections with `-Znext-solver`)
 - rust-lang#139931 (bootstrap: enable zlib for LLVM for Windows GNU)
 - rust-lang#139935 (Upgrade to `rustc-rayon-core` 0.5.1)
 - rust-lang#139943 (rustdoc: Support inlined cross-crate re-exported trait aliases)
 - rust-lang#139961 (Two `rustc_const_eval` cleanups)
 - rust-lang#139962 (opt-dist: add a flag for running tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@ognevny
Copy link
Contributor Author

ognevny commented Apr 17, 2025

looked at CI build. CMake couldn't find Zlib, but build doesn't fail, so probably nothing changed for resulting LLVM

@bors bors merged commit dce7506 into rust-lang:master Apr 17, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 17, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 17, 2025
Rollup merge of rust-lang#139931 - ognevny:bootstrap-llvm-zlib, r=Kobzol

bootstrap: enable zlib for LLVM for Windows GNU

when compiling target LLVM with `opt-dist local` on Windows/MinGW, profraw files are being compressed with zlib, so compiling without it will make `llvm-profdata` complain about lacking of zlib support. this error is shown:

`profile uses zlib compression but the profile reader was built without zlib support`

example from llvm test suite: https://github.com/llvm/llvm-project/blob/76b5fcbf975547251faaeed8b567ea09d139a607/llvm/test/tools/llvm-profdata/nocompress.test#L15.

implementation of step 3. from https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/experiment.20with.20.60opt-dist.20local.60.20in.20MSYS2/near/512393873

r? Kobzol
@ognevny ognevny deleted the bootstrap-llvm-zlib branch April 19, 2025 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants