Skip to content

Commit

Permalink
wksp: clean up FD_WKSP_NO_LOCK_RECLAIM
Browse files Browse the repository at this point in the history
fd_wksp_admin.c assumes that FD_WKSP_NO_LOCK_RECLAIM is always
defined via compile flags.  The current Make config defines this
macro then project-wide.  This commit cleans up the integration
by adding a sane default if the flag is not defined.
  • Loading branch information
riptl authored and ripatel-fd committed Jan 3, 2024
1 parent 2e63b27 commit cc6df8a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/base.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BASEDIR?=build

SHELL:=bash
CPPFLAGS:=-isystem ./opt/include -DFD_LOG_UNCLEAN_EXIT=1 -DFD_HAS_BACKTRACE=0 -DPB_SYSTEM_HEADER="\"pb_firedancer.h\""
CPPFLAGS:=-isystem ./opt/include -DFD_LOG_UNCLEAN_EXIT=1 -DFD_HAS_BACKTRACE=0
CC:=gcc
CFLAGS:=-std=c17
CXX:=g++
Expand Down
13 changes: 8 additions & 5 deletions src/flamenco/nanopb/README.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
This directory contains a copy of the Nanopb library.

This library is copied exactly from commit `839156b`, and there are
no Firedancer specific modifications to the code. `pb_firedancer.h`
has a few Firedancer specific #defines, which are loaded into the
library by #define'ing the `PB_SYSTEM_HEADER` to it as part of our
build. You should not make local modifications to nanopb. instead
prefer to upstream changes, or make a local patch if needed.
no Firedancer specific modifications to the code. You should not make
local modifications to nanopb. Instead prefer to upstream changes, or
make a local patch if needed.

For licensing information, refer to NOTICE in the root of this repo.

nanopb_generator.py can be invoked like so:

cd src/flamenco/types
nanopb_generator.py -L "" fd_solana_block.proto
11 changes: 11 additions & 0 deletions src/flamenco/nanopb/pb_firedancer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#ifndef HEADER_fd_src_flamenco_nanopb_pb_firedancer_h
#define HEADER_fd_src_flamenco_nanopb_pb_firedancer_h

#ifdef PB_H_INCLUDED
#error "Only include pb_firedancer.h"
#endif

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
Expand All @@ -10,3 +17,7 @@
#define PB_BUFFER_ONLY
#define PB_FIELD_32BIT 1
#define PB_ENABLE_MALLOC 1

#include "pb.h"

#endif /* HEADER_fd_src_flamenco_nanopb_pb_firedancer_h */
7 changes: 4 additions & 3 deletions src/flamenco/types/fd_solana_block.pb.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.8-dev */

#ifndef PB_SOLANA_STORAGE_CONFIRMEDBLOCK_SRC_FLAMENCO_TYPES_FD_SOLANA_BLOCK_PB_H_INCLUDED
#define PB_SOLANA_STORAGE_CONFIRMEDBLOCK_SRC_FLAMENCO_TYPES_FD_SOLANA_BLOCK_PB_H_INCLUDED
#include "../nanopb/pb.h"
#ifndef PB_SOLANA_STORAGE_CONFIRMEDBLOCK_FD_SOLANA_BLOCK_PB_H_INCLUDED
#define PB_SOLANA_STORAGE_CONFIRMEDBLOCK_FD_SOLANA_BLOCK_PB_H_INCLUDED

#include "../nanopb/pb_firedancer.h"

#if PB_PROTO_HEADER_VERSION != 40
#error Regenerate this file with the current version of nanopb generator.
Expand Down
1 change: 1 addition & 0 deletions src/flamenco/types/fd_solana_block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ package solana.storage.ConfirmedBlock;

import "nanopb.proto";
option (nanopb_fileopt).package = "fd_solblock";
option (nanopb_fileopt).include = "../nanopb/pb_firedancer.h";

// Transaction related

Expand Down

0 comments on commit cc6df8a

Please sign in to comment.