summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2024-01-18 20:06:10 -0300
committerGitHub <noreply@github.com>2024-01-18 16:06:10 -0700
commit7606ac4586b9ce976dcf7978a9fe3b7e58d1c727 (patch)
treee7e4f0901d7b2243f4a6057b15faa155924da1bb
parentef3e9edf8ad84b4f6761b53a400b4f77f767a060 (diff)
Setup venv on Jenkinsfile (#135)
* Add venv to Jenkinsfile * Add readme instructions to venv * z64compress warning * fix warnings
-rw-r--r--Jenkinsfile29
-rw-r--r--README.md16
-rw-r--r--src/code/m_lib.c4
-rw-r--r--src/code/m_npc.c2
-rw-r--r--tools/Makefile3
5 files changed, 42 insertions, 12 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 7b2bf40..fd7394a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -21,7 +21,10 @@ pipeline {
stage('Install Python dependencies') {
steps {
echo 'Installing Python dependencies'
- sh 'python3 -m pip install -r requirements.txt -U'
+ sh 'python3 -m venv .venv'
+ sh '''. .venv/bin/activate
+ python3 -m pip install -U -r requirements.txt
+ '''
}
}
stage('Copy ROM') {
@@ -32,7 +35,9 @@ pipeline {
}
stage('Setup') {
steps {
- sh 'bash -c "make WARNINGS_CHECK=1 -j setup 2> >(tee tools/warnings_count/warnings_setup_new.txt)"'
+ sh '''. .venv/bin/activate
+ bash -c "make WARNINGS_CHECK=1 -j setup 2> >(tee tools/warnings_count/warnings_setup_new.txt)"
+ '''
}
}
stage('Check setup warnings') {
@@ -42,7 +47,9 @@ pipeline {
}
stage('Lib') {
steps {
- sh 'bash -c "make WARNINGS_CHECK=1 -j lib 2> >(tee tools/warnings_count/warnings_lib_new.txt)"'
+ sh '''. .venv/bin/activate
+ bash -c "make WARNINGS_CHECK=1 -j lib 2> >(tee tools/warnings_count/warnings_lib_new.txt)"
+ '''
}
}
stage('Check Lib warnings') {
@@ -52,7 +59,9 @@ pipeline {
}
stage('Extract') {
steps {
- sh 'bash -c "make WARNINGS_CHECK=1 -j extract 2> >(tee tools/warnings_count/warnings_extract_new.txt)"'
+ sh '''. .venv/bin/activate
+ bash -c "make WARNINGS_CHECK=1 -j extract 2> >(tee tools/warnings_count/warnings_extract_new.txt)"
+ '''
}
}
stage('Check extraction warnings') {
@@ -62,7 +71,9 @@ pipeline {
}
stage('Build') {
steps {
- sh 'bash -c "make WARNINGS_CHECK=1 -j uncompressed 2> >(tee tools/warnings_count/warnings_uncompressed_new.txt)"'
+ sh '''. .venv/bin/activate
+ bash -c "make WARNINGS_CHECK=1 -j uncompressed 2> >(tee tools/warnings_count/warnings_uncompressed_new.txt)"
+ '''
}
}
stage('Check build uncompressed warnings') {
@@ -72,7 +83,9 @@ pipeline {
}
stage('Build compressed') {
steps {
- sh 'bash -c "make WARNINGS_CHECK=1 -j compressed 2> >(tee tools/warnings_count/warnings_compress_new.txt)"'
+ sh '''. .venv/bin/activate
+ bash -c "make WARNINGS_CHECK=1 -j compressed 2> >(tee tools/warnings_count/warnings_compress_new.txt)"
+ '''
}
}
stage('Check compress warnings') {
@@ -85,7 +98,9 @@ pipeline {
branch 'main'
}
steps {
- sh 'python3 ./tools/upload_frogress.py jp --apikey $FROGRESS_KEY'
+ sh '''. .venv/bin/activate
+ python3 ./tools/upload_frogress.py jp --apikey $FROGRESS_KEY
+ '''
}
}
}
diff --git a/README.md b/README.md
index 5fa007b..6a3119c 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,21 @@ sudo apt install make git build-essential clang binutils-mips-linux-gnu python3
The build process has a few python packages required that are located in `requirements.txt`.
-To install them simply run in a terminal:
+It is recommend to setup a virtual environment for python to localize all dependencies. To create a virtual environment:
+
+```bash
+python3 -m venv .venv
+```
+
+To start using the virtual environment on your current terminal run:
+
+```bash
+. .venv/bin/activate
+```
+
+Take in mind for each new terminal you'll need to **active** the Python virtual environment again. There's no need to create the virtual environment again.
+
+Now you can install the Python dependencies, to do so run:
```bash
python3 -m pip install -U -r requirements.txt
diff --git a/src/code/m_lib.c b/src/code/m_lib.c
index f39845d..6529fe3 100644
--- a/src/code/m_lib.c
+++ b/src/code/m_lib.c
@@ -595,7 +595,7 @@ void none_proc2(Actor* actor UNUSED, Game_Play* play UNUSED) {
void Cheap_gfx_display(Game_Play* play, Gfx* dl) {
//! FAKE
- if ((!(&play->state)) && (!(&play->state))) {}
+ if (1) {}
OPEN_DISPS(play->state.gfxCtx);
@@ -610,7 +610,7 @@ void Cheap_gfx_display(Game_Play* play, Gfx* dl) {
void Cheap_gfx_display_xlu(Game_Play* play, Gfx* dl) {
//! FAKE
- if ((!(&play->state)) && (!(&play->state))) {}
+ if (1) {}
OPEN_DISPS(play->state.gfxCtx);
diff --git a/src/code/m_npc.c b/src/code/m_npc.c
index d1308b5..b1e4347 100644
--- a/src/code/m_npc.c
+++ b/src/code/m_npc.c
@@ -408,7 +408,7 @@ void mNpc_SetAnimalLastTalk(Animal_c* animal) {
Anmmem_c* memory = NULL;
s32 memoryIdx;
- if ((&common_data.privateInfo->playerId != NULL) && (animal != NULL)) {
+ if (((uintptr_t)&common_data.privateInfo->playerId != NULL) && (animal != NULL)) {
priv = common_data.privateInfo;
memoryIdx = mNpc_GetAnimalMemoryIdx(&priv->playerId, animal->memories, ANIMAL_MEMORY_NUM);
diff --git a/tools/Makefile b/tools/Makefile
index 06be2b1..eb1002b 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -31,7 +31,8 @@ PIGMENT64 := $(PIGMENT64_DIR)/pigment64
all: $(IDO_5_3) $(IDO_7_1) $(PIGMENT64)
$(MAKE) -C fado
- $(MAKE) -C z64compress
+# Some gcc versions give a warning about the -flto flag with no parameters. So we override the CFLAGS as a workaround
+ $(MAKE) -C z64compress CFLAGS="-Os -flto=auto"
clean:
$(RM) -rf $(IDO_5_3_DIR) $(IDO_7_1_DIR)