buck-yeh / parsergen

Self-hosted parser/scanner generator from LR grammar with semantic annotations in C++20
MIT License
7 stars 0 forks source link

cannot find -lbracketPairing #8

Open yurivict opened 2 years ago

yurivict commented 2 years ago
[ 42% 21/38] : && /usr/local/bin/g++10 -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -fno-omit-frame-pointer  -Wl,-rpath=/usr/local/lib/gcc10 -isystem /usr/local/include -Wall -Wextra -Wshadow -Wconversion -Ofast -std=c++20 -Wno-shadow -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -fno-omit-frame-pointer  -Wl,-rpath=/usr/local/lib/gcc10 -isystem /usr/local/include -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -L/usr/local/lib/gcc10 ParserGen/CMakeFiles/grammarstrip.dir/GrammarStrip.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/BNFContext.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/Parser.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/ParseFile.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/ParserGenBase.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/Scanner.cpp.o -o ParserGen/grammarstrip -L/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/src   -L/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../CBrackets -Wl,-rpath,/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/src:/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../CBrackets  -lbracketPairing  -lbux  -lfmt  -lstdc++ && :
FAILED: ParserGen/grammarstrip 
: && /usr/local/bin/g++10 -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -fno-omit-frame-pointer  -Wl,-rpath=/usr/local/lib/gcc10 -isystem /usr/local/include -Wall -Wextra -Wshadow -Wconversion -Ofast -std=c++20 -Wno-shadow -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -fno-omit-frame-pointer  -Wl,-rpath=/usr/local/lib/gcc10 -isystem /usr/local/include -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -L/usr/local/lib/gcc10 ParserGen/CMakeFiles/grammarstrip.dir/GrammarStrip.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/BNFContext.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/Parser.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/ParseFile.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/ParserGenBase.cpp.o ParserGen/CMakeFiles/grammarstrip.dir/Scanner.cpp.o -o ParserGen/grammarstrip -L/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/src   -L/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../CBrackets -Wl,-rpath,/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/src:/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../CBrackets  -lbracketPairing  -lbux  -lfmt  -lstdc++ && :
/usr/local/bin/ld: cannot find -lbracketPairing
/usr/local/bin/ld: cannot find -lbux
collect2: error: ld returned 1 exit status
yurivict commented 2 years ago

CBrackets and bux projects are checked out but libraries there aren't built by cmake.

buck-yeh commented 2 years ago

Sorry to keep you waiting, 1.7.1 is out. The shell commands for from github in any of Linux distros are also changed:

   git clone https://github.com/buck-yeh/parsergen.git
   cd parsergen
   cmake -D FETCH_DEPENDEES=1 -D DEPENDEE_ROOT=_deps .
   make -j
   PSGEN_DIR="/full/path/to/current/dir"

Please let me know if the change works for you.

yurivict commented 2 years ago

cmake -D FETCH_DEPENDEES=1

For the purpose of package builder fetch during configure doesn't work, because configure and build aren't allowed to fetch anything for security reasons.

This is why there are git modules, that can be pre-fetched in a uniform way.

Custom fetch during configure just can't add any value that git modules don't have.

yurivict commented 2 years ago

Also local headers should be included with quotes, not angle brackets.

buck-yeh commented 2 years ago

Which #include <...> do you refer to? I don't quite follow.

yurivict commented 2 years ago

#include <bux/...>

buck-yeh commented 2 years ago

I use FetchContent for my own purposes. As author of all related projects, I put all cloned projects under the same parent folder. This way I can experiment changes between projects without even commit them. The working mode requires no ftech, and submodule too. Submodule forces the dependent repos reside under the root working folder as subfolders (of any depth though). It just dons't apply.

buck-yeh commented 2 years ago

#include <bux/...>

To any project other than bux, parsergen or not, bux/*.h isn't local header.

buck-yeh commented 2 years ago

For the purpose of package builder fetch during configure doesn't work, ...

That is not true, I do use FetchContent to pack ArchLinux AUR package

yurivict commented 2 years ago

That is not true, I do use FetchContent to pack ArchLinux AUR package

Arch allows fetch, this is why it isn't a safe distro. Virtually all major port systems don't allow fetch for security reasons: fetch doesn't guarantee that downloaded files will be exactly same every time.

buck-yeh commented 2 years ago

Virtually all major port systems don't allow fetch for security reasons: fetch doesn't guarantee that downloaded files will be exactly same every time.

That is new to me! So even if I restrict myself to only fetch from github with specific tag, is it still not guaranteed to have the same code ?

yurivict commented 2 years ago

That is new to me! So even if I restrict myself to only fetch from github with specific tag, is it still not guaranteed to have the same code ?

The Git protocol itself doesn't guarantee that it would always return the same code even if the same tag is requested. If Git server is compromised hackers can return different code.

For this reason all required files are downloaded by the package builder before the build. Their cryptographic fingerprints are compared against the stored fingerprints, and then build runs without network access.

It works this way for RPMs (like in Redhat/Fedora), in Ubuntu, in FreeBSD, in OpenBSD, etc. Arch Linux is an exception, this is why it isn't a secure packaging system.