Skip to content

Documentation: preload assets can't seem to be absolute paths? #99

@lal65

Description

@lal65

In the makefile around line 259 (develop branch) we see...

@ mkdir -p third_party/preload
ifdef PHP_BUILDER_DIR
  @ cp -prfL $(addprefix ${PHP_BUILDER_DIR},${PRELOAD_ASSETS}) third_party/preload/
else
  @ cp -prfL ${PRELOAD_ASSETS} third_party/preload/
endif

When running the build command and passing an absolute path, @ cp -prfL $(addprefix ${PHP_BUILDER_DIR},${PRELOAD_ASSETS}) third_party/preload/ seems to result in building an invalid path.

For example, in the .php-wasm-rc file...

# Space separated list of files/directories (ABSOLUTE paths)
# to be included under the /preload directory in the final build.
PRELOAD_ASSETS=/home/myuser/projects/php-wasm/app

will result in the cp operation expanding to...

cp -prfL /home/myuser/projects/php-wasm/home/myuser/projects/php-wasm/app third_party/preload/

-- which is obviously not intended, right?

I'm not sure whether this might be an oversight in the makefile or a documentation error. I was able to get the step passing by updating the makefile to...

@ mkdir -p third_party/preload
ifdef PHP_BUILDER_DIR
  @ cp -prfL $(addprefix ${PHP_BUILDER_DIR}/,${PRELOAD_ASSETS}) third_party/preload/
else
  @ cp -prfL ${PRELOAD_ASSETS} third_party/preload/
endif

(adding a trailing slash to the prefix).

Am I perhaps doing something wrong? The "out of the box" documentation doesn't seem to quite work against the develop branch. 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions