FS#67564 - [gitea] Race condition in build

Attached to Project: Community Packages
Opened by Gavin Beatty (gavinbeatty) - Wednesday, 12 August 2020, 15:22 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Wednesday, 12 August 2020, 18:43 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Bruno Pagani (ArchangeGabriel)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
gitea's [README](https://github.com/go-gitea/gitea/blob/master/README.md) states that parallelism is explicitly _not_ supported for the `build` target and its constituent parts, `frontend` and `generate`. However, PKGBUILD just calls `make frontend; make generate; make build`. These should be explicitly `make -j1 frontend`, etc.

Additional info:
* Tested using pkgver=1.12.3 pkgrel=1
* Relevant section of log for error:
```
cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
npx webpack --hide-modules --display-entrypoints=false
cp: cannot create regular file 'node_modules/fomantic-ui/src/theme.config': File exists
cp -r web_src/fomantic/_site/* node_modules/fomantic-ui/src/_site/
make: *** [Makefile:596: public/fomantic/semantic.min.js] Error 1
make: *** Waiting for unfinished jobs....
```

Steps to reproduce:
* Set MAKEFLAGS = -jN for some N>1 on a multicore system, via env or /etc/makepkg.conf
* `makepkg`
* Build fails in `make frontend`. It fails every time for me, but I suppose technically the failure is non-deterministic.
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Wednesday, 12 August 2020, 18:43 GMT
Reason for closing:  Fixed
Additional comments about closing:  In trunk.
Comment by Gavin Beatty (gavinbeatty) - Wednesday, 12 August 2020, 15:25 GMT Comment by Bruno Pagani (ArchangeGabriel) - Wednesday, 12 August 2020, 18:41 GMT
The reason why we run `make frontend; make generate; make build` while `make build` actually runs the two others is precisely because parallelism isn’t supported between those tasks. If you track back the discussion that leads to the commit that added the note about parallelism being unsupported, you will find my report of the issue.

What’s more there is that because webpack and fomantic actually have two targets, it triggers them to run twice in some cases, hence your issue. I’ll switch the PKGBUILD to `make -j1` instead, since no parallelism is possible during build.

Loading...