Guidance for automated coding agents (and humans) working in this repository.
LibreDWG is a GNU project (GPLv3+). Please follow the existing project
conventions in README, CONTRIBUTING, and HACKING.
- Keep changes minimal and targeted.
- Prefer fixes that address root cause and add/adjust tests when feasible.
- Avoid reformatting or mechanical churn unless explicitly requested.
- C library and tools to read/write DWG.
- Primary build system: GNU Autotools (
autogen.sh,configure,make). - CMake also exists (
CMakeLists.txt) but Autotools is the canonical path.
Convenient build dirs are
.build-asanto check OOB and leak errors. It is very slow though..build-tccto check any logical errors. It is very fast.
- Prefer
make checkfor validating changes. - When adding features/bugfixes, include or update testcases when reasonable.
- If adequate test coverage is not possible, document why in the PR/commit message
(mirrors
CONTRIBUTING). - ODA roundtrips are checked with
../json-check dwgfileand../dxf-check dwgfileODAFileConverter Command Line Format is:- Quoted Input Folder
- Quoted Output Folder (must be different)
- Output_version {"ACAD9","ACAD10","ACAD12","ACAD13","ACAD14","ACAD2000","ACAD2004","ACAD2007","ACAD2010","ACAD2013","ACAD2018"}
- Output File type {"DWG","DXF","DXB"}
- Recurse Input Folder {"0","1"}
- Audit each file {"0","1"} [optional] Input files filter (default: ".DWG;.DXF") We set the first arg to the path of the input file, the second arg to some other path, Recurse to 0, Audit to 1 and the input file to the basename.
Best is to use and fix just dxf-check. json roundtrips are only helpful for <=r2000 files.
With dxf-check the original read is .log
The encoder log is .dxf.log
The resulting encoded file read is .log.new
You only need to read these logs, not stdout.
All the shell helpers, like log or dxf-check do not write to stdout, inspect the log files instead.
With dxf-check changed sources are automatically rebuilt, so no need call make.
- The project formats C sources with
clang-format. - Use the repository helper script (see
HACKING):
build-aux/clang-format.sh changed-fileDo not run formatting across unrelated files. If the formatting cannot
be fixed, e.g. in macros, surround the macro with // clang-format off and
// clang-format on markers. clang-format is not perfect.
Per CONTRIBUTING: do not include generated files in patches unless requested.
Instead, mention regeneration steps in the ChangeLog/commit message (e.g. "configure:
Regenerate.").
Common generated/derived artifacts include (non-exhaustive):
configure,Makefile.in,aclocal.m4,libtool,autom4te.cache/- build directories like
.build*
The repo contains a top-level ChangeLog, but day-to-day commits generally do not
edit it; release ChangeLogs are generated from commit logs (see HACKING).
When possible, write commit messages in GNU style:
- One-line summary
- Blank line
- Optional short discussion
- Per-file bullets for non-trivial changes
- Wrap the body at col 78
If referencing Savannah PRs, include text like PR #NNNN.
For Github issues reference it like GH #NNNN.
This package is owned by the FSF.
- Significant contributions (roughly > 15 lines of code or docs) may require FSF copyright assignment or an appropriate disclaimer.
- See
CONTRIBUTINGand the GNU guidance linked there.
- Before making write operations, inspect
git statusand avoid clobbering local uncommitted work. - Do not delete/clean untracked files (e.g.
.build*, local archives, patches) unless explicitly requested. - Prefer incremental edits over rewriting entire files.