fix(nle): sync top-level include/nleobs.h with src/include (ABI fix, missed by PR #5) - #6
Merged
Merged
Conversation
The nle_settings struct gained tune_n/tune_idx/tune_val (difficulty knobs) and datadir[256] (read-only datadir split) in src/include/nleobs.h, but the parallel top-level include/nleobs.h copy was never updated. External consumers that include the top-level header (e.g. PufferLib's ocean/nethack binding via -I vendor/nle/include) compiled against the shorter, misaligned struct while libnethack.so was built from src/include — an ABI mismatch that surfaced as a bogus 'DATADIR too long' error (the engine read datadir past the caller's struct). Keep the two copies byte-identical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #5 (merged at
1ff9e00). This one-commit fix (405d4ad) was pushed to the PR branch after #5 was merged, so it never landed inmain.Problem
The fork ships two copies of
nleobs.h:src/include/nleobs.h— cmake buildslibnethack.sofrom this (hastune_n/tune_idx/tune_val+datadir[256]).include/nleobs.h— external consumers compile against this (e.g. PufferLib'socean/nethackvia-I vendor/nle/include).Earlier commits added the new
nle_settingsfields only tosrc/include/, leaving the top-level copy short and misaligned. A consumer built againstinclude/nleobs.hpasses a smaller struct thanlibnethack.soexpects → the engine readsdatadirpast the caller's struct → boguserror("DATADIR too long")atnle_start. (Reproduced building PufferLib against the engine.)Fix
Make the two headers byte-identical. Pure header sync, no logic change.
After merge, the harness submodule should be re-bumped to the new
mainto propagate it.