jrmarino / synth

Next D/Ports build tool for live systems (Alternative for Portmaster and Portupgrade tools)
ISC License
251 stars 15 forks source link

feature request: add build for different FreeBSD versions #178

Open Peter2121 opened 3 years ago

Peter2121 commented 3 years ago

It would be nice to be able to build packages for previous versions of FreeBSD using synth (foe example, use 12.1 host to build packages for 11.3).

jrmarino commented 3 years ago

That's already possible using profiles. Or adjusting the configuration of the active profile.

Peter2121 commented 3 years ago

Any documents about it? I don't see 'FreeBSD version' option in 'synth configure'.

jrmarino commented 3 years ago

yes. You have to provide the root directory of the freebsd you want, and then change the sysroot path to the directory that holds that root.
The default configuration uses the system root of the host system. You're talking about using an older system root. So you have to install the files of that older system (11.3 in your example) and create a new profile that uses that system root instead of the host one. It's in the man pages although that may not be obvious.

Peter2121 commented 3 years ago

OK, thank you. Indeed, I saw the 'System root directory' parameter, but it is not obvious at all that providing an 'old' system tree we can build packages for the old version.

Peter2121 commented 3 years ago

yes. You have to provide the root directory of the freebsd you want, and then change the sysroot path to the directory that holds that root. The default configuration uses the system root of the host system. You're talking about using an older system root. So you have to install the files of that older system (11.3 in your example) and create a new profile that uses that system root instead of the host one. It's in the man pages although that may not be obvious.

Could the same procedure be applied to build x86 packages on x64 server?

jrmarino commented 3 years ago

If I remember correctly, a stock x86-64 system has 32 bit libraries, so in theory you can use the host system. That said, I'm not sure how you tell synth to build 32-bit instead. How does poudriere do it?

Peter2121 commented 3 years ago

How does poudriere do it?

I'm using synth only, I don't know :)

kevans91 commented 3 years ago

With poudriere, you'd likely pass -a i386.i386 to jail -c and it'd translate that to a TARGET/TARGET_ARCH pair for buildworld or fetch the appropriate i386 snapshot/distribution set for the root.