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

Docs: julia_cmd: Document use of julia_cmd()[1] #48425

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

fonsp
Copy link
Member

@fonsp fonsp commented Jan 27, 2023

Resolve #48393

I don't want to take up too much time for this issue, so feel free to close/edit without comment. I'm already happy to have found the solution ☺️

@fonsp fonsp requested a review from giordano January 27, 2023 10:39
Copy link
Contributor

@giordano giordano left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'd like someone else to confirm it's ok to set this in stone.

@IanButterworth
Copy link
Member

Seems a shame to do all the work to construct the args then throw them away.
What about add a julia_cmd(args=false)?

@IanButterworth
Copy link
Member

Or just

"""
    Base.julia_exepath()

Returns the path to the julia executable of the running process.
"""
julia_exepath() = joinpath(Sys.BINDIR, julia_exename())

...
function julia_cmd(julia=julia_exepath(); cpu_target::Union{Nothing,String} = nothing)

Happy to PR it if people approve

@fonsp
Copy link
Member Author

fonsp commented Apr 10, 2023

@IanButterworth I don't think this will be used in performance-critical code, right?

The advantage of documenting julia_cmd()[1] is that it also works on past Julia versions :)

@IanButterworth
Copy link
Member

That could be in the compat note

"""
    Base.julia_exepath()

Returns the path to the julia executable of the running process.

!!! compat julia 1.10
    This was added in Julia 1.10. In prior versions use `julia_cmd()[1]`
    
"""
julia_exepath() = joinpath(Sys.BINDIR, julia_exename())

...
function julia_cmd(julia=julia_exepath(); cpu_target::Union{Nothing,String} = nothing)

@IanButterworth
Copy link
Member

We can also just merge this as is and that can be a follow-on

@fonsp
Copy link
Member Author

fonsp commented Apr 10, 2023

All sounds good to me! :)

@IanButterworth IanButterworth merged commit b96ec2c into JuliaLang:master Apr 10, 2023
Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
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.

Make julia_exename public API?
3 participants