On Sat, Mar 04, 2023 at 10:28:37PM -0800, Nam Nguyen wrote:
> Theo Buehler writes:
>
> > I needed gyp to test something and it turns out that it's broken since
> > at least the Python 3.8 -> 3.9 transition:
> >
> > AttributeError: module 'collections' has no attribute 'MutableSet'
> >
> > Upstream has some fixes and the below worked well enough for my purposes.
> >
> > Tests hang here:
> >
> > [249/356] (ninja)
> > test/variables/commands/gyptest-commands-ignore-env.py
>
> This is resolved by updating expected output files. input.py has changed
> but the expected test output became outdated.
I still don't quite get why out-of-sync expected output results in a
hang (please don't waste time to figure it out)...
Probably the tests are just poorly done...
> > and once tests were run, 'make clean' fails with permission errors.
>
> Some tests want to turn write permissions false, run the test, and turn
> write permissions true. This results in directories without write bits
> and `make clean' fails. The new for loops use sed to avoid toggling
> write permissions altogether.
... and this confirms that suspicion.
> > If anyone wants to pick this up and push it over the line, they are most
> > welcome to do so. I have no real interest in this.
>
> Here is an diff resolving these issues. However, 3 remaining tests fail
> and we should not care.
Agreed. Thanks for the detailed explanations.
> A hack like this defining LD_DEBUG_PATH works:
> https://namtsui.com/public/gyp.txt
>
> However, other tests start failing. Manually running these two tests
> passes after applying this hack so that the program can find the lib/
> directory. See the cut here snippet. I suggest not bothering.
Again agreed.
>
> > All consumers go via
> > lang/v8, which has been broken since the clang 13 transition, so I
> > suspect I'm not alone...
>
> I did not test much as v8 is marked BROKEN.
Thanks for tackling this - that's a lot more work than I expected anyone
to do.
This still works for the use case I had which isn't surprising since
your changes only affect tests. It is a bit surprising that upstream let
them rot this badly.
In general, I think such big patches should be avoided since they are
completely unreadable and have little chance to survive many updates
they will have to be redone but now that you've done the work, I guess
we should land them.
If you (are willing to) have a Google CLA, you could try to feed them
upstream. I suspect they won't care.
One comment below, otherwise
ok tb
Thanks!
> @@ -23,6 +22,16 @@ pre-configure:
>
> do-test:
> ln -fs ${MODPY_BIN} ${WRKDIR}/bin/python
> + # tests temporarily toggle write permissions, but this disrupts `make clean'.
> + # avoid toggling altogether.
> +.for l in default all
> + sed -ie "s;\(test\.writable(.*\)False);\1True);" \
> + ${WRKSRC}/test/builddir/gyptest-${l}.py
> +.endfor
> +.for l in depth actions mac-bundle relocate copies rules subdir2-deep symlink top-all
> + sed -ie "s;\(test\.writable(.*\)False);\1True);" \
> + ${WRKSRC}/test/generator-output/gyptest-${l}.py
> +.endfor
I think all this (also the ln) should be done in a pre-test target.
I was going to suggest doing a chmod -R a+rw, in pre-clean, but such
a hook does not exist. Maybe it would be possible to that it in
post-test? But perhaps that hinders debuggability...
> cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MODPY_BIN} gyptest.py -a
>
> .include <bsd.port.mk>
No comments:
Post a Comment