Skip to content

Commit

Permalink
Upgrade to latest version of deemon
Browse files Browse the repository at this point in the history
An fix problems related to changes to `final member` semantics
  • Loading branch information
GrieferAtWork committed Mar 15, 2024
1 parent 3014332 commit fad55f6
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 79 deletions.
36 changes: 18 additions & 18 deletions kos/misc/libgen/checker/cparser.dee
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,43 @@ class CParser {
}

@@Current filename (can be overwritten via directives)
public final member filename: string;
public final varying member filename: string;

@@Set of warnings that are currently being ignored
private final member ignoredWarnings: {string...} = [];
private member ignoredWarnings: {string...} = [];

@@When true, always extend the buffer (never clear it)
private final member peeking: bool = false;
private member peeking: bool = false;

@@The currently loaded token
public final member tok: string = "";
public final varying member tok: string = "";

@@Start of the currently loaded token (for @lc)
public final member tokStart: int = 0;
public final varying member tokStart: int = 0;

@@Mapping of defined exception IDs to their resp. name
public final member exceptByCode: {int: string} = Dict();
public final varying member exceptByCode: {int: string} = Dict();

@@Mapping of defined exception names to their resp. ID
public final member exceptByName: {string: int} = Dict();
public final varying member exceptByName: {string: int} = Dict();

#define ParserBackup Tuple

private final member fp: File | none;
private final member buf: Bytes = none;
private final member bufPos: int = 0;
private final member bufLen: int = 0;
private member fp: File | none;
private member buf: Bytes = none;
private member bufPos: int = 0;
private member bufLen: int = 0;

@@Starting line of @buf (1-based)
private final member bufStartLine: int = 1;
private member bufStartLine: int = 1;
@@Starting column of @buf (1-based)
private final member bufStartCol: int = 1;
private member bufStartCol: int = 1;

@@Stack for `#pragma GCC diagnostic push`
private final member ignoredWarningsStack: {{string...}...} = [];
private member ignoredWarningsStack: {{string...}...} = [];

@@Override for where warnings should be printed at
private final member warnLocationOverride: {(string, int, int)...} = [];
private member warnLocationOverride: {(string, int, int)...} = [];

public final function pushWarnLocationOverride(loc: (string, int, int)) {
warnLocationOverride.append(loc);
Expand Down Expand Up @@ -426,9 +426,9 @@ again:
}

@@Recursion counter for "{...}" pairs within an active static-if block
private final member staticIfRecursion: int = 0;
private final member staticIfDepth: int = 0;
private final member staticIfAllowed: bool = true;
private member staticIfRecursion: int = 0;
private member staticIfDepth: int = 0;
private member staticIfAllowed: bool = true;

