davidg238
03/26/2024, 6:02 AMdavid@MSI-7D43:~/workspaceToit$ git clone https://github.com/toitlang/pkg-cli.git
... etc ...
david@MSI-7D43:~/workspaceToit$ cd pkg-cli
david@MSI-7D43:~/workspaceToit/pkg-cli$ make all
mkdir -p build
# We need to set a build type, otherwise cmake won't run nicely on Windows.
# The build-type is otherwise unused.
cmake -B build -DCMAKE_BUILD_TYPE=Debug
TPKG: toit.pkg
Failing tests:
Skipped tests:
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/david/workspaceToit/pkg-cli/build
cmake --build build --target install-pkgs
gmake[1]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[2]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[3]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[4]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[4]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[4]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
/bin/sh: 1: toit.pkg: not found
gmake[4]: *** [tests/CMakeFiles/install-pkgs.dir/build.make:70: tests/CMakeFiles/install-pkgs] Error 127
gmake[4]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[3]: *** [CMakeFiles/Makefile2:99: tests/CMakeFiles/install-pkgs.dir/all] Error 2
gmake[3]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[2]: *** [CMakeFiles/Makefile2:106: tests/CMakeFiles/install-pkgs.dir/rule] Error 2
gmake[2]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[1]: *** [Makefile:134: install-pkgs] Error 2
gmake[1]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
make: *** [Makefile:12: install-pkgs] Error 2
david@MSI-7D43:~/workspaceToit/pkg-cli$
1) How to resolve the above errors ?
2) If no errors, does this create a named executable, that I can run with the args as defined ?
I don't understand the Usage comment in examples/main.toit, reading:
Usage:
examples/main.toit <command>floitsch
03/26/2024, 11:09 AMcli package is just a package like other packages. No need to run make.
There is a makefile because we use it for testing, but you shouldn't need to.floitsch
03/26/2024, 11:09 AMfloitsch
03/26/2024, 11:11 AMjag run -d host as well.floitsch
03/26/2024, 11:12 AMjag pkg install or toit.pkg) and then use it.floitsch
03/26/2024, 11:13 AMtoit.pkg to install packages (same as jag pkg).
- toit.run to run programs (same as jag -d host run)
- `toit.compile`: this is where things get interesting: toit.compile -o my-exe main.toit will compile main.toit into an executable.davidg238
03/26/2024, 4:16 PMdavid@MSI-7D43:~/workspaceToit/pkg-cli/examples$ jag run -d host main.toit device
calling 'emit'
Error: Missing subcommand.
Manage a particular device.
Use the '--device' option to specify a specific device. Otherwise, the
last used device is used.
... etc
worked as expected, whereas:
david@MSI-7D43:~/workspaceToit/pkg-cli/examples$ jag run -d host main.toit device --help
Run the specified .toit file on a Jaguar device as a new program. If the
device is already executing another program, that program is stopped before
the new program is started.
If you specify the device to be 'host' with the option '-d host', then the
... etc
the --help option was was being used by jag, not main.toitfloitsch
03/26/2024, 4:17 PMjag run probably uses the --help.davidg238
03/26/2024, 4:17 PMfloitsch
03/26/2024, 4:17 PMjag run -d host -- main.toit device --help.floitsch
03/26/2024, 4:18 PMdavidg238
03/26/2024, 4:20 PM-- after hostdavidg238
03/26/2024, 4:22 PM-- Generating done
-- Build files have been written to: /home/david/toit/build/host
make[1]: Leaving directory '/home/david/toit'
(cd build/host && ninja build_tools)
[5/494] Generating sdk/bin/toit.lsp
FAILED: sdk/bin/toit.lsp /home/david/toit/build/host/sdk/bin/toit.lsp
cd /home/david/toit/tools/toitlsp && /usr/bin/cmake -E env GODEBUG=netdns=go GOOS= GOARCH= go build -ldflags \ -X\ main.date=2024-03-26T16:02:22Z\ -X\ main.version=v2.0.0-alpha.143.4+32145fba -tags netgo\ osusergo -o /home/david/toit/build/host/sdk/bin/toit.lsp
No such file or directory
[6/494] Generating sdk/bin/toit.pkg
FAILED: sdk/bin/toit.pkg /home/david/toit/build/host/sdk/bin/toit.pkg
cd /home/david/toit/tools/tpkg && /usr/bin/cmake -E env GODEBUG=netdns=go GOOS= GOARCH= go build -ldflags \ -X\ main.date=2024-03-26T16:02:22Z\ -X\ main.version=v2.0.0-alpha.143.4+32145fba -tags netgo\ osusergo -o /home/david/toit/build/host/sdk/bin/toit.pkg
No such file or directory
[14/494] Building CXX object src/CMakeFiles/toit_core.dir/flash_registry_posix.cc.o
ninja: build stopped: subcommand failed.floitsch
03/26/2024, 4:23 PMfloitsch
03/26/2024, 4:23 PMfloitsch
03/26/2024, 4:24 PMfloitsch
03/26/2024, 4:25 PMcd that fails. The error message is different there.davidg238
03/26/2024, 4:26 PMdavid@MSI-7D43:~/toit$ cmake --version
cmake version 3.22.1
this is right ?floitsch
03/26/2024, 4:26 PMdavidg238
03/26/2024, 4:28 PM-- will get me far enough for now (just never had an issue building previously)davidg238
03/26/2024, 4:28 PMfloitsch
03/26/2024, 4:29 PMdavidg238
03/26/2024, 4:32 PMgo --verion says go is not found ... strangedavidg238
03/26/2024, 4:33 PMsudo apt install build-essential cmake ninja-build golangdavidg238
03/26/2024, 4:39 PMapt, looks like something is now wrong with my executable path, since go help fails ... thx for pointer