Memoize sources_dir and package_dir