V: Proper way to update now?

Created on 27 Jun 2019  路  6Comments  路  Source: vlang/v

Hello,
Up until about 1.2.0 I was successfully using the following small script to update:

#!/bin/bash

git pull origin master
cc -w -o vc v.c 
./vc -o v .

and I had a symlink setup from the first day of release the other day:

sudo ln -s ~/code/v/compiler/v /usr/local/bin/v

unfortunately now my update script gives me the following error:

!!! +
!!! -
pass=2 fn=`utf32_to_str_no_malloc`
panic: utf8.v:287
Fn "tos" wrong arg #1. Expected "byte*" (s)  but got "byteptr"

I wiped out what I had and recloned the repo and followed the simple "make" steps yesterday which got me up to date, but that seems to only work once.

What is the proper way to go about doing a pull and updating? I seem to be missing something.

All 6 comments

hey

the best way is

git pull origin master
cd compiler/
make clean
make

Great, thank you. I appreciate it.

Well shoot. I just tried that and got this.

~/code/v(master*) 禄 ./update.sh     

remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 38 (delta 16), reused 26 (delta 14), pack-reused 0
Unpacking objects: 100% (38/38), done.
From https://github.com/vlang/v
 * branch            master     -> FETCH_HEAD
   5651ba5..dc161fb  master     -> origin/master
Updating 5651ba5..dc161fb
Fast-forward
 Changelog.md                 |  10 ++++++
 README.md                    |  10 ++++++
 base64/base64.v              |  69 +++++++++++++++++++++++++---------------
 base64/base64_test.v         |   9 ++++++
 builtin/builtin.v            |   7 ++--
 builtin/string.v             |  21 ++++++------
 builtin/utf8.v               | 244 ++-----------------------------------------------------------------------------------------------------------------------------------------
 compiler/fn.v                |  10 ------
 compiler/main.v              |   7 ++--
 compiler/parser.v            |  49 ++++++++++++++--------------
 compiler/table.v             |   2 +-
 examples/game_of_life/life.v |   2 +-
 examples/news_fetcher.v      |   2 +-
 examples/tetris/tetris.v     |   4 +--
 os/os.v                      |  21 +++++++++---
 os/os_mac.v                  |  49 ++++++++++++++--------------
 rand/rand.v                  |  10 ++----
 time/info.v                  |  17 ----------
 time/time.v                  | 307 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------
 time/time_lin.v              |  82 ++++-------------------------------------------
 time/time_mac.v              |  74 +++++++++++-------------------------------
 time/time_win.v              |  62 ++++++------------------------------
 time/util.v                  |  66 --------------------------------------
 23 files changed, 443 insertions(+), 691 deletions(-)
 create mode 100644 Changelog.md
 delete mode 100644 time/info.v
 delete mode 100644 time/util.v
rm -f v.c v
curl -Os https://raw.githubusercontent.com/vlang/vc/master/v.c
cc -std=gnu11 -w -o v v.c
./v -o v .
pass=2 fn=`ustring`

=========================
It looks like you are building V. It is being frequently updated every day.
If you didn't modify the compiler's code, most likely there was a change that
lead to this error.

Try to run `git pull && make clean && make`, that will most likely fix it.

If this doesn't help, re-install V from source or download a precompiled binary from
https://vlang.io.
=========================

panic: string.v:637
.global is only allowed in translated code
make: *** [Makefile:5: v] Error 1

I just tried it from scratch and it works.

git clone ...
cd v/compiler
make

From scratch doing "make" works just fine, but when I do :

git pull origin master
cd v/compiler
make

I get - make: Nothing to be done for 'all'.

It seems to be hit or miss with make clear followed by make after pulling. When I posted the above message it didn't work, but after you replied I ran it again, and it pulled and then did make clean and make again, this time it worked. Perhaps whatever I happened to have pulled that last time had an issue, but when I just did it again, it was no longer an issue?

make now calls make clean, so it should be fine now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radare picture radare  路  3Comments

markgraydev picture markgraydev  路  3Comments

XVilka picture XVilka  路  3Comments

lobotony picture lobotony  路  3Comments

taojy123 picture taojy123  路  3Comments