From 74c30cace25e4975a731c120e6dd84a0e6b5f785 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 16 Nov 2019 23:43:03 -0800 Subject: [PATCH] Add `HelloWorldX` builders, test suites for our various compilers Currently contains: * C * C++ * Fortran * Rust * Go The `Rust` test suite is quite restricted in platform, as we have a bit of breakage there. --- H/HelloWorldC/build_tarballs.jl | 30 +++++++++++++++++++++ H/HelloWorldCxx/build_tarballs.jl | 30 +++++++++++++++++++++ H/HelloWorldFortran/build_tarballs.jl | 30 +++++++++++++++++++++ H/HelloWorldGo/build_tarballs.jl | 30 +++++++++++++++++++++ H/HelloWorldRust/build_tarballs.jl | 39 +++++++++++++++++++++++++++ 5 files changed, 159 insertions(+) create mode 100644 H/HelloWorldC/build_tarballs.jl create mode 100644 H/HelloWorldCxx/build_tarballs.jl create mode 100644 H/HelloWorldFortran/build_tarballs.jl create mode 100644 H/HelloWorldGo/build_tarballs.jl create mode 100644 H/HelloWorldRust/build_tarballs.jl diff --git a/H/HelloWorldC/build_tarballs.jl b/H/HelloWorldC/build_tarballs.jl new file mode 100644 index 00000000000..faa11ee0718 --- /dev/null +++ b/H/HelloWorldC/build_tarballs.jl @@ -0,0 +1,30 @@ +using BinaryBuilder + +name = "HelloWorldC" +version = v"1.0.0" + +# No sources, we're just building the testsuite +sources = [ +] + +# Bash recipe for building across all platforms +script = raw""" +mkdir -p ${prefix}/bin +cc -o ${prefix}/bin/hello_world${exeext} -g -O2 /usr/share/testsuite/c/hello_world/hello_world.c +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = supported_platforms() + +# The products that we will ensure are always built +products = [ + ExecutableProduct("hello_world", :hello_world), +] + +# Dependencies that must be installed before this package can be built +dependencies = [ +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) diff --git a/H/HelloWorldCxx/build_tarballs.jl b/H/HelloWorldCxx/build_tarballs.jl new file mode 100644 index 00000000000..b33dc63962b --- /dev/null +++ b/H/HelloWorldCxx/build_tarballs.jl @@ -0,0 +1,30 @@ +using BinaryBuilder + +name = "HelloWorldCxx" +version = v"1.0.0" + +# No sources, we're just building the testsuite +sources = [ +] + +# Bash recipe for building across all platforms +script = raw""" +mkdir -p ${prefix}/bin +c++ -o ${prefix}/bin/hello_world${exeext} -g -O2 /usr/share/testsuite/cxx/hello_world/hello_world.cc +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = expand_cxxstring_abis(supported_platforms()) + +# The products that we will ensure are always built +products = [ + ExecutableProduct("hello_world", :hello_world), +] + +# Dependencies that must be installed before this package can be built +dependencies = [ +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) diff --git a/H/HelloWorldFortran/build_tarballs.jl b/H/HelloWorldFortran/build_tarballs.jl new file mode 100644 index 00000000000..226ec851093 --- /dev/null +++ b/H/HelloWorldFortran/build_tarballs.jl @@ -0,0 +1,30 @@ +using BinaryBuilder + +name = "HelloWorldFortran" +version = v"1.0.0" + +# No sources, we're just building the testsuite +sources = [ +] + +# Bash recipe for building across all platforms +script = raw""" +mkdir -p ${prefix}/bin +f77 -o ${prefix}/bin/hello_world${exeext} -g -O2 /usr/share/testsuite/fortran/hello_world/hello_world.f +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = expand_gfortran_versions(supported_platforms()) + +# The products that we will ensure are always built +products = [ + ExecutableProduct("hello_world", :hello_world), +] + +# Dependencies that must be installed before this package can be built +dependencies = [ +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) diff --git a/H/HelloWorldGo/build_tarballs.jl b/H/HelloWorldGo/build_tarballs.jl new file mode 100644 index 00000000000..460ebbbafc9 --- /dev/null +++ b/H/HelloWorldGo/build_tarballs.jl @@ -0,0 +1,30 @@ +using BinaryBuilder + +name = "HelloWorldGo" +version = v"1.0.0" + +# No sources, we're just building the testsuite +sources = [ +] + +# Bash recipe for building across all platforms +script = raw""" +mkdir -p ${prefix}/bin +go build -o ${prefix}/bin/hello_world${exeext} /usr/share/testsuite/go/hello_world/hello_world.go +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = supported_platforms() + +# The products that we will ensure are always built +products = [ + ExecutableProduct("hello_world", :hello_world), +] + +# Dependencies that must be installed before this package can be built +dependencies = [ +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; compilers=[:c, :go]) diff --git a/H/HelloWorldRust/build_tarballs.jl b/H/HelloWorldRust/build_tarballs.jl new file mode 100644 index 00000000000..f2a003ea045 --- /dev/null +++ b/H/HelloWorldRust/build_tarballs.jl @@ -0,0 +1,39 @@ +using BinaryBuilder + +name = "HelloWorldRust" +version = v"1.0.0" + +# No sources, we're just building the testsuite +sources = [ +] + +# Bash recipe for building across all platforms +script = raw""" +mkdir -p ${prefix}/bin +rustc -o ${prefix}/bin/hello_world${exeext} -g /usr/share/testsuite/rust/hello_world/hello_world.rs +""" + +# We build for a restricted set of platforms, because our rust toolchain is a little broken +platforms = supported_platforms() + +# First, FreeBSD has -fPIC problems when linking in `crt.o` +filter!(p -> !isa(p, FreeBSD), platforms) + +# Next, :musl libcs have a hard time linking +filter!(p -> libc(p) != :musl, platforms) + +# Finally, windows seems to be broken +# https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/499 +filter!(p -> !isa(p, Windows), platforms) + +# The products that we will ensure are always built +products = [ + ExecutableProduct("hello_world", :hello_world), +] + +# Dependencies that must be installed before this package can be built +dependencies = [ +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; compilers=[:c, :rust])