Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build of sodium-compat.phar fails #158

Closed
bafta-benj opened this issue Jul 24, 2023 · 0 comments
Closed

Build of sodium-compat.phar fails #158

bafta-benj opened this issue Jul 24, 2023 · 0 comments

Comments

@bafta-benj
Copy link

bafta-benj commented Jul 24, 2023

Trying to run build-phar.sh on Amazon linux 2 fails thus...

...
Writing lock file
Installing dependencies from lock file
Package operations: 1 install, 0 updates, 0 removals
  - Installing paragonie/random_compat (v9.99.100): Extracting archive
9 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
pwd
/home/user/sodium_compat/dist/worktree
if [ ! -d dist ]; then mkdir dist; fi
if [ ! -f dist/box.json ]; then cp ../dist/box.json dist/box.json; fi
cp: cannot stat ‘../dist/box.json’: No such file or directory
make[1]: *** [sodium-compat.phar] Error 1

Note: the pwd in the above is my debug.
As far as I can see there is a bug in dist/Makefile
When it is in the directory sodium_compat/dist/worktree it tries to copy ../dist/box.json which will resolve to sodium_compat/dist/dist/box.json which is clearly wrong

Here is the patch I used to fix it...

diff --git a/dist/Makefile b/dist/Makefile
index 1678e12..64a1e11 100644
--- a/dist/Makefile
+++ b/dist/Makefile
@@ -31,7 +31,7 @@ clean:
 
 sodium-compat.phar: dist/box.json composer.lock
        if [ ! -d dist ]; then mkdir dist; fi
-       if [ ! -f dist/box.json ]; then cp ../dist/box.json dist/box.json; fi
+       if [ ! -f dist/box.json ]; then cp ../box.json dist/box.json; fi
        cp dist/box.json .
        php -d phar.readonly=0 $(box) build -c box.json -v

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

No branches or pull requests

1 participant