espressif / esp-idf-ci-action

GitHub Action for ESP32 CI
MIT License
67 stars 24 forks source link

Run command inside container before compilation #14

Closed nicklasfrahm closed 2 years ago

nicklasfrahm commented 2 years ago

Proposal

Add a pre-build hook, which allows it to run a script inside the container before the build.

Use-case

My use-case is that I submitted a fix to the ESP IDF, but that I need to wait for the fix to be merged. Until then I am basically blocked from using this CI action.

My patchfile looks as shown below and could be applied at the root of the esp-idf via patch -s -p0 < idfgh-6944.patch. I can however not figure out how to apply a patch to the esp-idf inside the container before running the compilation.

--- components/esp_http_client/esp_http_client.c    2022-03-17 08:40:29.726433947 +0000
+++ components/esp_http_client/esp_http_client.c.patch  2022-03-17 08:40:19.238269499 +0000
@@ -512,6 +512,10 @@
     client->process_again = 0;
     client->response->data_process = 0;
     client->first_line_prepared = false;
+    if (client->location != NULL) {
+            free(client->location);
+            client->location = NULL;
+    }
     http_parser_init(client->parser, HTTP_RESPONSE);
     if (client->connection_info.username) {
         char *auth_response = NULL;
kumekay commented 2 years ago

Hi @nicklasfrahm Will the solution proposed in https://github.com/espressif/esp-idf-ci-action/pull/15 work for you?

If we merge !15 then you can run it like cd $IDF_PATH && patch .. && cd /app && idf.py build

Or, in your particular case, you can temporarily add the patched version of the esp_http_client to your project's components directory.

nicklasfrahm commented 2 years ago

Hey @kumekay, thanks for implementing this. This does resolve my issue. I will close this.