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

Fix LaTeXML snap package publish error #4

Closed
ronaldtse opened this issue Sep 24, 2019 · 5 comments
Closed

Fix LaTeXML snap package publish error #4

ronaldtse opened this issue Sep 24, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Contributor

The resolution seems to be this: electron-userland/electron-builder#3608 (comment)

The original issue seems to be:

For some reasons the setguid flag is set on the home directory and all subdirectories inherit the flag...

The resolution seems to be: reset chmod on all built files right before packaging.

Look at develar/app-builder@b34fa7d#diff-610408e9d8c7bf76507a8148ea6e10b3R263

(

	// https://github.com/electron-userland/electron-builder/issues/3608
 	// even if electron-builder will correctly unset setgid/setuid, still, quite a lot of possibilities for user to create such incorrect permissions,
 	// so, just unset it using chmod right before packaging
 	dirs := []string{stageDir, *options.appDir, templateDir}
 	err = util.MapAsync(len(dirs), func(taskIndex int) (func() error, error) {
 		dir := dirs[taskIndex]
 		return func() error {
 			_, err := util.Execute(exec.Command("chmod", "-R", "g-s", dir), dir)
 			if err != nil {
 				log.WithError(err).Warn("cannot execute chmod")
 			}
 			return nil
 		}, nil
 	})

  	if err != nil {
 		return errors.WithStack(err)
 	}

)

https://travis-ci.com/metanorma/latexml-snap/builds/128696040

Full trace:

Using local configuration ('.snapcraft/snapcraft.cfg'), changes will not be persisted.
1248
1249Login successful. You now have these capabilities:
1250
1251snaps:       ['latexml']
1252channels:    ['edge']
1253permissions: ['package_access', 'package_push', 'package_release']
1254expires:     2020-09-21T23:56:22.406272
1255
1256Preparing to push 'latexml_fixed.snap'.
1257After pushing, an attempt will be made to release to 'edge'
1258Using local configuration ('.snapcraft/snapcraft.cfg'), changes will not be persisted.
1259Using local configuration ('.snapcraft/snapcraft.cfg'), changes will not be persisted.
1260Pushing 'latexml_fixed.snap' [===========================================] 100%
1261Processing...|                                                                 
1262Error while processing...
1263The store was unable to accept this snap.
1264  - found errors in file output: unusual mode 'rwxrwsr-x' for entry './usr/local/share/sgml', unusual mode 'rwxrwsr-x' for entry './usr/local/share/sgml/declaration', unusual mode 'rwxrwsr-x' for entry './usr/local/share/sgml/dtd', unusual mode 'rwxrwsr-x' for entry './usr/local/share/sgml/entities', unusual mode 'rwxrwsr-x' for entry './usr/local/share/sgml/misc', unusual mode 'rwxrwsr-x' for entry './usr/local/share/sgml/stylesheet', unusual mode 'rwxrwsr-x' for entry './usr/local/share/xml', unusual mode 'rwxrwsr-x' for entry './usr/local/share/xml/declaration', unusual mode 'rwxrwsr-x' for entry './usr/local/share/xml/entities', unusual mode 'rwxrwsr-x' for entry './usr/local/share/xml/misc', unusual mode 'rwxrwsr-x' for entry './usr/local/share/xml/schema'
1265  - checksums do not match. Please ensure the snap is created with either 'snapcraft pack <DIR>' (using snapcraft >= 2.38) or 'mksquashfs <dir> <snap> -noappend -comp xz -all-root -no-xattrs -no-fragments'. If using electron-builder, please upgrade to latest stable (>= 20.14.7). See https://forum.snapcraft.io/t/automated-reviews-and-snapcraft-2-38/4982/17 for details.
1266Script failed with status 2
1267
1268
@ronaldtse ronaldtse added the bug Something isn't working label Sep 24, 2019
@ronaldtse
Copy link
Contributor Author

Still failing in the latest build:

checksums do not match. Please ensure the snap is created with either 'snapcraft pack <DIR>' (using snapcraft >= 2.38) or 'mksquashfs <dir> <snap> -noappend -comp xz -all-root -no-xattrs -no-fragments'. If using electron-builder, please upgrade to latest stable (>= 20.14.7). See https://forum.snapcraft.io/t/automated-reviews-and-snapcraft-2-38/4982/17 for details. security-snap-v2_squashfs_repack_checksum What does this mean?
found errors in file output: unusual mode 'rwxr-sr-x' for entry './usr/local/share/sgml', unusual mode 'rwxr-sr-x' for entry './usr/local/share/sgml/declaration', unusual mode 'rwxr-sr-x' for entry './usr/local/share/sgml/dtd', unusual mode 'rwxr-sr-x' for entry './usr/local/share/sgml/entities', unusual mode 'rwxr-sr-x' for entry './usr/local/share/sgml/misc', unusual mode 'rwxr-sr-x' for entry './usr/local/share/sgml/stylesheet', unusual mode 'rwxr-sr-x' for entry './usr/local/share/xml', unusual mode 'rwxr-sr-x' for entry './usr/local/share/xml/declaration', unusual mode 'rwxr-sr-x' for entry './usr/local/share/xml/entities', unusual mode 'rwxr-sr-x' for entry './usr/local/share/xml/misc', unusual mode 'rwxr-sr-x' for entry './usr/local/share/xml/schema' security-snap-v2_squashfs_files

@ronaldtse
Copy link
Contributor Author

@CAMOBAP795 sounds good, let's proceed!

@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Oct 5, 2019

@ronaldtse released https://snapcraft.io/latexml

@CAMOBAP CAMOBAP closed this as completed Oct 5, 2019
@ronaldtse
Copy link
Contributor Author

@CAMOBAP795 amazing, thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants