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

Symlink Modules Not Archived #74

Open
hybby opened this issue Jun 19, 2019 · 0 comments
Open

Symlink Modules Not Archived #74

hybby opened this issue Jun 19, 2019 · 0 comments

Comments

@hybby
Copy link

hybby commented Jun 19, 2019

Summary

Hello, I came cross an issue when moving to Speculate from an old build process.

Basically, we have a NodeJS project which makes use of file: dependencies.

After an npm install, those dependencies are present in node_modules as symlinks:

# ls -ld node_modules/bbcid-vertex-logger
lrwxrwxrwx 1 jenkins jenkins 48 Jun 19 15:47 node_modules/bbcid-vertex-logger -> ../../apigee-vertex/packages/bbcid-vertex-logger

However, the contents of files under that symlink never make it into the SOURCES/*.tar.gz file. Instead, only the symlink itself is copied into the archive:

# tar -tf SOURCES/bbcidv5-openam-apigee.tar.gz  | grep bbcid-vertex-logger
node_modules/bbcid-vertex-logger

Potential Solution?

I suspect that the archiving function of speculate is deciding not to follow the symlinks. I believe that instead, any links should be followed and the files pointed to should be archived (similar to the -h (--dereference) flag of the TAR utility.

Would this be possible by setting options.dereference to true in archiver.js? (docs). This could even be placed behind a flag like --follow-symlinks if it isn't the desired ordinary behaviour.

Workaround

Use rsync to copy out all the links first of all. I used this in my Makefile:

	rsync --archive --verbose --copy-links ./node_modules/ ./node_modules_no_symlinks/
	rm -r ./node_modules/
	mv ./node_modules_no_symlinks/ ./node_modules/
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