Skip to content

Conversation

@beekarthik
Copy link

Ran into a bug that blocked us from building pkls from outside the workspace they are defined in.

There was a slight bug where the pkl-cli binary expects the /work directory to be created by one of the symlinks but in the case of a pkl that is defined completely externally nothing lives under the current workspace so none of the symlinks ever create the work directory and then the pkl-cli binary looks for the import in the wrong place

Copy link
Contributor

@KushalP KushalP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

Let's remove the comment in the script, as the commit message will contain this context on merge.

More importantly, please can you add a test reproduction of this to tests/integration_tests/example_workspaces so we can catch any regressions.

Comment on lines +69 to +71
# The ruleset currently assumes the {label}/work directory exists due to creation of the symlinks
# However when running a `pkl_eval` frome external to the workspsace, the symlinks exist external
# to the {label}/work directory and it is not created, causing the command below to have issues.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# The ruleset currently assumes the {label}/work directory exists due to creation of the symlinks
# However when running a `pkl_eval` frome external to the workspsace, the symlinks exist external
# to the {label}/work directory and it is not created, causing the command below to have issues.

sitaktif added a commit to sitaktif/rules_pkl that referenced this pull request Sep 22, 2025
* feat(pkl project package): Create pkl project package rule (apple#86)

* add pkl project package rule

* add copyright notice to tortoise.pkl, tidy up defs.bzl

* add pkl package to defs.bzl

* gitignore formatting

* minor formatting of pklproject and deps.json files

* update .bazelrc and .bazelignore for integration tests

* update repo rule to use pkl executable

* update pkl executable failure message in repo rule

* update os name and architecture in pkl project repo rule

* update os name and architecture in pkl project repo rule

* update os name and architecture in pkl project repo rule

* partial address of PR comments

* continue addressing PR comments - remove run shell, add doc for pkl package

* run docs updater

* address remaining pr comments

* add docstring to pkl_project repo rule

make package optional: Co-authored-by: Steve Barrau <[email protected]>

remove package from simple/PklProject integration test

correct formatting

remove refs to workspace in pkl_project

add pkl project package rule

gitignore formatting

partial address of PR comments

correct defs.bzl

update simple example test pklproject

small formatting change

* begin addressing PR comments

* fix(pkl_project): include src files in packaged pkl project

* feat(pkl_project): add strip_prefix attribute

* fix(pkl_project): include src files in packaged pkl project

* feat(pkl_project): add strip_prefix attribute

* add test to pkl package with srcs included

* update docs

* add another test as per PR comments

* fix path ref

* Apply suggestions from code review

* fix CI failure

* update docs

---------

Co-authored-by: Romain Chossart <[email protected]>
Co-authored-by: Philip K.F. Hölzenspies <[email protected]>
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