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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.18 build failure on Linux & macOS #14

Closed
p-linnane opened this issue May 24, 2023 · 3 comments 路 Fixed by #16
Closed

v1.18 build failure on Linux & macOS #14

p-linnane opened this issue May 24, 2023 · 3 comments 路 Fixed by #16

Comments

@p-linnane
Copy link

Hello 馃憢 . I'm a maintainer for the Homebrew project. While packaging v1.18 of utftex we are encountering a build failure:

  make[1]: Entering directory '/tmp/utftex-20230524-5877-efo77/libtexprintf-1.18/src'
  /bin/bash ./gen_errorflags.sh ./boxes.c ./drawbox.c ./lexer.c ./parser.c
  /bin/bash ./gen_errorflags.sh ./boxes.c ./drawbox.c ./lexer.c ./parser.c
  Collecting error flags from ./boxes.c
  Collecting error flags from ./boxes.c
  Collecting error flags from ./drawbox.c
  Collecting error flags from ./drawbox.c
  Collecting error flags from ./lexer.c
  Collecting error flags from ./lexer.c
  Collecting error flags from ./parser.c
  Collecting error flags from ./parser.c
  rm: cannot remove 'tmperrflags': No such file or directory
  make[1]: *** [Makefile:1079: errorflags.h] Error 1
  make[1]: Leaving directory '/tmp/utftex-20230524-5877-efo77/libtexprintf-1.18/src'
  make: *** [Makefile:674: install-recursive] Error 1

The relevant GitHub Actions run can be found here.

Relates to Homebrew/homebrew-core#131899

@stevengj
Copy link
Contributor

This is a race condition that can be generated repeatedly by running rm src/errorflags.h src/errormessages.h && make -j16

Making all in src
/bin/sh ./gen_errorflags.sh ./boxes.c ./drawbox.c ./lexer.c ./parser.c
/bin/sh ./gen_errorflags.sh ./boxes.c ./drawbox.c ./lexer.c ./parser.c
Collecting error flags from ./boxes.c
Collecting error flags from ./boxes.c
Collecting error flags from ./drawbox.c
Collecting error flags from ./drawbox.c
Collecting error flags from ./lexer.c
Collecting error flags from ./lexer.c
Collecting error flags from ./parser.c
Collecting error flags from ./parser.c
rm: tmperrflags: No such file or directory
make[1]: *** [errormessages.h] Error 1
make: *** [all-recursive] Error 1

The problem is that it's trying to build both src/errorflags.h and src/errormessages.h in parallel, but these are generated by the same script using the same temp file.

A workaround for now is to use a serial build.

@stevengj
Copy link
Contributor

The solution to generating multiple source files with a single rule is described in the automake manual: https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html

I'll send a PR shortly.

(It would be good to set up github actions CI as well, to catch these bugs by doing parallel builds from scratch for all PRs.)

@p-linnane
Copy link
Author

Thank you for the quick fix @stevengj!

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

Successfully merging a pull request may close this issue.

2 participants