Error while tried to build defold engine

I’m using ubuntu 20.4 and trying to build engine for linux.
I have an error while ./scripts/build.py install_ext commands run.
The last lines looks like this

Downloading my/clang%2Bllvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
Traceback (most recent call last):
  File "./scripts/build.py", line 2142, in <module>
    f()
  File "./scripts/build.py", line 547, in install_ext
    self.install_sdk()
  File "./scripts/build.py", line 619, in install_sdk
    download_sdk(self, '%s/%s.tar.xz' % (self.package_path, PACKAGES_LINUX_TOOLCHAIN), join(sdkfolder, 'linux', PACKAGES_LINUX_CLANG), format='J')
  File "./scripts/build.py", line 237, in download_sdk
    path = conf.get_local_or_remote_file(url)
  File "./scripts/build.py", line 557, in get_local_or_remote_file
    path = self._download(path) # it should be an url
  File "./scripts/build.py", line 419, in _download
    path = http_cache.download(url, lambda count, total: self._log('Downloading %s %.2f%%' % (url, 100 * count / float(total))))
  File "/home/vbif/defold/build_tools/http_cache.py", line 68, in download
    response = urllib2.urlopen(req)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 421, in open
    protocol = req.get_type()
  File "/usr/lib/python2.7/urllib2.py", line 283, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: my/clang%2Bllvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
1 Like

Oh, that doesn’t look quite right. %2B is +

And it’s from here: https://github.com/defold/defold/blob/dev/scripts/build.py#L102

The error pretty much says it all, that the path “my/clang%2Bllvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz” is an invalid url.

Do you have the external packages in a folder locally?

You can read more about the “–package-path” here:

And the SDK package scripts are located under “./scripts/package/*”
Although I see now that we have no package script for clang.
You can download it from here:
http://releases.llvm.org/download.html

Ah, yes, how silly of me, it’s doing a download in which case %2B is totally fine. So I guess the OP has to get the packages properly set up first.

So, as far as i understand, i need to download this file and put it in some folder. I’m trying to put it in defold/packages but it not worked. I’m trying to search for that “my” folder (this string i passed to package-path), but cannot find them in repo.
In what folder i need put this file? Or I need to do something else?

I’m trying to search for that “my” folder (this string i passed to package-path), but cannot find them in repo.

That was the problem, that there was no such folder, and you passed it to package path.

Download the linux version of the package (“clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz”) and put it in the local folder (create this folder yourself): defold/local_sdks.

Then run the command:

$ ./scripts/build.py install_ext --platform=x86_64-linux --package-path=./local_sdks

Oh, that really simply. You may not believe me, but i read the instructions and probably didn’t understand that. Sorry.

1 Like

Oh, I’m aware that we need to cleanup our documentation to make it clearer. For instance the part about downloading clang isn’t there :slight_smile:

2 Likes