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

Prevent tainting native code loading from propagating #53457

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

vchuravy
Copy link
Member

When we use options like code coverage, we can't use the native code
present in the cache file since it is not instrumented.

PR #52123 introduced the capability of skipping the native
code during loading, but created the issue that subsequent packages
could have an explicit or implicit dependency on the native code.

PR #53439 tainted the current process by setting
use_sysimage_native_code, but this flag is propagated to subprocesses
and lead to a regression in test time.

Move this to a process local flag to avoid the regression.
In the future we might be able to change the calling convention for
cross-image calls to invoke(ci::CodeInstance, args...) instead of
ci.fptr(args...) to handle native code not being present.

When we use options like code coverage, we can't use the native code
present in the cache file since it is not instrumented.

PR #52123 introduced the capability of skipping the native
code during loading, but created the issue that subsequent packages
could have an explicit or implicit dependency on the native code.

PR #53439 tainted the current process by setting
`use_sysimage_native_code`, but this flag is propagated to subprocesses
and lead to a regression in test time.

Move this to a process local flag to avoid the regression.
In the future we might be able to change the calling convention for
cross-image calls to `invoke(ci::CodeInstance, args...)` instead of
`ci.fptr(args...)` to handle native code not being present.
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Feb 24, 2024
@vchuravy vchuravy merged commit b8a0a39 into master Feb 25, 2024
6 of 8 checks passed
@vchuravy vchuravy deleted the vc/dont_propagate_taint branch February 25, 2024 02:48
@Seelengrab
Copy link
Contributor

Seelengrab commented Feb 26, 2024

Ohoho, you've done me one better than just fixing it, you've seemingly improved CI times too!

Before the regression:

Test Summary:  | Pass  Broken  Total     Time
Supposition.jl |  159       1    160  1m01.7s
     Testing Supposition tests passed 

https://github.com/Seelengrab/Supposition.jl/actions/runs/8023184836/job/21919147557#step:6:103

With the regression:

Test Summary:  | Pass  Broken  Total     Time
Supposition.jl |  178       1    179  4m52.7s
     Testing Supposition tests passed 

https://github.com/Seelengrab/Supposition.jl/actions/runs/8023184836/job/21919147557#step:6:103

After the fix:

Test Summary:  | Pass  Broken  Total   Time
Supposition.jl |  178       1    179  44.8s
     Testing Supposition tests passed 

https://github.com/Seelengrab/Supposition.jl/actions/runs/8042782840/job/21963899204#step:6:119

Much ❤️ for the quick turnaround on this!

@KristofferC KristofferC added the backport 1.11 Change should be backported to release-1.11 label Feb 26, 2024
KristofferC pushed a commit that referenced this pull request Feb 26, 2024
When we use options like code coverage, we can't use the native code
present in the cache file since it is not instrumented.

PR #52123 introduced the capability of skipping the native
code during loading, but created the issue that subsequent packages
could have an explicit or implicit dependency on the native code.

PR #53439 tainted the current process by setting
`use_sysimage_native_code`, but this flag is propagated to subprocesses
and lead to a regression in test time.

Move this to a process local flag to avoid the regression.
In the future we might be able to change the calling convention for
cross-image calls to `invoke(ci::CodeInstance, args...)` instead of
`ci.fptr(args...)` to handle native code not being present.

---------

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
(cherry picked from commit b8a0a39)
@IanButterworth
Copy link
Member

Being faster is suspicious. Are coverage results as expected?

@giordano
Copy link
Contributor

For what is worth, also the sequential total time of PkgEval is sensibly lower on b8a0a39 than on previous runs:

I don't know what's the variability of these times, maybe @maleadt has more insights about this.

@Seelengrab
Copy link
Contributor

Being faster is suspicious. Are coverage results as expected?

Not 100% sure whether I'm looking at the right thing, but the coverage report seems fine to me. Might be that codecov is mixing it between nightly and 1.10 though, not sure 🤔

@maleadt
Copy link
Member

maleadt commented Feb 26, 2024

For what is worth, also the sequential total time of PkgEval is sensibly lower on b8a0a39 than on previous runs

This may also be caused by precompilation of the test environment failing before #53387, which is only part of the latest evaluation. However, it still looks better than before that bug started happening, at which point PkgEval took around 30 days.

@LilithHafner LilithHafner removed the merge me PR is reviewed. Merge when all tests are passing label Feb 26, 2024
@KristofferC KristofferC removed the backport 1.11 Change should be backported to release-1.11 label Mar 1, 2024
tecosaur pushed a commit to tecosaur/julia that referenced this pull request Mar 4, 2024
When we use options like code coverage, we can't use the native code
present in the cache file since it is not instrumented.

PR JuliaLang#52123 introduced the capability of skipping the native
code during loading, but created the issue that subsequent packages
could have an explicit or implicit dependency on the native code.

PR JuliaLang#53439 tainted the current process by setting
`use_sysimage_native_code`, but this flag is propagated to subprocesses
and lead to a regression in test time.

Move this to a process local flag to avoid the regression.
In the future we might be able to change the calling convention for
cross-image calls to `invoke(ci::CodeInstance, args...)` instead of
`ci.fptr(args...)` to handle native code not being present.

---------

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
mkitti pushed a commit to mkitti/julia that referenced this pull request Mar 7, 2024
When we use options like code coverage, we can't use the native code
present in the cache file since it is not instrumented.

PR JuliaLang#52123 introduced the capability of skipping the native
code during loading, but created the issue that subsequent packages
could have an explicit or implicit dependency on the native code.

PR JuliaLang#53439 tainted the current process by setting
`use_sysimage_native_code`, but this flag is propagated to subprocesses
and lead to a regression in test time.

Move this to a process local flag to avoid the regression.
In the future we might be able to change the calling convention for
cross-image calls to `invoke(ci::CodeInstance, args...)` instead of
`ci.fptr(args...)` to handle native code not being present.

---------

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
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.

8 participants