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

factorio: update all versions #73165

Merged
merged 1 commit into from Jan 11, 2020
Merged

factorio: update all versions #73165

merged 1 commit into from Jan 11, 2020

Conversation

@ikervagyok
Copy link
Contributor

@ikervagyok ikervagyok commented Nov 10, 2019

also adds libpulseaudio, as experimental already needs is and soon
stable will need it too.

Motivation for this change

update

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @Baughn @elitak


libPath = stdenv.lib.makeLibraryPath [
alsaLib
libpulseaudio

This comment has been minimized.

@Baughn

Baughn Nov 11, 2019
Contributor

This addition probably means 17.x won't also need alsaLib. Can you check that, and if it's true, add a TODO to remove it when stable is updated?

@elitak
Copy link
Contributor

@elitak elitak commented Nov 11, 2019

Looks good; built and ran fine for me.

@ikervagyok ikervagyok force-pushed the ikervagyok:factorio branch 2 times, most recently from 221a945 to 68934fa Nov 12, 2019
@ofborg ofborg bot requested a review from Baughn Nov 12, 2019
Copy link
Contributor

@Br1ght0ne Br1ght0ne left a comment

Got two hash mismatches:

hash mismatch in fixed-output derivation '/nix/store/d8kwrnybxd2cnml708xrags1kgdv7z0m-factorio_alpha_x64-0.17.74.tar.xz':
  wanted: sha256:0qasp5qm3q6zg4l077dpyyg7gx3mm0zszhvi41g95611hzrksrh6
  got:    sha256:1p5zjib46d76ngyfwn593a3mhqn71nz9kyyxfv87z8xkhj5a47jf
hash mismatch in fixed-output derivation '/nix/store/hjr3h3ii5rk0wmxgqgd72433211b4rhz-factorio_alpha_x64-0.17.76.tar.xz':
  wanted: sha256:13ck7sabnl3k8i4cr4hxzschkvlikwzcpd04rf0iv9j89q08dzly
  got:    sha256:1qx86n1y5wc769dbr4ciia08zq45c8dss3i6qzvppnz18fs4b4vr

Other than that, builds and runs fine.

pkgs/games/factorio/default.nix Outdated Show resolved Hide resolved
pkgs/games/factorio/default.nix Outdated Show resolved Hide resolved
and adds libpulseaudio as a dependency
@ikervagyok ikervagyok force-pushed the ikervagyok:factorio branch from 68934fa to 6fad697 Dec 4, 2019
@ikervagyok
Copy link
Contributor Author

@ikervagyok ikervagyok commented Dec 4, 2019

@filalex77: you're right, i've fixed the hashes and updated to the latest release. also built on my own hydra now, to check automatically if i messed up.

@Baughn: i've tested this and we need alsa as well as pulse.

@Br1ght0ne
Copy link
Contributor

@Br1ght0ne Br1ght0ne commented Dec 4, 2019

@GrahamcOfBorg build factorio factorio-demo factorio-experimental factorio-headless factorio-headless-experimental


Whoops, forgot that Factorio is unfree :(

@ofborg ofborg bot requested a review from elitak Dec 4, 2019
@elitak
Copy link
Contributor

@elitak elitak commented Dec 5, 2019

Looks okay. Do I need to tell the bot somehow?

@Br1ght0ne
Copy link
Contributor

@Br1ght0ne Br1ght0ne commented Dec 5, 2019

@elitak These checks are not required to merge - they're just a helpful reference; thus, if you tested it, one of the maintainers should merge it when possible.

@TheSirC
Copy link

@TheSirC TheSirC commented Dec 23, 2019

I have a weird error popping up after installing the derivation :

Description of the error

After building & installing the game and trying to start a new campaign, I get the following popup in game and in the console :

106.474 Error MainLoop.cpp:1195: Exception at tick 5158719: Error while running reload_script: 
filesystem error: copy_file "/nix/store/dmsmbfvhsfgybbldgsmfczy2mj8y9jkg-factorio-demo-0.17.79/share/factorio/data/base/campaigns/npe/locale/uk/npe.cfg" to "/home/sirc/.factorio/temp/currently-playing/campaign-locale/uk/npe.cfg" failed: 
Permission denied [/nix/store/dmsmbfvhsfgybbldgsmfczy2mj8y9jkg-factorio-demo-0.17.79/share/factorio/data/base/campaigns/npe/locale/uk/npe.cfg] [/home/sirc/.factorio/temp/currently-playing/campaign-locale/uk/npe.cfg]

System

From the binary itself :

   0.000 2019-12-23 22:20:12; Factorio 0.17.79 (build 47865, linux64, demo)

Steps to reproduce

  1. Download the nix file
  2. nix repl
  3. pkgs = import <nixpkgs> {}
  4. factorio = pkgs.callPackages factorio.nix {}
  5. :i factorio
  6. :q
  7. factorio (as non-root)
  8. Try to launch a new campaign

Notes

Of course, the error seems to stem from filesystem permission issues but I launch it as a normal user (the person that owns the home directory) so is this the expected behavior ?

Of course, launching the game as root solves the issue as expected but should you have to launch the game as root ?

@worldofpeace worldofpeace mentioned this pull request Jan 11, 2020
4 of 10 tasks complete
@worldofpeace
Copy link
Member

@worldofpeace worldofpeace commented Jan 11, 2020

Of course, launching the game as root solves the issue as expected but should you have to launch the game as root ?

Absolutely not, and I'm just assuming that because why would a game ever need to have such privilege?

Permission denied [/nix/store/dmsmbfvhsfgybbldgsmfczy2mj8y9jkg-factorio-demo-0.17.79/share/factorio/data/base/campaigns/npe/locale/uk/npe.cfg] [/home/sirc/.factorio/temp/currently-playing/campaign-locale/uk/npe.cfg]

This is actually a common problem that happens with NixOS.
It sounds like factorio copies these files from the nix store to some temp directory and wants to write to them, but it doesn't chmod them and make them owned by the proper user. I bet you can fix this on your own by fixing the permissions, and this is a pretty reasonable bug report to submit (I make one for it all the time).

@worldofpeace
Copy link
Member

@worldofpeace worldofpeace commented Jan 11, 2020

This has got some testing in #77288, so I don't think there's much issues. Will merge.

@worldofpeace worldofpeace merged commit 859637e into NixOS:master Jan 11, 2020
18 checks passed
18 checks passed
factorio on aarch64-linux No attempt
Details
factorio on x86_64-linux No attempt
Details
factorio, factorio-demo, factorio-experimental, factorio-headless, factorio-headless-experimental on aarch64-linux No attempt
Details
factorio, factorio-demo, factorio-experimental, factorio-headless, factorio-headless-experimental on x86_64-darwin No attempt
Details
factorio, factorio-demo, factorio-experimental, factorio-headless, factorio-headless-experimental on x86_64-linux No attempt
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@TheSirC
Copy link

@TheSirC TheSirC commented Jan 11, 2020

bet you can fix this on your own by fixing the permissions, and this is a pretty reasonable bug report to submit (I make one for it all the time).

I will look into how the game developers want bug reports then.

I bet you can fix this on your own by fixing the permissions.

I will try then. I have just no idea which user should be given the permissions.

@worldofpeace
Copy link
Member

@worldofpeace worldofpeace commented Jan 11, 2020

@TheSirC You probably want to chown /home/sirc/.factorio/ to your user and group, and make sure all the files have the correct writ-ability.

@TheSirC
Copy link

@TheSirC TheSirC commented Jan 12, 2020

You probably want to chown /home/sirc/.factorio/ to your user and group

@worldofpeace That is what is weird to me because ls -laR .factorio sends back

Output of the command
.factorio:
total 788
drwxr-xr-x  4 sirc users   4096 23 déc.  22:39 .
drwx------ 46 sirc users   4096 27 déc.  10:12 ..
-rw-r--r--  1 sirc users     19 23 déc.  22:39 achievements.dat
-rw-r--r--  1 sirc users   8777 15 déc.  15:56 blueprint-storage-demo.dat
-rwxr-xr-x  1 sirc users  23038 23 déc.  22:30 config.cfg
-rw-r--r--  1 sirc users 727369 23 déc.  22:30 crop-cache.dat
-rw-r--r--  1 sirc users   4144 23 déc.  22:39 factorio-current.log
-rw-r--r--  1 sirc users   4148 23 déc.  22:27 factorio-previous.log
drwxr-xr-x  2 sirc users   4096 23 déc.  22:39 mods
-rw-r--r--  1 sirc users    959 23 déc.  22:39 player-data.json
drwxr-xr-x  2 sirc users   4096 15 déc.  15:55 saves

.factorio/mods:
total 12
drwxr-xr-x 2 sirc users 4096 23 déc.  22:39 .
drwxr-xr-x 4 sirc users 4096 23 déc.  22:39 ..
-rw-r--r-- 1 sirc users   85 23 déc.  22:39 mod-list.json

.factorio/saves:
total 8
drwxr-xr-x 2 sirc users 4096 15 déc.  15:55 .
drwxr-xr-x 4 sirc users 4096 23 déc.  22:39 ..

which states that all the files are already in my group's and in my user's permissions and are read and writable.

@worldofpeace
Copy link
Member

@worldofpeace worldofpeace commented Jan 12, 2020

@TheSirC The directory that the error pointed doesn't exist according to the output of that command temp/currently-playing/campaign-locale/uk/npe.cfg

@akamaus
Copy link
Contributor

@akamaus akamaus commented Apr 18, 2020

@TheSirC @worldofpeace I recently stumbled upon a same error after upgrading factorio to 0.18.18. I did some quick experiments and found that game removes files in .factorio/temp/currently_playing after you hit the button on error message window (which is logical, because you return to main menu and dir is called currently_playing). If you check the directory just after you get the error, you would see than npe.cfg file. it will be in RR- mode.

As a terrible workaround I just remounted /nix/store and manually did chmod +rw for share subfolder.

@grahamc
Copy link
Member

@grahamc grahamc commented Apr 18, 2020

Remounting the nix store rw compromises the nix store and should not be done.

@TheSirC
Copy link

@TheSirC TheSirC commented Apr 18, 2020

Remounting the nix store rw compromises the nix store and should not be done.

It did seem quite...sketchy (?)

What would be the recommended way to circumvent the issue then ?

@akamaus
Copy link
Contributor

@akamaus akamaus commented May 3, 2020

@TheSirC. I see three possible ways. Only the third one being correct, imho.

  • Somehow fix the permissions inside /nix/store. I guess it may be hard because AFAIK they're reset to 444 on last installation stage
  • Implement some weird hook using LD_PRELOAD or something like that. We should detect copy being created and fix permissions on the fly.
  • Solve the problem upstream, I would say it's perfectly ok to have master-copy of files read-only. If not, why to copy them in the first place? It's responsibility of Factorio to ensure paths it's going to write to have appropriate permissions.
@elitak
Copy link
Contributor

@elitak elitak commented May 7, 2020

If you must write to the /nix/store path, you could have the wrapper script place either a bind mount or overlayfs over the directories that need write permission. Otherwise, I agree that getting the devs upstream to fix the issue is the best course. They are pretty responsive once you reach them. A post on their forums usually gets their attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.