Skip to content

Add OCaml compiler support#1382

Merged
maleadt merged 5 commits into
masterfrom
ct/ocaml-support
Jul 7, 2025
Merged

Add OCaml compiler support#1382
maleadt merged 5 commits into
masterfrom
ct/ocaml-support

Conversation

@topolarity

Copy link
Copy Markdown
Member

No description provided.

@topolarity

Copy link
Copy Markdown
Member Author

Tried to run the tests locally but ran into:

Caused by:
  failed to create directory `/usr/share/testsuite/rust/cargo_build/target`

Caused by:
  Cross-device link (os error 18)
# ...
    [2] autobuild(dir::AbstractString, src_name::AbstractString, src_version::VersionNumber, sources::Vector{<:AbstractSource}, script::AbstractString, platforms::Vector, products::Vector{<:Product}, dependencies::Vector{<:AbstractDependency}; verbose::Bool, debug::Bool, skip_audit::Bool, ignore_audit_errors::Bool, autofix::Bool, code_dir::Union{Nothing, String}, require_license::Bool, dont_dlopen::Bool, kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
      @ BinaryBuilder ~/repos/BinaryBuilder.jl/src/AutoBuild.jl:932
    [3] (::var"#25#27"{Platform, Vector{Platform}})(build_path::String)
      @ Main ~/repos/BinaryBuilder.jl/test/building.jl:132

@giordano

Copy link
Copy Markdown
Member

JuliaPackaging/BinaryBuilderBase.jl#395

@maleadt maleadt force-pushed the ct/ocaml-support branch from 0d7caa5 to f0b86a5 Compare June 27, 2025 12:22
@maleadt

maleadt commented Jun 27, 2025

Copy link
Copy Markdown
Member

Where do the hello_world_... binaries come from?

@giordano

Copy link
Copy Markdown
Member

You mean the https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl package? That (and friend) are normal packages in Yggdrasil.

@maleadt

maleadt commented Jun 27, 2025

Copy link
Copy Markdown
Member

That provides hello_world; where do these come from?

ExecutableProduct("hello_world_c", :hello_world_c),
ExecutableProduct("hello_world_cxx", :hello_world_cxx),
ExecutableProduct("hello_world_fortran", :hello_world_fortran),
ExecutableProduct("hello_world_go", :hello_world_go),
]
if !(platforms_match(shard, Platform("i686", "windows")) ||
platforms_match(shard, Platform("aarch64", "freebsd")) ||
platforms_match(shard, Platform("riscv64", "linux")))
# Rust is broken on 32-bit Windows and unavailable on FreeBSD AArch64 and Linux RISC-V, let's skip it
push!(products, ExecutableProduct("hello_world_rust", :hello_world_rust))
end

Because those fail during testing:

[ Info: ["hello_world_ocaml"] does not exist, reporting unsatisfied
┌ Error: Built testsuite but hello_world_ocaml still unsatisfied:
└ @ BinaryBuilder /data/staticfloat/bb_azp/rootfs/agent_3/_work/1/s/src/AutoBuild.jl:973
##[error]Built testsuite but hello_world_ocaml still unsatisfied:

@giordano

Copy link
Copy Markdown
Member

Ah, the testsuite is in https://github.com/JuliaPackaging/Yggdrasil/tree/1faf9cffaaeff93f8e9c0ae48b2e75ec19545147/0_RootFS/Rootfs/bundled/testsuite, needs building a new RootFS as well...

This is an area where BB2 would hopefully be better and we can dynamically generate all these extra files on the file in one package, instead of having to build a new layer for each thing....

@maleadt

maleadt commented Jun 27, 2025

Copy link
Copy Markdown
Member

So that just needs to contain the source files of a hello_world-generating binary? Or would it be fine to add some code generating it to the build script; it's a simple Hello World print after all?

@giordano

Copy link
Copy Markdown
Member

So that just needs to contain the source files of a hello_world-generating binary?

Yes, it pretty much needs a Makefile to generate the executable and that's it.

Or would it be fine to add some code generating it to the build script; it's a simple Hello World print after all?

Uhm, if I remember correctly that testsuite is also in BinaryBuilder tests, you'd need to duplicate the generation. For quick testing is probably fine, I think it'd be nicer to eventually have the Makefile in the testsuite though.

@maleadt maleadt marked this pull request as draft June 27, 2025 16:30
@maleadt maleadt self-assigned this Jun 27, 2025
@maleadt maleadt force-pushed the ct/ocaml-support branch 2 times, most recently from 0e3e540 to ecaf806 Compare July 4, 2025 13:11
@maleadt

maleadt commented Jul 4, 2025

Copy link
Copy Markdown
Member

I added a test to the RootFS as part of JuliaPackaging/Yggdrasil#11146 and bumped it in JuliaPackaging/BinaryBuilderBase.jl#425.

@maleadt maleadt force-pushed the ct/ocaml-support branch from ecaf806 to 048ada5 Compare July 7, 2025 09:02
@maleadt maleadt marked this pull request as ready for review July 7, 2025 10:53
@maleadt maleadt merged commit fc1d811 into master Jul 7, 2025
10 checks passed
@maleadt maleadt deleted the ct/ocaml-support branch July 7, 2025 10:53
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