Closed magnus-ISU closed 2 years ago
Sorry that it's been so difficult. Yeah, upstream Go changed how go get
works over the last year or three, introducing their modules concept.
You're almost there. You don't need clang-9
if you say wuffs test -ccompilers=gcc
. You weren't to know this, but in hindsight, wuffs test -help
would have told you the default value of the -ccompilers
flag.
Another thing is that you're presumably trying to run Wuffs v0.2.0 (since it's talking about needing clang-format-5.0
), and that Wuffs version is over 2 years old now. Since then, (1) it no longer depends on clang-format-XXX
for any value of XXX
, and (2) is smarter about finding the Wuffs checkout directory (the "could not find Wuffs root directory" error), which probably would have saved you a bunch of strace
ing.
I haven't tried it myself, but I'm guessing that if you start again, but with go install pkg@version
, using latest
instead of v0.2.0
, then you'd have a better time.
go install github.com/google/wuffs@latest
also installs v0.2.0
(into pkg/mod/github.com/google/wuffs@0.2.0
rather than src/thing
though I assume newer versions of wuffs would use the pkg
path maybe if I could figure out how to get one). I guess I'm not seeing what I should be doing differently.
Ah, latest
"selects the highest available release version" (emphasis added), and "v0.3.0-beta.12" names a pre-release version.
Perhaps try go install github.com/googld/wuffs@v0.3.0-beta.12
? I'm still just guessing, though. I haven't had much experience with Go modules, and I'm travelling at the moment so can't try things myself easily.
We need to rewrite go
in wuffs
:
╭─mag@magnus in ~/.local/share/go took 2s
[🔴] × go install github.com/google/wuffs@v0.3.0-beta.12
go: downloading github.com/google/wuffs v0.3.0-beta.12
go install: github.com/google/wuffs@v0.3.0-beta.12: create zip: test/data/non-ascii/😻.txt: malformed file path "test/data/non-ascii/😻.txt": invalid char '😻'
Is there a way I can just build wuffs from the git repository? I'm confused how I'm the first person to have this issue at this point
If you manage to get v0.3.0-beta.12 going, and want to dig into the "could not find Wuffs root directory" error, https://github.com/google/wuffs/blob/v0.3.0-beta.12/lang/wuffsroot/wuffsroot.go is the version 0.3 logic.
Is there a way I can just build wuffs from the git repository?
Try this? (Again, just guessing.)
cd ~/.local/share/go/src/github.com/google/wuffs # or cd your/local/checkout
go install -v github.com/google/wuffs/cmd/...
I'm confused how I'm the first person to have this issue at this point
Yeah, that's weird, hey.
Okay, that worked finally. I still had to symlink clang-9
to clang
but it doesn't seem to matter if clang-9
or clang 13.0.0
is used, and all the tests pass.
I still really think that proper installation instructions should be added to the Getting Started
guide, since otherwise its unlikely that many new people will get started with Wuffs.
As far as I can tell, these are:
# Because we can't install it with `go install`
mkdir -p ${GOPATH:-~/go}/pkg/mod/github.com/google && cd ${GOPATH:-~/go}/pkg/mod/github.com/google
rm -rf wuffs && git clone git@github.com:google/wuffs.git
cd wuffs
go install -v github.com/google/wuffs/cmd/...
cd ${GOPATH:-~/go}/
ln -s pkg/mod src
It seems like this should be easier, but I don't even think its a huge problem being hacky as long as the documentation is accurate about it. Also, I don't think hardcoding clang-9
as the binary name for clang
is a good idea. I would just do clang, gcc
. And probably more importantly since ccompilers
is supposed to be a list, I don't think it makes sense for the default behaviour to be to fatally error if the first entry doesn't exist.
in hindsight, wuffs test -help
wuffs --help
has nothing to indicate that the commands have their own --help
s. (I suppose I could have guessed to try that because wuffs --help
has almost nothing at all but indicates that there are potential arguments, but I don't think I should have to guess about how a program works after reading --help
)
Thanks for getting back to me quickly, hopefully I can write a .qoi
parser with this now.
Thanks for getting back to me quickly, hopefully I can write a .qoi parser with this now.
I filed #63 to talk specifically about QOI.
I cannot even figure out how to have
wuffs test
work.Getting Started tells you to run
go get -v github.com/google/wuffs/cmd/...
. This gives the following deprecation notice:This still installs binaries into
$GOPATH/bin
though, so now I runwuffs test
and I getI do some research and run
strace wuffs test
and find out its looking for some files in~/.local/share/go/src/github.com/google/wuffs
so I manually create~/.local/share/go/src/github.com/google
andgit clone https://github.com/google/wuffs
into there, hoping this will work. Now we getI'm on Arch, so I can't install
clang-format
v5 from 2017, so I pretend that this isn't a problem and create a link:Unsurprisingly, this doesn't work.
Then this somehow happens which I cannot reproduce:
So apparently it depends on both
clang-format-5.0
andclang-9
existing in myPATH
. And anyway whatever motivation I had to write Wuffs code is now overshadowed by my frustration.This language seems really cool and I want to try to learn it. I don't know if I'm just using a different target system than the only supported one or something, or if I just don't understand enough about
go
programming and there's one magicgo install something@magic_version_thing?
command that's analogous to the oldgo get
that I should just automatically know, or if I'm just dumb, but somehow I'm unable to get wuffs working at the moment and I think the documentation should be updated with a newer, correct way to get this working.