Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
241 stars 33 forks source link

(fatal) cannot read from file: "YSI\y_hooks" #442

Closed harry0498 closed 3 years ago

harry0498 commented 3 years ago

Hi,

I am using sampctl on Linux and struggling with the includes. I have installed your samp-Hellfire package and set my entry to dependencies/samp-Hellfire/gamemodes/sffa.pwn in my pawn.json and while building it keeps failing to read the includes as they are case sensitive.

It failed with ctime.inc and Balloon.inc because sffa.pwn was including CTime and balloon.

Build Flags:

"args": [
    "-;+",
    "-(+",
    "-d3",
    "-Z+"
]           ]

I have also tried downloading and building with the sampctl --platform=linux flag.

After renaming the .inc files it fixed the CTime and balloon errors, but now i'm having issues with YSI. It's also a pain to keep renaming the dependencies .inc files. Is there a fix for this? A flag maybe?

ADRFranklin commented 3 years ago

You should not be renaming includes at all, they are completely managed by sampctl, everything should already be included with the package, you simply need to do sampctl p ensure to download the dependencies before building it with sampctl p build and finally doing sampctl p run to run it.

harry0498 commented 3 years ago

You should not be renaming includes at all, they are completely managed by sampctl, everything should already be included with the package, you simply need to do sampctl p ensure to download the dependencies before building it with sampctl p build and finally doing sampctl p run to run it.

I tried to do sampctl p ensure then sampctl p build without changing any of the files but I get this error:

dependencies/samp-Hellfire/gamemodes/sffa.pwn:29 (fatal) cannot read from file: "CTime"
Build encountered fatal error

heres whats at sffa.pwn:29

...
#include <CTime>                    // By RyDeR:                http://forum.sa-mp.com/showthread.php?t=294054
...

My thinking is that WIndows would be able to find CTime because its not case-sensitive with file naming, but Linux is case-sensitive. Is there a way to tell sampctl to ignore case?

ADRFranklin commented 3 years ago

case doesn't matter at all, we already handle that. This repo has already been tested on different platforms, so we know it works fine. Your issue is something else related to what you've done.

ADRFranklin commented 3 years ago

Wait hold on a second, what the hell are you doing??? dependencies/samp-Hellfire/gamemodes/sffa.pwn

why are you inside the depedencies? are you adding hellfire as a dependency? that won't work at all

harry0498 commented 3 years ago

Here are the steps I've done, I don't think I've done anything wrong but maybe you might notice something:

  1. Make directory for samp mkdir mysampserver && cd mysampserver
  2. Initialise the project sampctl p init
? Preferred package format json
? Your Name - If you plan to release, must be your GitHub username. root
? Package Name - If you plan to release, must be the GitHub project name. mysampserver
? Package Type - Are you writing a gamemode or a reusable library? gamemode
? Add a .gitignore and .gitattributes files? No
? Add a README.md file? No
? Select your text editor vscode
? Add standard library dependency? Yes
? Scan for dependencies? Yes
? Initialise a git repository? No
? Add a .travis.yml for unit testing? No
? No .pwn or .inc files - enter name for new script test.pwn
  1. Install samp-Hellfire

sampctl p install Southclaws/samp-Hellfire

  1. edit pawn.json
{
    "user": "samp",
    "repo": "mysampserver",
    "entry": "dependencies/samp-Hellfire/gamemodes/sffa.pwn",
    "output": "gamemodes/sffa.amx",
    "dependencies": [
        "pawn-lang/pawn-stdlib",
        "sampctl/samp-stdlib",
        "Southclaws/samp-Hellfire"
    ],
    "local": true,
    "runtime": {
        ...
    },
    "builds": [
        {
            "name": "",
            "args": ["-;+", "-(+", "-d3", "-Z+"],
            "includes": [
                "./include"
            ],
            "compiler": {}
        }
    ]
}
  1. Download the dependencies

sampctl p ensure

  1. Build the package

sampctl p build

Then I get the CTime error:

/home/<user>/mysampserver/dependencies/samp-Hellfire/gamemodes/sffa.pwn:29 (fatal) cannot read from file: "CTime"
Build encountered fatal error

The CTime.inc file is located at (downloaded as a dependency, I have not modified this file, or any other files unless listed in the above steps): /home/<user>/mysampserver/dependencies/pawn-ctime/ctime.inc

Southclaws commented 3 years ago

Just submit a PR to hellfire changing the case of the include.

harry0498 commented 3 years ago

Wait hold on a second, what the hell are you doing??? dependencies/samp-Hellfire/gamemodes/sffa.pwn

why are you inside the depedencies? are you adding hellfire as a dependency? that won't work at all

I have tried to clone the repo and build it from that, I get the same error.

Just submit a PR to hellfire changing the case of the include.

This isnt just an issue with samp-Hellfire, it happens with its dependencies too, also some other gamemodes ive tested.

Southclaws commented 3 years ago

This is just a mistake on the part of library/gamemode authors (like me) - nothing sampctl can do about it.

Windows is case insensitive, Linux is case sensitive.