Open Bug 1565476 Opened 6 years ago Updated 2 years ago

Non-graceful error during configure when rust is not present at all

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: glandium, Unassigned)

References

(Regression)

Details

(Keywords: regression)

0:23.46 checking for rustc... not found
 0:23.46 checking for cargo... not found
 0:23.46 Traceback (most recent call last):
 0:23.46   File "/builds/worker/mozilla-unified/configure.py", line 133, in <module>
 0:23.46     sys.exit(main(sys.argv))
 0:23.46   File "/builds/worker/mozilla-unified/configure.py", line 39, in main
 0:23.47     sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 497, in run
 0:23.47     func(*args)
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 541, in _value_for
 0:23.47     return self._value_for_depends(obj)
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/util.py", line 958, in method_call
 0:23.47     cache[args] = self.func(instance, *args)
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 550, in _value_for_depends
 0:23.47     value = obj.result()
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/util.py", line 958, in method_call
 0:23.47     cache[args] = self.func(instance, *args)
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 156, in result
 0:23.47     return self._func(*resolved_args)
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 1125, in wrapped
 0:23.47     return new_func(*args, **kwargs)
 0:23.47   File "/builds/worker/mozilla-unified/build/moz.configure/rust.configure", line 60, in unwrap
 0:23.47     (retcode, stdout, stderr) = get_cmd_output(prog, '+stable')
 0:23.47   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 1125, in wrapped
 0:23.48     return new_func(*args, **kwargs)
 0:23.48   File "/builds/worker/mozilla-unified/build/moz.configure/util.configure", line 46, in get_cmd_output
 0:23.48     log.debug('Executing: `%s`', quote(*args))
 0:23.48   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/shellutil.py", line 210, in quote
 0:23.48     return ' '.join(_quote(s) for s in strings)
 0:23.48   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/shellutil.py", line 210, in <genexpr>
 0:23.48     return ' '.join(_quote(s) for s in strings)
 0:23.48   File "/builds/worker/mozilla-unified/python/mozbuild/mozbuild/shellutil.py", line 198, in _quote
 0:23.48     return t("'%s'") % s.replace(t("'"), t("'\\''"))
 0:23.48 TypeError: cannot create 'NoneType' instances
 0:23.52 *** Fix above errors and then restart with\
 0:23.52                "./mach build"

This is a regression from bug 1536486.

The build script looking for rustc (rust language compiler) and cargo (rust language package manager) in /bin dir.
I logged in as root, runned the rustup installer command (https://rustup.rs/). It installed another rust instance into the /root/.cargo folder.
-- I think it's better to get a different instance for these cases without installing rust as a global package.
Then I simply made two symbolic links to root's rustc and cargo into /bin:
/bin/rustc -> /root/.cargo/bin/rustc
/bin/cargo -> /root/.cargo/bin/cargo

It solved it. With this scenario you can handle a stable rust instance while you are messing up with your regular user's rust instance.

Has Regression Range: --- → yes
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.