How to create a directory structure in bazel

How to create a directory structure in bazel

I want to create the following structure in bazel.

I want to create the following structure in bazel.

   |_ file1
   |_ file2
   |_ dir2

Creating a specific structure doesn't seem trivial. I'm hoping there's a simple and reusable rule. Something like:

  name = "dir1",
  path = "dir1",

makedir( name = "dir2", path = "dir1/dir2", deps = [":dir1"], )

What I've tried:

  • I could create a macro with a python script, but want something cleaner.
  • I tried creating a genrule with mkdir -p path/to/directoy which didn't work


The use case is that I want to create a squashfs using bazel.

It's important to note that Bazel provides some packaging functions.

To create a squashfs, the command requires a directory structure populated with artifacts.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Linux Tutorial for Beginners | What is Linux | Intellipaat

🔥Intellipaat Linux Course: In this linux tutorial for beginners video you will learn what is linux, how to install li...

Linux Audio Survival kit. - Linux Audio Survival Kit

A brief guide to have success setting up the audio in Linux.

Kali Linux 2020.1 | The Best Linux Distro For Hacking

Advanced penetration testing and cybersecurity distro, Kali Linux has released this year's first version. Kali 2020.1 is out and in this video, we'll be having a detailed look at this exceptional distro that comes with state-of-the-art hacking and cyber forensics tools.