Page MenuHomeSoftware Heritage

Generated incorrect webpack-stats.json path
Closed, MigratedEdits Locked

Description

Description
While executing make run-django-webpack-devserver command to run Software Heritage, a server error appears at http://127.0.0.1:5004/ due to the incorrect generated path of webpack-stats.json.

Expected Behaviour
The correct path should locate the file at /home/priya/swh/swh-environment/swh-web/static/webpack-stats.json but the generated file is found at /home/priya/swh/static/webpack-stats.json. However, when the file is manually copied and pasted to the right location, it works fine.

Environment
Ubuntu 20.04 LTS

Event Timeline

priyapahwa triaged this task as Normal priority.Apr 21 2022, 4:07 PM
priyapahwa created this task.
priyapahwa created this object in space S1 Public.

I do not understand how the webpack-stats.json file ended up in the wrong location as it is configured to be outputted in the static directory where make is invoked, aka the root directory of swh-web (see configuration).

Could you share a way to reproduce the issue ?

Ways to reproduce:

  1. Clone the repository.
  2. Follow developer-setup guidelines.
  3. Makefile.local was not running somehow, so I renamed that as Makefile itself and then executed make commands.

I invoked the make run-django-webpack-devserver command from my root directory named swh.
Here is the snapshot of the directory structure.


The file is being generated in the swh/static location instead of finding out the subdirectory of static located inside swh-web. It might be due to the same directory name (swh), however, it should not be the case. Ideally, it works after placing it within the static folder of swh-environment.

Ways to reproduce:

Clone the repository.
Follow developer-setup guidelines.
Makefile.local was not running somehow, so I renamed that as Makefile itself and then executed make commands.

Ok, got it, you did not follow the developer setup guidelines correctly.

Based on what I see, you cloned the swh-web repository, renamed it to swh then cloned the swh-environment repository inside the swh-web one.
You should have:

  1. clone the swh-environment repository
  2. setup a swh virtualenv with project path targetting the swh-environment repository
  3. clone the swh packages inside the swh-environment folder using the ./bin/update script

The source code of swh-web will then be located in swh-environment/swh-web, executing make run-django-webpack-devserver from it will then work as expected.

anlambert claimed this task.