CatarinaGamboa / liquidjava

32 stars 1 forks source link

Setup Issues Found in ./setup.sh file #34

Open royc0003 opened 5 days ago

royc0003 commented 5 days ago

These are issues pertaining to the onboarding experience of a new user for liquidjava

Issue 1: Git repo is no longer existent

https://github.com/pcanelas/jpf-backup.git

Will require further clarifications on this.

Issue 2: Script does not accommodate to other dirs.

Current Solution:

sudo mkdir /home/.jpf           # ATTENTION: /home/ might not be writeable. Could redirect to `/tmp`
sudo echo "
# JPF site configuration

jpf-core = $PWD/jpf-backup/jpf-core

jpf-nhandler = $PWD/jpf-backup/jpf-nhandler

jpf-symbc = $PWD/jpf-backup/jpf-symbc

extensions=\${jpf-core},\${jpf-nhandler},\${jpf-symbc}

# Automatic generated jpf site properties

" > /home/.jpf/site.properties # ATTENTION: abstract `/home` to global var to change directory.

Proposed Solution:

echo "Checking home directiory permissions"
dir_path="/home/.jpf"
home_path="/home"
tmp_path="/tmp"
# 1 -- success | 0 -- don't do anything | 2 --- change directory
function check_directory_permission {
    if mkdir -p "$dir_path" 2>/dev/null; then
        echo "Directory $dir_path created successfully."
        return 1
    else
        echo "Failed to create directory $dir_path. Check why..."
        if [ -w "$1" ]; then
            echo "$1 is writeable, but operation might be restricted by the filesystem"
            return 0
        else
            echo "$1 is not writable."
            return 2
        fi
    fi
}

check_directory_permission "$home_path"
# get the return output of check_directiory_perms function
status=$?

if [ $status -eq 2 ]; then
    echo "Changing $dir_path directory to /tmp/.jpf directory"
    dir_path="/tmp/.jpf"
    echo "***** Checking tmp directiory permissions *****"
    echo "Directory path changed successfuly: $dir_path"
    check_directory_permission "$tmp_path"
else
    echo "proceeding as per usual"
fi

sudo echo "
# JPF site configuration

jpf-core = $PWD/jpf-backup/jpf-core

jpf-nhandler = $PWD/jpf-backup/jpf-nhandler

jpf-symbc = $PWD/jpf-backup/jpf-symbc

extensions=\${jpf-core},\${jpf-nhandler},\${jpf-symbc}

# Automatic generated jpf site properties

" >"$dir_path"/site.properties # CHANGES: changed /home to $dir_path
royc0003 commented 5 days ago

In addition to this:

image
CatarinaGamboa commented 4 days ago

Everything related to JPF can probably be removed - JPF is java path finder (https://github.com/javapathfinder) and we might have used it once for comparison with liquidjava but we don't use it anymore.

For the build fail --- check if you have Java20, we might want to include that check in the setup.sh as well