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

Docker Build: fatal error: sting.h #59

Closed
newhinton opened this issue Apr 14, 2024 · 3 comments
Closed

Docker Build: fatal error: sting.h #59

newhinton opened this issue Apr 14, 2024 · 3 comments
Labels
bug Something isn't working building Issues and pull requests related to building the code

Comments

@newhinton
Copy link

Version of the game

Original Hardware or Emulator?

Buildprocess, Docker

What is the bug?

I am using Docker to generate the rom.

I have followed the documentation around docker, except that i am using most of the commands from the makefile directly, since the makefile fails.

sudo docker run --rm -v $PWD:/usr/src/app -v PORTALDIR/steamapps/common/Portal/:/usr/src/app/vpk/Portal -e PORTAL64_WITH_DEBUGGER -e PORTAL64_WITH_GFX_VALIDATOR -it portal64 bash

Steps to reproduce the behavior:

  1. Start the container with above command
  2. Run make english_audio

Result:

mips-n64-gcc -c -mabi=32 -ffreestanding -mfix4300 -G 0     -DDEBUG -g -Werror -Wall -DF3DEX_GBI_2 -DSCENE_SCALE=128 -I/usr/include/n64/PR -Isrc/ -I/opt/crashsdk/mips64-elf/include   -I/usr/include/n64 -Os    -c -o build/src/controls/controller.o src/controls/controller.c
src/controls/controller.c:9:10: fatal error: string.h: No such file or directory
    9 | #include <string.h>
      |          ^~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:145: build/src/controls/controller.o] Error 1
make[1]: Leaving directory '/usr/src/app'
make: *** [Makefile:89: english_audio] Error 2

Screenshots

No Screenshots

Additional context

The docker makefile is seemingly broken. There is $$PWD for one, which doesn't properly evaluate when executed, and also using it as is wont work either. make f Makefile.docker image eg. fails, but running docker build -t portal64 . works fine as sudo. But i don't think that is related. Thanks for your help&work!

@mwpenny
Copy link
Owner

mwpenny commented Apr 14, 2024

Good catch. The build was recently changed to depend on newlib-mips-n64. This package is installed by setup.sh for non-Docker builds, but not during Docker image generation.

I've updated the Dockerfile accordingly. Try rebuilding your image with the latest changes and building again.

As for the Makefile.docker issues, I'm able to use it without problems on Arch with Bash. Which OS and shell are you using? What is the error when it fails and does $PWD evaluate properly on its own? The two dollar signs are only needed in the Makefile.

@mwpenny mwpenny added bug Something isn't working building Issues and pull requests related to building the code labels Apr 14, 2024
mwpenny added a commit that referenced this issue Apr 14, 2024
@newhinton
Copy link
Author

As for the Makefile.docker issues, I'm able to use it without problems on Arch with Bash. Which OS and shell are you using? What is the error when it fails and does $PWD evaluate properly on its own? The two dollar signs are only needed in the Makefile.

Nevermind, it was a permission error. It seems to run fine with sudo, but the error message was not straitforward and hid the issue.

With the fix, it builds now! The game runs fine!
Maybe it would be a good idea extend the makefile to somehow mount the portal game directory inside the container? It was easy for me to do so, but maybe there is an easier way with make.

Thank you for your help! It's quite amazing that this is a thing now :D

@mwpenny
Copy link
Owner

mwpenny commented Apr 14, 2024

Glad to hear it's working!

The build can definitely be made better. I'm going to make some improvements as part of resolving issue #4. One of them will be to automatically find the game files, with an option to override the location so multi-language ROMs are still possible (the game directory only contains one audio language at a time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working building Issues and pull requests related to building the code
Projects
None yet
Development

No branches or pull requests

2 participants