YSI-Includes icon indicating copy to clipboard operation
YSI-Includes copied to clipboard

cannot read from file: "YSI_Data\y_iterate" on linux

Open Mrucznik opened this issue 5 years ago • 10 comments

I get this error only when I build on linux (Ubuntu 16.04.6 LTS amd64) using Travis CI. On windows everything is ok.

Error: test.pwn:2 (fatal) cannot read from file: "YSI_Data\y_iterate"

Code:

#include <a_samp>
#include <YSI_Data\y_iterate>

main()
{
    printf("Hello");
}

For compiling I use sampctl and my pawn.json looks like this:

{
	"user": "Mrucznik",
	"repo": "Mrucznik-RP-2.5",
	"entry": "gamemodes/test.pwn",
	"output": "gamemodes/test.amx",
	"dependencies": [
		"sampctl/samp-stdlib:0.3.7-R2-2-1",
		"Open-GTO/sa-mp-fixes",
		"emmet-jones/New-SA-MP-callbacks",
		"YashasSamaga/I-ZCMD",
		"NexiusTailer/Nex-AC",
		"oscar-broman/strlib",
		"samp-incognito/samp-streamer-plugin:v2.9.4",
		"zeex/samp-plugin-crashdetect:v4.19.4",
		"maddinat0r/sscanf:v2.8.3",
		"maddinat0r/samp-log:v0.4",
		"maddinat0r/samp-discord-connector:v0.2.4",
		"pawn-lang/[email protected]"
	],
	"build": {
		"name": "",
		"args": [
			"-d3",
			"-;+",
			"-(+",
			"-Z-",
			"-i../include"
		]
	}
}

Mrucznik avatar Apr 25 '19 16:04 Mrucznik

Change to

#include <YSI-Data\y_iterate>

rsetiawan7 avatar Apr 27 '19 06:04 rsetiawan7

Then I get cannot read from file: "YSI-Data\y_iterate".

Mrucznik avatar Apr 27 '19 10:04 Mrucznik

It's weird. I got working on Windows, but not trying yet in Linux.

EDIT: I'm building on container Ubuntu i386 and it's working.

rsetiawan7 avatar Apr 27 '19 10:04 rsetiawan7

I created repository in which I reproduced this error: https://github.com/Mrucznik/samp-ysi-bug https://travis-ci.com/Mrucznik/samp-ysi-bug

Mrucznik avatar May 04 '19 13:05 Mrucznik

When I replace compiler flag -Z- to -Z+ it compiling without errors. But I need -Z-

Mrucznik avatar May 13 '19 18:05 Mrucznik

"pawn-lang/[email protected]"

So you're using YSI 4... But if I recall correctly the new include method wasn't enforced until YSI 5. You probably just need to change YSI_Data to YSI. I'm not positive and I'd check but I'm at work on my phone.

Crayder avatar May 14 '19 05:05 Crayder

4.x had those paths, they've actually been there a long time. It was only 5.x that started enforcing it. But if you fixed it already, great.

Y-Less avatar May 14 '19 12:05 Y-Less

@Mrucznik

Hey, sorry for pinging. But could you solve the problem? I need -Z- too.

kubeeek avatar Aug 11 '20 14:08 kubeeek

You can't use the old includes on Linux without compatibility mode. They were written before there was a Linux compiler, so were never designed to work on Linux. -Z+ will enable some settings to make Linux behave more like Windows - why exactly do you need -Z-?

Y-Less avatar Aug 11 '20 14:08 Y-Less

You can't use the old includes on Linux without compatibility mode. They were written before there was a Linux compiler, so were never designed to work on Linux. -Z+ will enable some settings to make Linux behave more like Windows - why exactly do you need -Z-?

I may be somewhat beginner to PAWN, but I had some issues with y_hooks and file includes (like only first file in the directory is included and not the rest) - I could not understand why though. But later on, I had checked the compiler page and If I understood correctly the docs page of the compiler, when the -Z+ flag is passed, the compiler creates include guard for each file. Since I had files with the same name but in different directories, -Z- appeared as magical solution to all my problems and they were gone suddenly. But I see the point. Thanks for the explanation. Guess I will mess with file namings and such in my project as alternative solution.

kubeeek avatar Aug 11 '20 15:08 kubeeek