From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id C1F4A1FAE5 for ; Thu, 8 Jun 2017 15:47:57 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 5232D1207BB; Fri, 9 Jun 2017 00:47:55 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id CDCC81207BA for ; Fri, 9 Jun 2017 00:47:53 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=ddhkWtvgiJ0S5QsCbHNFX+V9nyE=; b=virOF+K2KKaBayH/X6 UTzlp8gWinv4W0giCiYQphhO1VJL8a7IQYoqGCAMCU/XUErzq4ZQkiRlxr5e2e+F lenye+ooR7RDLK0FdxEMbxDS1e5mb36jHglIxckKKjg2xJu2IMasHKlTQX3eo5gq bAleUvfNLtSAM+MkUkHcU9tM0= Received: by filter0544p1mdw1.sendgrid.net with SMTP id filter0544p1mdw1-373-5939715A-35 2017-06-08 15:46:34.535413511 +0000 UTC Received: from herokuapp.com (ec2-54-83-92-26.compute-1.amazonaws.com [54.83.92.26]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id ygSliEJaRzKWsFSSdQPI9Q Thu, 08 Jun 2017 15:46:34.504 +0000 (UTC) Date: Thu, 08 Jun 2017 15:46:34 +0000 From: lemsx1@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56648 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13040 X-Redmine-Issue-Author: lemsx1 X-Redmine-Sender: lemsx1 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4tK9BLqGtbw56QH40LYQGGzxat4VR45dPgrQ pRhaikFI2IFmbdjyLPzuai0p/IYNtuiqYJdpyvE/E243mTq9STjTofisYl/EybCSh5rvVqeswHzFK1 VH0gqJAJUcd0PPmpph5MHP52gSK7HL3CA9KG X-ML-Name: ruby-core X-Mail-Count: 81622 Subject: [ruby-core:81622] [Ruby trunk Bug#13040] syslog/logger uses "require 'logger'" which is interpreted as circular dependency X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13040 has been updated by lemsx1 (Luis Mondesi). Ok, I was able to reproduce this now. 1. create a new Rails Project 2. create an initializer under configs/initializer named "delayed_job.rb" with: require 'syslog/logger' Delayed::Worker.delay_jobs = !Rails.env.test? Delayed::Worker.logger = Rails.logger # hack to reopen syslog in local1 Syslog::Logger.syslog.close Syslog::Logger.syslog = Syslog.open('bmanage', Syslog::LOG_ODELAY, Syslog::LOG_LOCAL1) 3. run bin/rake test or bundle exec rake test Essentially, this was required with older libraries of Syslog::Logger. Now that Syslog::Logger allows one to change facility when initializing an instance, there is no need for this code. After removing this code, the bug went away! You can now close this issue. ---------------------------------------- Bug #13040: syslog/logger uses "require 'logger'" which is interpreted as circular dependency https://bugs.ruby-lang.org/issues/13040#change-65320 * Author: lemsx1 (Luis Mondesi) * Status: Feedback * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- while using the 'syslog/logger' require from Ruby it works well, however if one tries to use it via "test" it complaints about circular require and the constant "Logger" not defined. After a little digging, I realized that 'syslog/logger' has a line that says require 'logger' which could mean itself! The fix is to use require_relative '../logger' as this is what it intends in order to piggy back on Logger: Current code for syslog/logger: 1. # frozen_string_literal: false 2. require 'syslog' 3. require 'logger' Fixed code: 1. # frozen_string_literal: false 2. require 'syslog' 3. require_relative '../logger' -- https://bugs.ruby-lang.org/