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

chore: fix CLI packaging snapshot relative directory #1713

Merged
merged 1 commit into from
Sep 11, 2017

Conversation

jviotti
Copy link
Contributor

@jviotti jviotti commented Aug 28, 2017

The current CLI releases are broken. Seems that pkg creates the
application snapshot based on the current working directory, so at the
moment, the snapshot gets created based on the root of the project,
rather than based on the dist/Etcher-cli-* directories, causing the
native add-ons to not be resolved correctly.

Fixes: #1706
Change-Type: patch
Signed-off-by: Juan Cruz Viotti jv@jviotti.com

The current CLI releases are broken. Seems that `pkg` creates the
application snapshot based on the current working directory, so at the
moment, the snapshot gets created based on the root of the project,
rather than based on the dist/Etcher-cli-* directories, causing the
native add-ons to not be resolved correctly.

Fixes: #1706
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@@ -107,7 +107,7 @@ TARGET_ARCH_ELECTRON_BUILDER = $(shell ./scripts/build/architecture-convert.sh -
PLATFORM_PKG = $(shell ./scripts/build/platform-convert.sh -r $(PLATFORM) -t pkg)
ENTRY_POINT_CLI = lib/cli/etcher.js
ETCHER_CLI_BINARY = $(APPLICATION_NAME_LOWERCASE)
ifeq ($(TARGET_PLATFORM),win32)
ifeq ($(PLATFORM),win32)
Copy link
Contributor

Choose a reason for hiding this comment

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

Haha, whoops! Good catch.

@@ -228,7 +228,7 @@ $(BUILD_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(PLATFORM)-$(
$(BUILD_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(PLATFORM)-$(TARGET_ARCH)-app \
| $(BUILD_DIRECTORY)
mkdir $@
$(NPX) pkg --output $@/$(ETCHER_CLI_BINARY) -t node6-$(PLATFORM_PKG)-$(TARGET_ARCH) $</$(ENTRY_POINT_CLI)
cd $< && ../../$(NPX) pkg --output ../../$@/$(ETCHER_CLI_BINARY) -t node6-$(PLATFORM_PKG)-$(TARGET_ARCH) $(ENTRY_POINT_CLI)
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks a little bit ugly - I wonder if it'd be less ugly to have a pkg-wrapper script, that could 'hide' this ugliness from the Makefile?
Would it be also worth adding an issue to the pkg repo, suggesting they add an additional command-line parameter, that would then make pkg 'natively' do what you want (without this wrapper script)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See vercel/pkg#231. I'll merge this so we can release (we're planning a release very soon), but hopefully pkg fixes the issue soon, and we can update this.

@jviotti jviotti merged commit 70edfa3 into master Sep 11, 2017
@jviotti jviotti deleted the fix-cli-builds-windows branch September 11, 2017 14:45
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.

"Could not locate the bindings" on Windows 10
2 participants