Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST_DEPENDS aren't taken from packages #1131

Open
arrowd opened this issue Mar 6, 2024 · 9 comments
Open

TEST_DEPENDS aren't taken from packages #1131

arrowd opened this issue Mar 6, 2024 · 9 comments

Comments

@arrowd
Copy link

arrowd commented Mar 6, 2024

When Poudriere 3.4.1 installs {BUILD,LIB}_DEPENDS it passes USE_PACKAGE_DEPENDS_ONLY=1 to force using packages:

=======================<phase: lib-depends    >============================
===== env: DEVELOPER_MODE=yes USE_PACKAGE_DEPENDS_ONLY=1 USER=root UID=0 GID=0

Turns out this is not the case for TEST_DEPENDS during the package phase:

=======================<phase: package        >============================
===== env: DEVELOPER_MODE=yes PACKAGES=/tmp/pkgs PKGREPOSITORY=/tmp/pkgs PKGLATESTREPOSITORY=/tmp/pkgs/Latest 'PKG_NOTES=build_timestamp built_by' 'PKG_NOTE_build_timestamp=2024-03-06T15:50:56+0000' 'PKG_NOTE_built_by=poudriere-git-3.4.1' STRICT_DEPENDS=yes USER=nobody UID=65534 GID=65534

This leads to

===>  Testing for libjxl-0.10.1
===>   libjxl-0.10.1 depends on package: googletest>0 - not found
===>   googletest-1.14.0 depends on file: /usr/local/sbin/pkg - found
=> google-googletest-v1.14.0_GH0.tar.gz doesn't seem to exist in /portdistfiles/.
=> /portdistfiles/ is not writable by you; cannot fetch.
*** Error code 1

The make test stage gets hooked into the package phase via Mk/Features/testing.mk that I've added recently.

I guess, this can easily be fixed by making Poudriere pass USE_PACKAGE_DEPENDS_ONLY=1 for the package phase?

@arrowd arrowd added the bug label Mar 6, 2024
@bdrewery
Copy link
Member

bdrewery commented Mar 6, 2024

I don't see how this could work without #355. The problem with Poudriere is not that it "simply does not run make test".

For what it's worth I plan to tackle this (#355) after I merge in #822 in the coming weeks.

@arrowd
Copy link
Author

arrowd commented Mar 6, 2024

The test dependencies may not be built by the time make package runs. It is a dependency ordering problem which is why your package is missing.

No, my dependency is built by a previous poud bulk. Or even poudriere testport built it, I'll recheck this.

As for #355, I already implemented the hooking at the framework level via Mk/Features/testing.mk. The user defines WITH_TESTING=yes or WITH_TESTING_PORTS= some origins and then make test is run as part of make package.

So, in this case really just need USE_PACKAGE_DEPENDS_ONLY=1 to be passed by Poudriere.

@arrowd
Copy link
Author

arrowd commented Mar 10, 2024

Yes, you're right, Poudriere also doesn't queue TEST_DEPENDS. But even just having USE_PACKAGE_DEPENDS_ONLY=1 passed already improves the situation a lot.

@arrowd
Copy link
Author

arrowd commented Mar 10, 2024

Here' is a hack that fixed things for me: arrowd@7ac7541

@mandree
Copy link

mandree commented Apr 23, 2024

@arrowd I see several packages failing to build because the test-depends aren't queued by poudriere-devel yet. And those fail because we do not - by default - permit builds to fetch anything (more precisely, to resolve DNS after the fetch stage)

@arrowd
Copy link
Author

arrowd commented Apr 23, 2024

Yes, hacked it up a bit, see my previous comment. But this is either not an ideal solution and a more substantial work has to be done on the Poudriere side.

@mandree
Copy link

mandree commented Apr 23, 2024

Before we had the bits in place we have this year, I used to hack my Makefiles with (edited:) BUILD_DEPENDS+=${TEST_DEPENDS} or something like that, depending on the port. This is somewhat blunt as well... but really lifts TEST_DEPENDS to BUILD_DEPENDS, which is what you need anyways to build a package if you use -DWITH_TESTING or WITH_TESTING_PORTS=category/portname, (edited:) because this way, testing is a prerequisite for packaging.

We can't currently separate build-deps from test-deps when building packages, or did I miss some recent development?

@arrowd
Copy link
Author

arrowd commented Apr 23, 2024

This is actually an interesting idea! I will try to find time to play with it, thanks.

@bdrewery
Copy link
Member

bdrewery commented Apr 23, 2024

We can't currently separate build-deps from test-deps when building packages, or did I miss some recent development?

We can now after very recent changes. I need to put out a PoC for a proper TEST_DEPENDS/make test integration.

Edit: commit 48f74bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants