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

[BUG] Build can fail on system with different awk #52

Open
jgabaut opened this issue Nov 16, 2023 · 7 comments
Open

[BUG] Build can fail on system with different awk #52

jgabaut opened this issue Nov 16, 2023 · 7 comments
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@jgabaut
Copy link
Owner

jgabaut commented Nov 16, 2023

Describe the bug
Since building needs anvil to generate its template header, it seems on some platforms build might fail due to anvil relying on awk to parse its config file.

To Reproduce
Steps to reproduce the behavior:

  1. Try building
  2. See awk invalid syntax errors

Expected behavior
Build succeeds even if awk fails.

  • OS: Linux
  • Version >= 1.3.0

Additional context

See the related issue on amboso

My version of awk (working):

$ awk -W version
GNU Awk 5.2.2, API 3.2, PMA Avon 8-g1, (GNU MPFR 4.2.1, GNU MP 6.3.0)
Copyright (C) 1989, 1991-2023 Free Software Foundation.

Version of awk on the reporter machine:

$ awk -W version
mawk 1.3.4 20200120
Copyright 2008-2019,2020, Thomas E. Dickey
Copyright 1991-1996,2014, Michael D. Brennan
@jgabaut jgabaut added bug Something isn't working invalid This doesn't seem right labels Nov 16, 2023
@jgabaut jgabaut changed the title Build fails on system with different awk Build can fail on system with different awk Nov 16, 2023
@jgabaut jgabaut added the help wanted Extra attention is needed label Nov 16, 2023
@jgabaut jgabaut changed the title Build can fail on system with different awk [BUG] Build can fail on system with different awk Nov 27, 2023
@jgabaut
Copy link
Owner Author

jgabaut commented Dec 25, 2023

A quick patch for this would be:

  • Removing the auto-generated anvil symlink:
    rm ./anvil
  • Then using invil instead of amboso as the symlink:
    ./scripts/bootstrap_anvil.sh repo_invil.

If you have invil already installed and maybe symlinked to anvil, you can do: ./script/bootstrap_anvil.sh -i and pick the global reference instead of the repo one.

A more substantial fix would be updating the ./anvil rule in Makefile.am to use repo_invil.

@jgabaut jgabaut self-assigned this Dec 25, 2023
@jgabaut
Copy link
Owner Author

jgabaut commented Dec 29, 2023

Edit:

This patch is useless after 1.4.4 . Refer to this for avoiding the anvil dependency.

To build the game without needing anvil at all (thus avoiding this issue), you can apply this patch:

diff --git a/Makefile.am b/Makefile.am
index 9a72596..4a4ed7d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,7 @@ PACK_NAME = $(TARGET)-$(VERSION)-$(OS)-$(MACHINE)
 PALETTE_PATH = "./static/palette.gpl"
 
 # Source files
-helapordo_SOURCES = src/helapordo.c src/game_core.c src/game_utils.c src/game_curses.c src/rooms.c src/artifacts.c src/specials.c src/main.c src/sprites.c src/floors.c sprites4curses/s4c-animate/animate.c koliseo/src/koliseo.c src/anvil__helapordo.c src/animations/mummy_shuffle.c src/animations/ghost_spell.c src/animations/boar_scream.c src/animations/troll_club.c src/animations/goblin_shoot.c src/animations/zombie_walk.c src/animations/imp_fireball.c src/animations/werewolf_transform.c src/animations/knight_tapis.c src/animations/mage_spark.c src/animations/archer_drop.c src/animations/assassin_poof.c src/animations/crawlingdude_crawl.c src/animations/srwarthog_square.c src/animations/headlessninja_throw.c src/animations/bluetroll_wonder.c src/animations/enter_door.c src/animations/alt_chest_opening.c src/game_lore.c src/game_lore_alt.c src/palette.c
+helapordo_SOURCES = src/helapordo.c src/game_core.c src/game_utils.c src/game_curses.c src/rooms.c src/artifacts.c src/specials.c src/main.c src/sprites.c src/floors.c sprites4curses/s4c-animate/animate.c koliseo/src/koliseo.c src/animations/mummy_shuffle.c src/animations/ghost_spell.c src/animations/boar_scream.c src/animations/troll_club.c src/animations/goblin_shoot.c src/animations/zombie_walk.c src/animations/imp_fireball.c src/animations/werewolf_transform.c src/animations/knight_tapis.c src/animations/mage_spark.c src/animations/archer_drop.c src/animations/assassin_poof.c src/animations/crawlingdude_crawl.c src/animations/srwarthog_square.c src/animations/headlessninja_throw.c src/animations/bluetroll_wonder.c src/animations/enter_door.c src/animations/alt_chest_opening.c src/game_lore.c src/game_lore_alt.c src/palette.c
 
 # Linking rule
 LDADD = $(HELAPORDO_LDFLAGS)
@@ -194,7 +194,7 @@ cleanob:
 	@echo -e "\033[1;33mDone.\e[0m"
 
 # Default target (builds everything)
-all: ./anvil ./src/anvil__helapordo.c ./src/palette.c ./koliseo/src/koliseo.o ./sprites4curses/s4c-animate/animate.o $(TARGET)
+all: ./src/palette.c ./koliseo/src/koliseo.o ./sprites4curses/s4c-animate/animate.o $(TARGET)
 
 # Target to clean and rebuild
 rebuild: clean all
diff --git a/src/helapordo.h b/src/helapordo.h
index fa50d35..42e800a 100644
--- a/src/helapordo.h
+++ b/src/helapordo.h
@@ -52,7 +52,7 @@
 #include "game_curses.h"
 #include "sprites.h"
 #include "floors.h"
-#include "anvil__helapordo.h"
+//#include "anvil__helapordo.h"
 #include "game_lore.h"
 #include "game_lore_alt.h"

@jgabaut
Copy link
Owner Author

jgabaut commented Jan 1, 2024

Since reverting the included amboso to <1.8.x doesn't seem mantainable, I'd rather switch the default anvil implementation for the bootstrap to be invil. This would mean the build fails instead on any system not having cargo and the Rust build chain ready.

To do things properly ,the anvil__helapordo.h inclusion should be guarded by a configure macro.

@jgabaut
Copy link
Owner Author

jgabaut commented Jan 3, 2024

Version 1.3.6 adds --enable-anvilpick to turn on interactive selection of anvil implementation.

@jgabaut
Copy link
Owner Author

jgabaut commented Jan 6, 2024

Version 1.4.0 changes default anvil implementation to be invil on macOS. This means by default you also need the Rust buildchain on your machine to build, but it's not like amboso was gonna save the day without:

  • Updating your awk to a modern version
  • Updating your bash (maybe should go before awk)

You can use --enable-anvilpick to have the interactive selection. When doing so, default for empty pick is now invil for all platforms.

@jgabaut
Copy link
Owner Author

jgabaut commented Feb 22, 2024

Version 1.4.3 (see PR) updates README.md to show that the requirement for amboso is actually gawk.

jgabaut added a commit that referenced this issue Mar 25, 2024
…'t use KLS_Region (#78)

### Added

- Print run seed when exiting from `retry()`

- **Experimental**: these features are only available when running with
`-X` flag.
- Experimental features are bound to change soon. Don't expect full
backwards-compatibility when using them.
  - Icon indicators for when you have an equipped item
- The emojis can be turned off by passing `--enable-emoji=no` to
`./configure` when building.
    - Updates should be noted on #77.
  - **Save/Load using binary files**
- Tailored to `Rogue` gamemode, whereas before save was not working in
that mode
    - Added all `packed` `SerXYZ` structures for saving/loading
    - Added `ser_XYZ/deser_XYZ()` functions for conversion
    - Updates should be noted on #66 

### Changed

- Add `--enable-anvil` configure option to allow easy building without
`anvil`
- Should improve #52 considerably. Switching the default value for the
enable flag could be considered.
- Bump `koliseo` to `0.4.1`
- Use `kls_conf_init()` to prep the used `Koliseo`s
  - **Now, only the debug build uses `KLS_Region`.**
- **This should make the release version avoid all that extra jazz on
the arena.**
- Added `seed` field to `Path`.
- Updated `installer` to `0.1.2`
- Now creates `hlpd-1`, `hlpd-2`, `hlpd-3` directories, used for
`Saveslot` handling.
- Added `FLOORMENU_SAVE` to `saveType`.
- Updated `const.c` test
- Bump `amboso` to `2.0.5`
- Should improve #52 by using a more recent `bash` on `macOS`, if the
shell setup was done

### Fixes

- Use `strlen()` for `whoami` push
@jgabaut
Copy link
Owner Author

jgabaut commented Mar 25, 2024

Version 1.4.4 adds --enable-anvil to ./configure so that a build can be done without needing anvil header at all.

@jgabaut jgabaut removed the help wanted Extra attention is needed label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant