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

Fix contrib/juliac.jl: enable --experimental option if --trim option is passed to juliac.jl #56654

Closed

Conversation

terasakisatoshi
Copy link

This PR fixes the static_call_graph_arg function in contrib/juliac.jl. If we use --trim option, we must use it with --experimental flag.

jl_errorf("julia: --trim is an experimental feature, you must enable it with --experimental");

@fredrikekre
Copy link
Member

See #56602

@giordano
Copy link
Contributor

Side note, can we please have a more descriptive title (like #56602)? It's very much unclear from the title alone what's being fixed or why.

@terasakisatoshi terasakisatoshi changed the title Fix contrib/juliac.jl Fix contrib/juliac.jl: enable --experimental option if --trim option is passed to juliac.jl Nov 23, 2024
@terasakisatoshi
Copy link
Author

terasakisatoshi commented Nov 23, 2024

I'm sorry. 😢

Here is why this PR was created. I'm using juliac.jl to build an executable or shared library. Using --trim option is helpful to reduce the size of binary. One day, julia +nightly juliac.jl --trim ... did not work suddenly. I decided it check source code to resolve the issue. I found

jl_errorf("julia: --trim is an experimental feature, you must enable it with --experimental");

is added at some point. As of yesterday, fixing the static_call_graph_arg was a easy solution to me.

Today I found providing --experimental option to the below is another option...

julia/contrib/juliac.jl

Lines 13 to 23 in 0bedaae

help = findfirst(x->x == "--help", ARGS)
if help !== nothing
println(
"""
Usage: julia juliac.jl [--output-exe | --output-lib | --output-sysimage] <name> [options] <file.jl>
--trim=<no,safe,unsafe,unsafe-warn> Only output code statically determined to be reachable
--compile-ccallable Include all methods marked `@ccallable` in output
--verbose Request verbose output
""")
exit(0)
end

If one feel my PR is a duplicate of #56602 , feel free to close this issue PR.

@giordano giordano closed this Nov 23, 2024
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.

3 participants