@@Advance to the next token
public final function next(): string {
Expand Down
16 changes: 8 additions & 8 deletions kos/misc/libgen/checker/ctype.dee
Original file line number Diff line number Diff line change
Expand Up @@ -2093,14 +2093,14 @@ class CSymbolTemplate: CTypeRefTemplate {
global CEnumClassType;
class CNamespace {
this = default;
public final member name: string;
public final member symbols: {string: CSymbol | CSymbolTemplate} | none = none;
public final member typedefs: {string: CTypeRef | CTypeRefTemplate} | none = none;
public final member namespaces: {string: CNamespace} | none = none;
public final member structSymbols: {string: CStructType} | none = none;
public final member unionSymbols: {string: CStructType} | none = none;
public final member enumSymbols: {string: CEnumType} | none = none;
public final member importedNamespaces: {CNamespace...} | none = none;
public final varying member name: string;
public final varying member symbols: {string: CSymbol | CSymbolTemplate} | none = none;
public final varying member typedefs: {string: CTypeRef | CTypeRefTemplate} | none = none;
public final varying member namespaces: {string: CNamespace} | none = none;
public final varying member structSymbols: {string: CStructType} | none = none;
public final varying member unionSymbols: {string: CStructType} | none = none;
public final varying member enumSymbols: {string: CEnumType} | none = none;
public final varying member importedNamespaces: {CNamespace...} | none = none;

@@Only here so we don't need special handling when used as a @CScope
public property symbolValues = { get() -> none; };
Expand Down
1 change: 0 additions & 1 deletion kos/misc/libgen/libkeymap/parser.dee
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ import * from .linker;
#include "../../../include/kos/keyboard.h"

global final knownKeyNames: {string: int} = {

"KEY_ESC" : KEY_ESC,
"KEY_1" : KEY_1,
"KEY_2" : KEY_2,
Expand Down
93 changes: 46 additions & 47 deletions kos/misc/libmagic/libmagic.dee
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function fileMayHaveChanged(filename: string) {


@@Selection for @Step.getRequiredFiles that refers to one file of many
class FirstFileOf {
final class FirstFileOf {
this = default;
public final member files: {string...};
}
Expand All @@ -278,30 +278,30 @@ class Step {
operator repr() -> name;

@@The name of this step (Only for logs; no syntactical meaning)
final member name: string;
final varying member name: string;

@@> run(step: BoundStep): {Waitable...}
@@Execute the step and produce waitables
final member run: Callable;
final varying member run: Callable;

@@> tostr(step: BoundStep): string
@@Return a suitable, human-readable description for what this step does
final member tostr: Callable = none;
final varying member tostr: Callable = none;

@@Set of group options used by this step
final member options: {string...} = none;
final varying member options: {string...} = none;

@@> split(step: BoundStep): {BoundStep...}
@@Split this step into multiple, smaller steps
final member split: Callable = none;
final varying member split: Callable = none;

@@> getRequiredFiles(step: BoundStep): {string | FirstFileOf...}
@@Returns a List of required files
final member getRequiredFiles: Callable = none; /* in */
final varying member getRequiredFiles: Callable = none; /* in */

@@> getProducedFiles(step: BoundStep): {string...}
@@Returns a List of produced files
final member getProducedFiles: Callable = none; /* out */
final varying member getProducedFiles: Callable = none; /* out */

@@> getProducedOutputFiles(step: BoundStep): {string...}
@@Returns the filenames of the primary output files, that is
Expand All @@ -311,7 +311,7 @@ class Step {
@@also be produced by this build step are considered secondary
@@build artifacts who's timestamp will be ignored, except when
@@explicitly used as dependencies of other steps.
final member getProducedOutputFiles: Callable = none; /* out */
final varying member getProducedOutputFiles: Callable = none; /* out */

@@> getModifiedOutputFiles(step: BoundStep): {string...}
@@Returns the names of output files that (may) be modified or
Expand All @@ -323,14 +323,14 @@ class Step {
@@ output file, that step is always executed first, allowing
@@ it to create the output file before steps that may modify
@@ it are then executed one by one.
final member getModifiedOutputFiles: Callable = none; /* in|out */
final varying member getModifiedOutputFiles: Callable = none; /* in|out */

@@> getMaybeModifiedOutputFiles(step: BoundStep): {string...}
@@Same as `getModifiedOutputFiles()', but the enumerated files may
@@not necessarily get modified when the step is run. - Instead of using
@@the timestamp of the file itself, use a different file `.<name>.latest'
@@to keep track of the timestamp when such a file was last updated.
final member getMaybeModifiedOutputFiles: Callable = none; /* in|out */
final varying member getMaybeModifiedOutputFiles: Callable = none; /* in|out */


final function withRequiredFiles(files: {string...}): Step {
Expand All @@ -350,26 +350,26 @@ class Step {

}

class Group {
final class Group {
this = default;

@@The name of this group (Only for logs; no syntactical meaning)
public final member name: string;
public final varying member name: string;

@@List of compilation steps, which are functions invoked
@@as Callable(group: Group, changed: bool): {Waitable...}
@@The given parameter `changed' is set to true for the first
@@step, as well as any step performed after a previous step
@@returned at least 1 Waitable Object
public final member steps: {Step...} = [];
public final varying member steps: {Step...} = [];

@@Group-specific options (for use by step callbacks)
public final member options: {string: Object} = Dict();
public final varying member options: {string: Object} = Dict();

@@The path in which this group is defined
public final member defPath: string = "";
public final varying member defPath: string = "";

public final function getDependencies(toolchain: Toolchain): {string | FirstFileOf...} {
public function getDependencies(toolchain: Toolchain): {string | FirstFileOf...} {
for (local s: steps) {
local bss = BoundStep(this, s, toolchain);
if (s.split !is none) {
Expand All @@ -382,7 +382,7 @@ class Group {
}
}

private member _wildcardEnumerationCache: {string: {string...}} = Dict();
private final member _wildcardEnumerationCache: {string: {string...}} = Dict();

function fixFilename(filename: string): string {
if (filename.startswith("/"))
Expand Down Expand Up @@ -498,35 +498,35 @@ class Configuration {


@@Build configuration controller
class Config {
final class Config {
this = default;

@@The prefix that should be used by a cross-compiler (needs
@@to be used in conjunction with the implementing toolchain)
public final member CROSS_PREFIX: string = "";
public final varying member CROSS_PREFIX: string = "";

@@Set to the location of where build artifacts should be placed
public final member BUILD_PATH: string = "build";
public final varying member BUILD_PATH: string = "build";

@@The default file extension for produced libraries
#ifdef __WINDOWS__
public final member LIBRARY_SUFFIX: string = ".dll";
public final varying member LIBRARY_SUFFIX: string = ".dll";
#else /* __WINDOWS__ */
public final member LIBRARY_SUFFIX: string = ".so";
public final varying member LIBRARY_SUFFIX: string = ".so";
#endif /* !__WINDOWS__ */

@@Set to true if a re-build of all steps should be forced
public final member FORCE: bool = false;
public final varying member FORCE: bool = false;

@@Set to true if error messages printed by build-tools
@@should be formatted into a singular, common format.
public final member FORMAT_ERRORS: bool = false;
public final varying member FORMAT_ERRORS: bool = false;

@@Enable verbose mode (print executed commands)
public final member VERBOSE: bool = false;
public final varying member VERBOSE: bool = false;

@@Extra hooks for configuration-specific compile/link overrides
public final member CONFIG: Configuration = none;
public final varying member CONFIG: Configuration = none;

@@Return the location of a some build artifact
final function getBuildArtifact(group: Group, srcFile: string, ext: string): string {
Expand Down Expand Up @@ -563,9 +563,8 @@ function tryJoinProcess(p: ipc.Process): bool {
return true;
}

class WaitableJoin: Waitable {

private member obj: ipc.Process | Thread | Object;
final class WaitableJoin: Waitable {
private final member obj: ipc.Process | Thread | Object;

this(obj) {
this.obj = obj;
Expand Down Expand Up @@ -593,19 +592,19 @@ class WaitableJoin: Waitable {
class Toolchain {
this = default;

member config: Config;
public final varying member config: Config;

@@Name of the toolchain (for logs; if @none, then it isn't used)
member name: string = none;
public final varying member name: string = none;

@@Storage for toolchain extension configurations (e.g. mtools)
member options: { string: Object } = Dict();
public final varying member options: { string: Object } = Dict();
}




class BoundStep {
final class BoundStep {
this = default;
operator str(): string {
if (step.tostr !is none)
Expand All @@ -623,16 +622,16 @@ class BoundStep {
}

@@The bound group
public final member group: Group;
public final varying member group: Group;

@@The bound step
public final member step: Step;
public final varying member step: Step;

@@The used toolchain
public final member toolchain: Toolchain;
public final varying member toolchain: Toolchain;

@@Step-specific data
public final member userData: Object;
public final varying member userData: Object;

@@List of required input files
public final property requiredFiles: {string | FirstFileOf...} = {
Expand Down Expand Up @@ -791,7 +790,7 @@ class BoundStep {
}

#ifdef CACHE_ALL_MODIFIED_OUTPUT_FILES
private final member _allModifiedOutputFiles: {(string, int | none)...};
private member _allModifiedOutputFiles: {(string, int | none)...};
public final property allModifiedOutputFiles: {(string, int | none)...} = {
get(): {(string, int | none)...} {
if (_allModifiedOutputFiles !is bound) {
Expand Down Expand Up @@ -910,22 +909,22 @@ class BoundStep {
}

@@Waitables that need to complete before this step can be finished
private final member _stepWaitables: {Waitable...};
private member _stepWaitables: {Waitable...};

@@Cache for @this.requiredFiles
private final member _requiredFiles: {string | FirstFileOf...};
private member _requiredFiles: {string | FirstFileOf...};

@@Cache for @this.producedFiles
private final member _producedFiles: {string...};
private member _producedFiles: {string...};

@@Cache for @this.producedOutputFiles
private final member _producedOutputFiles: {string...};
private member _producedOutputFiles: {string...};

@@Cache for @this.modifiedOutputFiles
private final member _modifiedOutputFiles: {(string, int | none)...};
private member _modifiedOutputFiles: {(string, int | none)...};

@@Cache for @this.maybeModifiedOutputFiles
private final member _maybeModifiedOutputFiles: {(string, int | none)...};
private member _maybeModifiedOutputFiles: {(string, int | none)...};

operator == (other) -> this === other;
operator != (other) -> this !== other;
Expand Down Expand Up @@ -1454,9 +1453,9 @@ again_search_fin_steps:


#if 0
class Timed {
final class Timed {
this = default;
public member name: string = "Unnamed";
public final member name: string = "Unnamed";
private member start;
operator enter() {
start = tick();
Expand Down
6 changes: 3 additions & 3 deletions kos/misc/magicemulator/_common.dee
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ function normalizeFilenameForLog(filename: string | Bytes): string {

class Addr2line {

private final member proc: ipc.Process;
private final member reader: File;
private final member writer: File;
private member proc: ipc.Process;
private member reader: File;
private member writer: File;

this(config: Config, hostFile: string) {
local addr2lineExe = config.CROSS_PREFIX + "addr2line";
Expand Down
4 changes: 2 additions & 2 deletions kos/misc/make_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

# Don't use the latest patch, but this very specific one that
# should be usable to drive the entirety of the KOS toolchain.
# v -- "Fix bad exception handler in `Mapping.popitem()`"
DEEMON_VERSION="4f35e172e321c9a16e99575eeda3e5726d5bd1a5"
# v -- "Change semantics of `final` members in user-classes"
DEEMON_VERSION="e4753f4df7825540c7908c730d2d9b8d130d619b"

MAKE_PARALLEL_COUNT="$(grep -c ^processor /proc/cpuinfo)"

Expand Down

0 comments on commit fad55f6

Please sign in to comment.