Skip to content

Conversation

@ltratt
Copy link
Contributor

@ltratt ltratt commented Mar 28, 2021

Needs #308 to be merged first. I'm raising this as useful context for softdevteam/depub#1.

This PR uses https://github.com/softdevteam/depub/ to reduce the visibility of quite a lot more items in yk. In some cases, we only slightly reduce visibility (pub(crate) to pub(super)) but there are a reasonable number where we get rid of pub entirely. We're also able to gate a small number of items behind #[cfg(feature="testing")] to make clear when something is only needed for our (unusual) test setup. Overall, this PR has no functional change, but should make it a tiny little bit easier to understand the code base.

@ltratt
Copy link
Contributor Author

ltratt commented Mar 29, 2021

If you're OK with me doing so, I suggest I rebase this against master and force push when #308 has merged before you review?

}
}

pub(crate) fn start_tracing() -> ThreadTracer {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is right. Why would starting tracing be a testing feature?

It's probably because your tool build with hardware tracing rustflags (and not software tracing)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly for the other bits in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably because your tool build with hardware tracing rustflags (and not software tracing)?

Yes, I used hw. I didn't realise that there'd be a difference here with sw? Would a bors try flush this out?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realise that there'd be a difference here with sw?

My guess is that compile-time guards like this would give inaccurate results if the oracle uses only -C tracer=hw.

Ideally your oracle would include both kinds of tracing, but read on...

Would a bors try flush this out?

No, because we don't yet test software tracing with cranelift. I'm not sure it's ready yet, but @bjorn3 is the person to ask.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having looked at this again, I agree that applying this to swt.rs is incorrect. Fixed in 0703d94.

@vext01
Copy link
Contributor

vext01 commented Mar 30, 2021

I think this is ready for squashing (and may as well sync the branch while we are here).

@ltratt
Copy link
Contributor Author

ltratt commented Mar 30, 2021

OK, as soon as #308 merges, I'll sync and force push.

ltratt added 3 commits March 30, 2021 10:13
These were found by a bodged version of depub.
This has to be handled a bit delicately, as repeatedly compiling ykrustc if
there are errors sometimes fails/succeeds in ways that I don't really
understand. It's possible that more depub'ing could be done, but something is
better than nothing.
@ltratt
Copy link
Contributor Author

ltratt commented Mar 30, 2021

Rebased and squashed.

@vext01
Copy link
Contributor

vext01 commented Mar 30, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 30, 2021

Build succeeded:

@bors bors bot merged commit f5a141b into ykjit:master Mar 30, 2021
@ltratt ltratt deleted the depub branch April 1, 2021 15:11
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