-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Synthesize .npmrc from Makefile; Fix bsdtar on older Debian/Ubuntu/macOS #15256
Changes from all commits
935bfe3
cfa1b63
780c8ab
bf4214d
e6174ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -14,7 +14,10 @@ else | |||||||
|
||||||||
# This is the "normal" part of the Makefile | ||||||||
|
||||||||
TAR := $(shell hash bsdtar > /dev/null 2>&1 && echo "bsdtar --no-xattrs" || echo "tar" ) | ||||||||
TAR := $(shell hash bsdtar > /dev/null 2>&1 && echo "bsdtar" || echo "tar" ) | ||||||||
ifneq ($(shell $(TAR) --version | grep "bsdtar 3"),) | ||||||||
TAR += --format=gnutar | ||||||||
endif | ||||||||
|
||||||||
DIST := dist | ||||||||
DIST_DIRS := $(DIST)/binaries $(DIST)/release | ||||||||
|
@@ -662,27 +665,29 @@ docs: | |||||||
fi | ||||||||
cd docs; make trans-copy clean build-offline; | ||||||||
|
||||||||
node_modules: package-lock.json | ||||||||
.npmrc: | ||||||||
echo "audit=false fund=false package-lock=true save-exact=true " | tr " " "\n" > $@ | ||||||||
|
||||||||
node_modules: package-lock.json .npmrc | ||||||||
npm install --no-save | ||||||||
@touch node_modules | ||||||||
|
||||||||
.PHONY: npm-cache | ||||||||
npm-cache: .npm-cache $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui | ||||||||
|
||||||||
.npm-cache: package-lock.json | ||||||||
.npm-cache: package-lock.json .npmrc | ||||||||
rm -rf .npm-cache | ||||||||
$(eval ESBUILD_VERSION := $(shell node -p "require('./package-lock.json').dependencies.esbuild.version")) | ||||||||
npm config --userconfig=.npmrc set cache=.npm-cache | ||||||||
$(eval ESBUILD_PLATFORMS := darwin-64 $(foreach arch,arm arm64 32 64,linux-${arch}) $(foreach arch,32 64,windows-${arch})) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seriously just use the foreach again here to append the ESBUILD_VERSION
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As stated in OP, that'll mean these stuff gets output to the console. I'm not a fan of overly long lines either in source or log. Using |
||||||||
npm config --userconfig=.npmrc rm cache; echo cache=.npm-cache >> .npmrc | ||||||||
rm -rf node_modules && npm install --no-save | ||||||||
npm config --userconfig=$(FOMANTIC_WORK_DIR)/.npmrc set cache=../../.npm-cache | ||||||||
echo $(foreach build, darwin-64 $(foreach arch,arm arm64 32 64,linux-${arch}) $(foreach arch,32 64,windows-${arch}), esbuild-${build}@$(ESBUILD_VERSION)) | tr " " "\n" | xargs -n 1 -P 4 npm cache add | ||||||||
rm -rf $(FOMANTIC_WORK_DIR)/node_modules | ||||||||
echo $(ESBUILD_PLATFORMS) | xargs printf "esbuild-%s@$(ESBUILD_VERSION)\n" | xargs -n 1 -P 4 npm cache add | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
rm -rf $(FOMANTIC_WORK_DIR)/node_modules $(FOMANTIC_WORK_DIR)/package-lock.json | ||||||||
@touch .npm-cache | ||||||||
|
||||||||
.PHONY: npm-uncache | ||||||||
npm-uncache: | ||||||||
rm -rf .npm-cache | ||||||||
npm config --userconfig=$(FOMANTIC_WORK_DIR)/.npmrc rm cache | ||||||||
npm config --userconfig=.npmrc rm cache | ||||||||
|
||||||||
.PHONY: npm-update | ||||||||
|
@@ -696,17 +701,17 @@ npm-update: node-check | node_modules | |||||||
fomantic: $(FOMANTIC_DEST) | ||||||||
|
||||||||
$(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui: | ||||||||
ln -sf ../../semantic.json $(FOMANTIC_WORK_DIR) | ||||||||
cd $(FOMANTIC_WORK_DIR); \ | ||||||||
cp "$$OLDPWD/semantic.json" ./; \ | ||||||||
rm -rf node_modules && mkdir node_modules && \ | ||||||||
npm install fomantic-ui; \ | ||||||||
npm install --no-optional --cache="$$OLDPWD/.npm-cache"; \ | ||||||||
rm -f semantic.json | ||||||||
@touch $(FOMANTIC_WORK_DIR)/node_modules | ||||||||
|
||||||||
$(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui | ||||||||
ln -sf ../../semantic.json $(FOMANTIC_WORK_DIR) | ||||||||
rm -rf $(FOMANTIC_WORK_DIR)/build | ||||||||
cd $(FOMANTIC_WORK_DIR); \ | ||||||||
rm -rf build; \ | ||||||||
cp "$$OLDPWD/semantic.json" ./; \ | ||||||||
cp -f theme.config.less node_modules/fomantic-ui/src/theme.config; \ | ||||||||
cp -rf _site node_modules/fomantic-ui/src/; \ | ||||||||
npx gulp -f node_modules/fomantic-ui/gulpfile.js build; \ | ||||||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"fomantic-ui": "^2.8.7" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote we do not have any more bsdtar stuff here. By all means allow bsdtar users to set an environment variable to use it like this:
So that if you run:
TAR="bsdtar --no-xattrs --format=gnutar" make ...
you use it.I'd even state that this:
needs to go too but I'm not averse to hacks like detecting if the provided tar is bsdtar e.g.
Why are we even still going through this - what are the real benefits to using bsdtar? if you're going to use the --format=gnutar does it even have any improvement anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It started because macOS doesn't ship GNU Tar and aliases
bsdtar
astar
, so the original script led to wrong files being included (which your new fix doesn't handle). The last PR was very close to a good solution already. I'm not against removing it from.drone.yml
anyway.bsdtar
/libarchive still comes with all the benefits with file handling and compression and the like when using a different output stream writer, and as stated the (good) compatibility of these archives are documented clearly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cf. relevant change suggested to #15273 for fixing Mac issue singularly.