allow building empty workspace with cmi and generate the environment files (based on #423)