Saturday, August 31, 2024

Re: UPDATE: net/crawley-v1.7.8

2024-08-30T20:20:25Z Russ Sharek <bsdclown@disroot.org>:

>> Instead of setting MODGO_TEST_TARGET, it would be more
>> ports-idiomatic/clearer
>> to use a `do-test` target like:
>>
>> ```
>> do-test:
>>     cd ${WRKSRC} && CGO_ENABLED=1 ${MODGO_CMD} test -count 1 -v \
>>         -tags=test -coverprofile="cover.out" ./...
>> ```
>>
>> Tests are passing like this, so if you are alright with it, I think we
>> can
>> commit this.
>
> I'm thrilled to get some help on this, because I'm out of my depth.
>
> That said, `make test` with that do-test change failed for me here:
>
> make: don't know how to make cd (prerequisite of: do-test)
> Stop in .
> *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:3090
> '/usr/ports/pobj/crawley-1.7.8/build-amd64/.test_done': @cd
> /usr/ports/mystu...)
> *** Error 2 in /usr/ports/mystuff/net/crawley
> (/usr/ports/infrastructure/mk/bsd.port.mk:2704 'test':
> @lock=crawley-1.7.8;  export _LOCKS_HEL...)
>
> Tell me what I did wrong, so we can commit the *redacted* thing. :)
>
> -R

Did you by any chance write

do-test: cd ${WRKSRC} && ...

instead of

do-test:
    cd ${WRKSRC} && ...

If you did, then I think that's the problem. Everything after the colon
are prerequisites (dependencies) to the target (do-test), see here[1].
Prerequisites are simply other targets you'd want executed *before* the
do-test target. So in this case make tries to execute the 'cd' target
which doesn't exist.

[1] https://man.openbsd.org/make#DEPENDENCY_LINES

No comments:

Post a Comment