sschwarzer
2021-8-19 20:30:30

I’m working on racket/src/rktio/rktio_fs.c, but it seems the file isn’t processed when I run make at the repo top-level. (To check this, I edited in an error, which wasn’t found/shown when running make.) Do you have any idea what to do so that my changes to rktio_fs.c are used?


samth
2021-8-19 20:34:35

I just tried inserting { at the beginning of that file, and then running top-level make and it failed for me


sschwarzer
2021-8-19 20:50:17

Interesting. Here it doesn’t, but I get an Exception: attempt to reference unbound identifier file-or-directory-stat at line 381, char 4 of primitive/kernel.ss (with or without the {).

I had assumed that the compilation of rktio_fs.c would come before the processing of <http://kernel.ss\|kernel.ss> because the Racket function defined in <http://kernel.ss\|kernel.ss> depends on the new function in rktio_fs.c. But it could be that the build doesn’t rely on that order.

So maybe we should try to fix the <http://kernel.ss\|kernel.ss> issue first. :slightly_smiling_face:

As an experiment, I commented out the line in <http://kernel.ss\|kernel.ss> and indeed rktio_fs.c is processed. I’ll let make finish and if it does without error, I’ll re-add the line in <http://kernel.ss\|kernel.ss>. But maybe I’m still missing some magic to get my C function rktio_stat in rktio_fs.c known or the definition of file-or-directory-stat in racket/src/io/file/main.rkt to be picked up.


sschwarzer
2021-8-19 20:53:44

I have typedef struct rktio_stat_t { /* TODO: Currently limited for testing */ intptr_t dev, inode, size; } rktio_stat_t; RKTIO_EXTERN rktio_stat_t *rktio_stat(rktio_t *rktio, rktio_const_string_t path, rktio_bool_t follow_links); in racket/src/rktio/rktio.h and the function rktio_stat is defined in rktio_fs.c. So I think so far this is ok. But again, maybe there’s something else missing.


shu--hung
2021-8-20 02:23:50

Does running make rktio in the cs directory help?


shu--hung
2021-8-20 02:25:27

There is some explanation about dependency tracking in the README in the cs directory. If some file have already been built, I’m not sure if running make at the top-level will recompile them.


shu--hung
2021-8-20 02:26:29

I suppose deleting all compiled files should work though.