BinaryBuilder.jl icon indicating copy to clipboard operation
BinaryBuilder.jl copied to clipboard

Include minimal script in hints

Open bramtayl opened this issue 5 years ago • 9 comments
trafficstars

It took me a while to figure out how to use meson. Maybe a more in depth hint script would be helpful, like

meson ${prefix} . --cross-file=${MESON_TARGET_TOOLCHAIN}
cd ..
cd ..
cd destdir
ninja
ninja install

bramtayl avatar Jul 30 '20 01:07 bramtayl

I'm not sure what you're asking, isn't the documentation https://juliapackaging.github.io/BinaryBuilder.jl/dev/build_tips/#Meson-builds, which also points to concrete examples, clear enough?

Also, note that we can easily transfer issues between repositories within the same organisation, so no need to open multiple tickets.

giordano avatar Jul 30 '20 05:07 giordano

Yes, I saw those. I think meson needs two positional arguments, one for the location of the code, and one for the target folder. Then you have to cd to the target folder before you run ninja? Although looking at those code examples, maybe I'm wrong?

bramtayl avatar Jul 30 '20 12:07 bramtayl

maybe I'm wrong?

I think so

giordano avatar Jul 30 '20 13:07 giordano

Aha, well that might explain why my ORC PR was faltering. All of the examples do something like this:

mkdir build && cd build
meson .. --cross-file=${MESON_TARGET_TOOLCHAIN}

Maybe that could be in the hints?

bramtayl avatar Jul 30 '20 14:07 bramtayl

A broader way to think about this is that the hints scripts should be as complete as possible. For example, none of them include a line for cd'ing into the right folder before starting.

bramtayl avatar May 20 '21 13:05 bramtayl

For example, none of them include a line for cd'ing into the right folder before starting.

Because generally speaking you don't have to do it. It's good style, but not strictly necessary. It's common to do that with CMake because there is no way to clean up what you've built so far, so what people do is to do the build in a subdirectory and if necessary wipe it out to restart from scratch. Makefiles generated by Autoconf have the distclean target to do that, so in that case it's not important to move anywhere at all.

giordano avatar May 22 '21 14:05 giordano

with CMake there is no way to clean up what you've built so far, so what people do is to do the build in a subdirectory and if necessary wipe it out to restart from scratch

Ah, right, so then, maybe mention this or even include it in the suggested code? In the couple of CMake builds I've done, when I just cd'd into the folder and pasted the hint code, I got a warning that building into the source folder is deprecated, and it's recommended to create a separate build folder?

bramtayl avatar May 24 '21 21:05 bramtayl

It seems to me that for the hint script, the first priority would be getting something that could potentially work just from copying and pasting.

bramtayl avatar May 24 '21 21:05 bramtayl

just cd'd into the folder and pasted the hint code, I got a warning that building into the source folder is deprecated, and it's recommended to create a separate build folder?

I think those are custom messages printed by custom CMake files, not something built-in

giordano avatar May 24 '21 22:05 giordano