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

Allow control of --check-bounds command option #46

Merged

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Jul 6, 2021

I believe this command option is a bit more complicated than setting --check-bounds to yes (force always) or no (force never), because the default state is a 3rd state where --check-bounds is omitted entirely, and bounds checking is done per code decisions.. It'd be good if someone could confirm my understanding on that though.. the code is a bit hard to follow.

This is untested. I've not figured out how to test this in an action yet

@IanButterworth IanButterworth requested a review from a team as a code owner July 6, 2021 02:19
@IanButterworth IanButterworth force-pushed the ib/bounds_check_control branch from c5537d8 to 607d74c Compare July 6, 2021 02:20
@DilumAluthge DilumAluthge requested review from SaschaMann and removed request for a team July 6, 2021 02:20
@IanButterworth IanButterworth force-pushed the ib/bounds_check_control branch 2 times, most recently from 58fc1e0 to 17f2a09 Compare July 6, 2021 02:26
@IanButterworth IanButterworth force-pushed the ib/bounds_check_control branch from 17f2a09 to 53c01e3 Compare July 6, 2021 02:29
@IanButterworth
Copy link
Member Author

I'm not sure how to fix the bash here. Hopefully it's clear what i'm trying to do

@codecov-commenter
Copy link

codecov-commenter commented Jul 6, 2021

Codecov Report

Merging #46 (8603d27) into master (f8a636d) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #46   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            2         2           
=========================================
  Hits             2         2           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5f2948...8603d27. Read the comment docs.

@IanButterworth
Copy link
Member Author

Ok. Should be fixed now

@DilumAluthge
Copy link
Member

Can you squash the commits?

At a glance, it looks right to me, but I'm not the most familiar with this repo, so it would be good to get an approval from someone that knows the code better than I do.

@SaschaMann
Copy link
Member

I'll take a look later. I can squash it on merge, no need for it now.

Copy link
Member

@SaschaMann SaschaMann left a comment

Choose a reason for hiding this comment

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

The script looks alright, but I'm not sure about the behaviour of bounds checks.

Could you perhaps run the action thrice in a row for a package/script with all three inputs to see if it fails/behaves as expected as a demo?

Perhaps in a fork of https://github.com/julia-actions/Example.jl/blob/action-tests/test/runtests.jl?

action.yml Outdated Show resolved Hide resolved
@IanButterworth
Copy link
Member Author

Bounds check behavior confirmed on slack to be

  • --check-bounds=yes: force always bounds check
  • --check-bounds=no: force never bounds check
  • no command opt: automatic based on code controls

Happy to test run this with each config. How can I use this PR of the action though?

Co-authored-by: Sascha Mann <git@mail.saschamann.eu>
Copy link
Member

@SaschaMann SaschaMann left a comment

Choose a reason for hiding this comment

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

Happy to test run this with each config. How can I use this PR of the action though?

Replace - uses: julia-actions/julia-runtest@v1 with - uses: IanButterworth/julia-runtest@ib/bounds_check_control in the workflow in the repo/package you want to run the tests in. Doesn't have to be merged, you can replace and run it on a branch.

action.yml Outdated Show resolved Hide resolved
@IanButterworth
Copy link
Member Author

Needs a fix in Pkg, as it turns out --check-bounds=yes is hardcoded into the Pkg test sandbox JuliaLang/Pkg.jl#2668 and there's no way to override it back to default currently.

Would be easier with JuliaLang/julia#41551

@SaschaMann
Copy link
Member

Let's wait for that to be resolved then

@IanButterworth
Copy link
Member Author

IanButterworth commented Jul 13, 2021

This PR IanButterworth/SystemBenchmark.jl#50 is running on [1, nightly] with each of the check bounds options.

On nightly it is respected, and can be seen in the command args shown at the start of the test suite.

However on 1 (1.6) given [pr link deleted] wasn't backported to 1.6, --check-bounds=yes cannot be overridden, but the tooling here doesn't error.
Backporting that PR for this alone is probably not the best course of action, so perhaps this is just for 1.7 and up

Turned out to be a bug in this PR.

Update: This PR is now failing where I would expect it to fail (until JuliaLang/julia#41551 is backported to 1.6)

kwargs.jl Outdated Show resolved Hide resolved
Co-authored-by: Sascha Mann <git@mail.saschamann.eu>
@IanButterworth
Copy link
Member Author

@SaschaMann Should be ready to merge as this works on nightly, and the backports of JuliaLang/julia#41551 are labelled

kwargs.jl Outdated
Comment on lines 19 to 21
elseif julia_args != ``
println("::warning::The `julia_args` option requires at least Julia 1.6. VERSION=$VERSION, julia_args=$julia_args")
end
Copy link
Member

@SaschaMann SaschaMann Jul 18, 2021

Choose a reason for hiding this comment

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

Sorry to ask again, I want to be sure to understand this before merging: Can julia_args ever be `` here? It's set to julia_args = ["--check-bounds=${{ inputs.check_bounds }}"] in action.yml and ${{ inputs.check_bounds }} defaults to yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Should be fixed now. The change makes kwargs.jl more specific to how it's used in this action, which I assumed wasn't a problem

@SaschaMann
Copy link
Member

Sorry, I haven't had time to look at this again yet, it's on my list for the weekend.

Copy link
Contributor

@c42f c42f left a comment

Choose a reason for hiding this comment

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

I needed this today, so I had a read through the code.

Looks good to me!

kwargs.jl Outdated Show resolved Hide resolved
Co-authored-by: Chris Foster <chris42f@gmail.com>
@IanButterworth
Copy link
Member Author

It'd be nice to get this in

kwargs.jl Outdated Show resolved Hide resolved
@SaschaMann SaschaMann merged commit 161c97c into julia-actions:master Dec 22, 2021
@SaschaMann
Copy link
Member

Sorry for the delay

@IanButterworth IanButterworth deleted the ib/bounds_check_control branch December 22, 2021 15:55
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.

5 participants