Skip to content

Commit

Permalink
Merge pull request #206 from wrapl/dev
Browse files Browse the repository at this point in the history
Updates.
  • Loading branch information
rajamukherji authored May 11, 2024
2 parents 2ae90d2 + 97d95d4 commit c2c5042
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ifeq ($(MACHINE), i686)
endif

ifeq ($(PLATFORM), Linux)
LDFLAGS += -Wl,--dynamic-list=src/exports.lst -ldl -lgc
LDFLAGS += -Wl,--dynamic-list=src/exports.lst -ldl -lgc -lunwind
objects += obj/targetwatch.o
endif

Expand Down
5 changes: 3 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rabs (2.30.7) UNRELEASED; urgency=medium
rabs (2.30.8) UNRELEASED; urgency=medium

* Updates.
* Updates.
Expand Down Expand Up @@ -58,5 +58,6 @@ rabs (2.30.7) UNRELEASED; urgency=medium
* Updates.
* Updates.
* Updates.
* Updates.

-- Raja Mukherji <raja@hinano> Mon, 15 Apr 2024 09:11:03 +0100
-- Raja Mukherji <raja@hinano> Sat, 11 May 2024 09:19:32 +0100
2 changes: 1 addition & 1 deletion minilang
Submodule minilang updated 128 files
25 changes: 25 additions & 0 deletions src/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <gc/gc.h>
#include <sys/stat.h>
#include <targetcache.h>
Expand Down Expand Up @@ -40,6 +43,17 @@ void cache_open(const char *RootPath) {
struct stat Stat[1];
if (stat(CacheFileName, Stat)) {
mkdir(CacheFileName, 0777);
int LockFile = open(concat(CacheFileName, "/lock", NULL), O_CREAT | O_WRONLY | O_TRUNC, 0600);
if (LockFile < 0) {
fprintf(stderr, "Failed to lock build database: %s", strerror(errno));
exit(-1);
}
struct flock Lock = {0,};
Lock.l_type = F_WRLCK;
if (fcntl(LockFile, F_SETLK, &Lock) < 0) {
fprintf(stderr, "Failed to lock build database: %s", strerror(errno));
exit(-1);
}
MetadataStore = string_store_create(concat(CacheFileName, "/metadata", NULL), 16, 0);
TargetsIndex = string_index0_create(concat(CacheFileName, "/targets", NULL), 32, 4096);
DetailsStore = fixed_store_create(concat(CacheFileName, "/details", NULL), sizeof(cache_details_t), 1024);
Expand All @@ -50,6 +64,17 @@ void cache_open(const char *RootPath) {
printf("Version error: database was built with an older version of Rabs. Delete %s to force a clean build.\n", CacheFileName);
exit(1);
} else {
int LockFile = open(concat(CacheFileName, "/lock", NULL), O_CREAT | O_WRONLY | O_TRUNC, 0600);
if (LockFile < 0) {
fprintf(stderr, "Failed to lock build database: %s", strerror(errno));
exit(-1);
}
struct flock Lock = {0,};
Lock.l_type = F_WRLCK;
if (fcntl(LockFile, F_SETLK, &Lock) < 0) {
fprintf(stderr, "Failed to lock build database: %s", strerror(errno));
exit(-1);
}
MetadataStore = string_store_open(concat(CacheFileName, "/metadata", NULL));
{
char Temp[16];
Expand Down
2 changes: 1 addition & 1 deletion src/rabs.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ int main(int Argc, char **Argv) {
SavedArgc = Argc;
SavedArgv = Argv;
GC_INIT();
ml_init(Globals);
ml_init(Argv[0], Globals);
ml_object_init(Globals);
ml_sequence_init(Globals);
ml_stream_init(Globals);
Expand Down
2 changes: 1 addition & 1 deletion src/rabs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern __thread target_t *CurrentTarget;
ml_value_t *rabs_global(const char *Name);
ml_value_t *rabs_ml_global(void *Data, const char *Name, const char *Source, int Line, int Mode);

#define CURRENT_VERSION 2, 30, 7
#define CURRENT_VERSION 2, 30, 8
#define MINIMAL_VERSION 2, 10, 0

#endif

0 comments on commit c2c5042

Please sign in to comment.