Skip to content

Make gdswrite work with libexpat pointed to in LD_LIBRARY_PATH - #450

Merged
mikesinouye merged 1 commit into
hdl:mainfrom
hzeller:feature-20260928-fix-gdswrite
Sep 28, 2026
Merged

mikesinouye merged 1 commit into
hdl:mainfrom
hzeller:feature-20260928-fix-gdswrite

Conversation

@hzeller

@hzeller hzeller commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

The klayout gdswrite uses libexpat.so.1, but if its location was provided via LD_LIBRARY_PATH, it was not found as bazel is blocking this environment variable by default.
So run this with use_default_shell_env = True.

Furthermore, the ctx.actions.run_shell is problematic, as it runs a shell using /bin/bash, which is not necessarily a location where the shell is on all systems (e.g. NixOS) So instead, assemble the arguments in structured
args, and use ctx.actions.run instead.

The klayout gdswrite uses libexpat.so.1, but if its location was
provided via `LD_LIBRARY_PATH`, it was not found as bazel is
blocking this environment variable by default.
So run this with `use_default_shell_env = True`.

Furthermore, the `ctx.actions.run_shell` is problematic, as it
runs a shell using `/bin/bash`, which is not necessarily a
location where the shell is on all systems (e.g. NixOS)
So instead, assemble the arguments in structured
args, and use `ctx.actions.run` instead.
@hzeller
hzeller requested a review from mikesinouye September 28, 2026 17:35
@hzeller

hzeller commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

This will make XLS tests using gdswrite work on NixOS

@mikesinouye
mikesinouye merged commit bbe26fb into hdl:main Sep 28, 2026
4 checks passed
@mikesinouye

Copy link
Copy Markdown
Collaborator

Thanks Henner, hope you've been well

copybara-service Bot pushed a commit to google/xls that referenced this pull request Sep 29, 2026
This incorporates hdl/bazel_rules_hdl#450
that makes it possible that gdswrite will work on NixOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants