Page MenuHomeFreeBSD

Porter's Handbook: Add an example on how to create a USES=go port
ClosedPublic

Authored by tobik on Aug 13 2019, 7:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 3:45 PM
Unknown Object (File)
Feb 10 2024, 11:15 AM
Unknown Object (File)
Jan 27 2024, 12:09 AM
Unknown Object (File)
Jan 16 2024, 10:35 AM
Unknown Object (File)
Jan 16 2024, 10:33 AM
Unknown Object (File)
Dec 25 2023, 6:14 AM
Unknown Object (File)
Dec 19 2023, 12:46 AM
Unknown Object (File)
Nov 11 2023, 10:46 AM
Subscribers
None

Diff Detail

Repository
rD FreeBSD doc repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 25830
Build 24402: arc lint + arc unit

Event Timeline

en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1261–1263

While this is not too difficult to do, I think we could streamline this step by providing a make gomod-vendor (or whatever) target in USES=go like make cargo-crates in USES=cargo.

en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1216

Unless I read incorrectly, this is not about using the "go" command but how to build ports using the "Go" language in the ports tree.

1313–1326

I think this should be either removed or really trimmed down to a simple note. It encourages people to test the build of their port outside of poudriere.

tobik marked an inline comment as done.
  • Update section title
en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1313–1326

This is copied from using-cargo where we have added a similar note and I think it has helped people.

If there is no note about this people will get confused and have to ask for help. Many people are building things outside of Poudriere (sometimes even as root) whether we like it or not because we still allow it by default for some reason.

en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1313–1326

Well, I would rather it be a small note saying something like "if you are not testing your port in a clean environment like with poudriere, remember to run make clean before any testing." or something similar :-)

en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1261–1263

I've added a review for this: https://reviews.freebsd.org/D21246

  • Use make gomod-vendor
  • Mention Poudriere
tobik added inline comments.
en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1261–1263

Thank you.

mat added inline comments.
en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1262

Does it output anything else ?
Because it should probably be as silent as possible, to be able to run, say, make gomod-vendor >> Makefile and need as few tweaks as possible.

This revision is now accepted and ready to land.Aug 13 2019, 1:48 PM
en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1262

go mod vendor does output some diagnostics, but it all goes to stderr so redirecting stdout should work.

tobik added inline comments.
en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1262

Yes, it implies make patch and framework messages always go to stdout, so the output might not be clean. make cargo-crates has the same problem.

If you want to append the output somewhere or pipe it to some command just run make gomod-vendor twice. On the second run the framework has nothing to do and will not output anything and the output will be clean.

This is just one more step in several steps you already have to go through. You probably already script it and adding one extra command should not make much of a difference. For USES=cargo ports (it's no different for USES=go:modules ports just s/cargo-crates/gomod-vendor/) this is basically what I do (implies ports-mgmt/portfmt is installed):

portedit set-version -i v1.2.3 Makefile
make clean makesum
make cargo-crates
make cargo-crates | portedit merge -i Makefile
make clean makesum

Anyway I think how to get the output into the Makefile should be left as an exercise to the reader as I do not foresee adding something like that to framework is wanted. ;-)

en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1262

all that portedit seems way too complicated, for the one port I have that uses rust (dns/doh-proxy), I have a crates.mk that I include in the Makefile and that I overwrite at each update, seemed much simpler :-)

@dg_syrec.org Are you fine with this too?

en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
1262

I have used that approach too in the first USES=cargo review but you told me not to do it since it requires extra files. ;-)

For dns/doh-proxy this is probably fine but make cargo-crates can also output things like CARGO_USE_GIT{HUB,LAB}, G{H,L}_TUPLE where IMHO port readability starts to suffer if they are set in another file. This is where portedit starts to make all the difference to me.

Anyway I do not mean to turn this review into a portedit ad and this is fairly OT now.