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

'environment' dependency failure #1067

Closed
sunshineco opened this issue Jan 15, 2017 · 1 comment
Closed

'environment' dependency failure #1067

sunshineco opened this issue Jan 15, 2017 · 1 comment

Comments

@sunshineco
Copy link
Contributor

@sunshineco sunshineco commented Jan 15, 2017

Items which depends upon environment-specific configuration (in nanoc.yaml) are not reliably recompiled when a different environment is chosen.

Steps to reproduce

Specify a couple environments in nanoc.yaml:

environments:
  default:
    build: development
  prod:
    build: production

Make an item depend upon the value of build. For instance, in /about.md:

Compilation environment: <%= @config[:build] %>

Expected behavior

The item (/about.md) should be recompiled each time a different environment is chosen. One would expect this output:

$ nanoc compile
Loading site… done
Compiling site…
      create  [0.15s]  output/about/index.html
Site compiled in 0.18s.

$ nanoc -e prod compile
Loading site… done
Compiling site…
      update  [0.06s]  output/about/index.html
Site compiled in 0.06s.

$ nanoc -e default compile
Loading site… done
Compiling site…
      update  [0.06s]  output/about/index.html
Site compiled in 0.06s.

$ nanoc compile
Loading site… done
Compiling site…
Site compiled in 0.01s.

Actual behavior

The item is correctly re-compiled once, but never again afterward:

$ nanoc compile
Loading site… done
Compiling site…
      create  [0.15s]  output/about/index.html
Site compiled in 0.18s.

$ nanoc -e prod compile
Loading site… done
Compiling site…
      update  [0.06s]  output/about/index.html
Site compiled in 0.06s.

$ nanoc -e default compile
Loading site… done
Compiling site…
Site compiled in 0.01s.

$ nanoc compile
Loading site… done
Compiling site…
Site compiled in 0.01s.

Details

$ ruby --version
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
$ nanoc --version
Nanoc 4.5.3 © 2007-2017 Denis Defreyne.
Running ruby 2.4.0 (2016-12-24) on x86_64-darwin16 with RubyGems 2.6.8.
@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented Jan 16, 2017

This is reproducible!

ddfreyne added a commit that referenced this issue Jan 16, 2017
Do not store temp data per-env
ddfreyne added a commit that referenced this issue Jan 19, 2017
ddfreyne added a commit that referenced this issue Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants